> ## 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.

# Register API consumer

> Idempotently registers one application member. Allowance values are controlled by the integration owner and cannot be supplied by this route.



## OpenAPI

````yaml /openapi.json post /register_api_consumer
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:
  /register_api_consumer:
    post:
      summary: Register API consumer
      description: >-
        Idempotently registers one application member. Allowance values are
        controlled by the integration owner and cannot be supplied by this
        route.
      operationId: registerApiConsumer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterApiConsumerRequest'
      responses:
        '200':
          description: Existing consumer returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterApiConsumerResponse'
        '201':
          description: Consumer created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterApiConsumerResponse'
        '400':
          description: Invalid request or allowance policy is not configured.
          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 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:
    RegisterApiConsumerRequest:
      type: object
      required:
        - apiIntegrationId
        - externalUserId
      properties:
        apiIntegrationId:
          type: string
        externalUserId:
          type: string
          maxLength: 512
          description: A stable user ID from your application. It is stored as a hash.
        displayName:
          type: string
          maxLength: 256
        email:
          type: string
          format: email
          maxLength: 320
    RegisterApiConsumerResponse:
      allOf:
        - $ref: '#/components/schemas/ApiConsumerAllowance'
        - type: object
          required:
            - created
          properties:
            created:
              type: boolean
    ApiErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
          nullable: true
          example: consumer_allowance_exhausted
    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'
    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.