> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aixy-gateway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Read organization allowances and recorded Pro billing-period consumption.

Requires billing read access. Uses admission counters independent of analytics
retention and includes disabled MCP servers in connection usage. Starter allowances
use calendar months; Pro model usage uses the verified subscription period and billing
ledger. Pro MCP tool calls are unlimited and excluded from metered usage.
Missing accounting returns null,
never an inferred zero. Reading does not initialize or change quota counters.



## OpenAPI

````yaml /openapi.json get /api/billing/usage
openapi: 3.1.0
info:
  title: Aixy Gateway API
  version: 0.1.0
  description: >-
    Route requests to configured AI providers through OpenAI- and
    Anthropic-compatible APIs. Aixy applies project access, model policies,
    guardrails, routing, budgets, and usage attribution before forwarding
    inference traffic.
servers:
  - url: https://api.aixy-gateway.com
    description: Aixy production gateway
security: []
tags:
  - name: operations
    description: Check process liveness and traffic readiness.
  - name: authentication
    description: Authenticate trusted server-side clients.
  - name: organizations
    description: Manage the organization and its lifecycle.
  - name: projects
    description: Create projects and manage project membership.
  - name: users
    description: Manage organization users, roles, and invitations.
  - name: teams
    description: Manage teams and team membership.
  - name: api-keys
    description: Manage project-scoped gateway API keys.
  - name: provider-credentials
    description: Manage organization and project provider credentials.
  - name: provider-catalog
    description: Discover providers supported by the gateway.
  - name: provider-models
    description: Discover and control models exposed by configured providers.
  - name: routing
    description: Configure stable model aliases, routing strategies, and fallbacks.
  - name: guardrails
    description: Configure prompt and sensitive-data protection policies.
  - name: identity connections
    description: Configure tenant-scoped enterprise identity federation.
  - name: playground
    description: Exercise configured models through the gateway.
  - name: cost-control
    description: Inspect spend and enforce budgets across tenant scopes.
  - name: metrics
    description: Inspect usage, token, latency, and error metrics.
  - name: activity
    description: Diagnose individual model requests and manage opt-in content capture.
  - name: monitors
    description: Configure operational monitors and notification channels.
  - name: audit
    description: Query, verify, and export the organization audit log.
  - name: telemetry exports
    description: Export telemetry to organization-owned destinations.
  - name: billing
    description: Inspect and manage the organization subscription.
  - name: models
    description: List models available to a project-scoped gateway API key.
  - name: inference
    description: Run model inference through the Aixy data plane.
  - name: pricing
    description: Manage versioned pricing attribution rules.
  - name: system
    description: Discover gateway capabilities and providers.
  - name: MCP beta
    description: Mcp beta operations exposed by the gateway.
  - name: cost-optimization
    description: Cost optimization operations exposed by the gateway.
  - name: custom domains
    description: Custom domains operations exposed by the gateway.
  - name: data processing
    description: Data processing operations exposed by the gateway.
  - name: feature flags
    description: Feature flags operations exposed by the gateway.
  - name: privacy
    description: Privacy operations exposed by the gateway.
  - name: roles
    description: Roles operations exposed by the gateway.
paths:
  /api/billing/usage:
    get:
      tags:
        - billing
      summary: Overview
      description: >-
        Read organization allowances and recorded Pro billing-period
        consumption.


        Requires billing read access. Uses admission counters independent of
        analytics

        retention and includes disabled MCP servers in connection usage. Starter
        allowances

        use calendar months; Pro model usage uses the verified subscription
        period and billing

        ledger. Pro MCP tool calls are unlimited and excluded from metered
        usage.

        Missing accounting returns null,

        never an inferred zero. Reading does not initialize or change quota
        counters.
      operationId: get_billing_plan_usage
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanUsageResponse'
        '401':
          description: Authentication is required or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '403':
          description: The authenticated account cannot perform this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        '503':
          description: The control-plane capability is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
        4XX:
          description: The request was rejected by validation or authorization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
      security:
        - BrowserSession: []
components:
  schemas:
    PlanUsageResponse:
      properties:
        object:
          type: string
          const: billing.usage
          title: Object
          default: billing.usage
        effective_plan:
          type: string
          title: Effective Plan
        period_start:
          type: string
          format: date-time
          title: Period Start
        resets_at:
          type: string
          format: date-time
          title: Resets At
        observed_at:
          type: string
          format: date-time
          title: Observed At
        model_requests:
          $ref: '#/components/schemas/PlanUsageCounterResponse'
        mcp_tool_calls:
          $ref: '#/components/schemas/PlanUsageCounterResponse'
        mcp_connections:
          $ref: '#/components/schemas/PlanUsageCounterResponse'
        metered_requests:
          anyOf:
            - $ref: '#/components/schemas/MeteredPlanUsageResponse'
            - type: 'null'
          description: >-
            Pro model-request usage and overage. Pro MCP tool calls incur no
            Aixy usage charges.
      type: object
      required:
        - effective_plan
        - period_start
        - resets_at
        - observed_at
        - model_requests
        - mcp_tool_calls
        - mcp_connections
      title: PlanUsageResponse
    GatewayErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/GatewayErrorDetail'
      type: object
      required:
        - error
      title: GatewayErrorResponse
    PlanUsageCounterResponse:
      properties:
        used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Used
          description: >-
            Consumed allowance; null when unavailable or monthly usage is not
            metered.
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
          description: Effective plan ceiling; null means no plan limit.
      type: object
      required:
        - used
        - limit
      title: PlanUsageCounterResponse
    MeteredPlanUsageResponse:
      properties:
        used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Used
          description: >-
            Recorded model requests in the subscription period; excludes MCP
            tool calls.
        included:
          type: integer
          title: Included
          description: Model requests included in the subscription period.
        overage_requests:
          anyOf:
            - type: integer
            - type: 'null'
          title: Overage Requests
          description: Recorded model requests above the included allowance.
        estimated_overage_eur:
          anyOf:
            - type: string
            - type: 'null'
          title: Estimated Overage Eur
          description: >-
            Estimated service overage before tax; Stripe determines the final
            invoice.
        period_start:
          type: string
          format: date-time
          title: Period Start
        resets_at:
          type: string
          format: date-time
          title: Resets At
        reporting_status:
          type: string
          enum:
            - current
            - pending
            - attention_required
            - unavailable
          title: Reporting Status
      type: object
      required:
        - used
        - included
        - overage_requests
        - estimated_overage_eur
        - period_start
        - resets_at
        - reporting_status
      title: MeteredPlanUsageResponse
    GatewayErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
      type: object
      required:
        - code
        - message
      title: GatewayErrorDetail
  securitySchemes:
    BrowserSession:
      type: apiKey
      description: Secure same-origin browser session cookie.
      in: cookie
      name: gateway_session

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.