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

# Get API consumer allowance

> Returns the live read model for the current UTC usage period and lazily rolls an expired period forward.



## OpenAPI

````yaml /openapi.json post /get_api_consumer_allowance
openapi: 3.0.3
info:
  title: Agencii Platform API
  version: 1.0.0
  description: >-
    Reference documentation for the Agencii Platform API. Provides endpoints
    allowing you to run your agents on custom backends or on other unsupported
    channels. ⚡ Live Postman Example:
    https://www.postman.com/vrsen-ai/agencii-api/overview
servers:
  - url: https://agency-swarm-app-japboyzddq-uc.a.run.app
    description: Production server
security:
  - BearerAuth: []
paths:
  /get_api_consumer_allowance:
    post:
      summary: Get API consumer allowance
      description: >-
        Returns the live read model for the current UTC usage period and lazily
        rolls an expired period forward.
      operationId: getApiConsumerAllowance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetApiConsumerAllowanceRequest'
      responses:
        '200':
          description: Current allowance returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiConsumerAllowance'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Missing or invalid platform API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: The API key does not own this integration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Integration or consumer not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      servers:
        - url: https://api-integration-v2-qd6wo466iq-uc.a.run.app
          description: Staging API v2 server
components:
  schemas:
    GetApiConsumerAllowanceRequest:
      type: object
      required:
        - apiIntegrationId
        - consumerId
      properties:
        apiIntegrationId:
          type: string
        consumerId:
          type: string
    ApiConsumerAllowance:
      type: object
      required:
        - consumerId
        - active
        - canStartRun
        - period
      properties:
        consumerId:
          type: string
        active:
          type: boolean
        canStartRun:
          type: boolean
          description: False when access is disabled or the current period is exhausted.
        period:
          $ref: '#/components/schemas/ApiConsumerPeriod'
    ApiErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
          nullable: true
          example: consumer_allowance_exhausted
    ApiConsumerPeriod:
      type: object
      required:
        - id
        - startsAt
        - endsAt
        - limitMicros
        - spentMicros
        - remainingMicros
        - inputTokens
        - outputTokens
        - usageItemCount
        - updatedAt
      properties:
        id:
          type: string
          example: '2026-09-23'
          description: >-
            UTC period start date and document ID, based on the member's
            registration date.
        startsAt:
          type: string
          format: date-time
        endsAt:
          type: string
          format: date-time
        limitMicros:
          type: integer
          format: int64
          example: 20000000
          description: USD allowance in millionths of a dollar.
        spentMicros:
          type: integer
          format: int64
          example: 4250000
        remainingMicros:
          type: integer
          format: int64
          example: 15750000
        inputTokens:
          type: integer
          format: int64
          example: 1200
        outputTokens:
          type: integer
          format: int64
          example: 300
        usageItemCount:
          type: integer
          example: 2
        lastUsageRequestId:
          type: string
          nullable: true
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Platform token required for authentication. Find or create one inside
        Profile Icon > API Keys. Example: Bearer sk-agencii-...

````

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