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

# Return API usage history

> Use this operation to return api usage history. Authenticate with Authorization: Bearer <AGENTBODY_API_KEY>. Pagination: omit cursor on the first request. When has_more is true, pass next_cursor unchanged as cursor. Cursors are opaque; do not construct, modify, or reuse them outside this pagination flow. Correct a 400 invalid-input error; do not retry unchanged.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/usage/history
openapi: 3.1.0
info:
  description: >-
    Direct authenticated APIs for public social data, people data, transcripts,
    documents, text, and SEO. Send an API key as a Bearer token. Responses never
    include provider credentials or raw provider payloads.
  license:
    name: Proprietary
    url: https://agentbody.io
  title: AgentBody API
  version: '2026-08-19'
servers:
  - url: https://api.agentbody.io
security:
  - bearerAuth: []
paths:
  /v1/usage/history:
    get:
      tags:
        - usage
      summary: Return API usage history
      description: >-
        Use this operation to return api usage history. Authenticate with
        Authorization: Bearer <AGENTBODY_API_KEY>. Pagination: omit cursor on
        the first request. When has_more is true, pass next_cursor unchanged as
        cursor. Cursors are opaque; do not construct, modify, or reuse them
        outside this pagination flow. Correct a 400 invalid-input error; do not
        retry unchanged.
      operationId: get_v1_usage_history
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/Status'
        - $ref: '#/components/parameters/APIID'
      responses:
        '200':
          $ref: '#/components/responses/UsageHistorySuccess'
        '400':
          content:
            application/json:
              example:
                error:
                  code: INVALID_ARGUMENT
                  message: example error
              schema:
                additionalProperties: false
                properties:
                  error:
                    additionalProperties: false
                    properties:
                      code:
                        const: INVALID_ARGUMENT
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Correct the input; do not retry unchanged.
          headers:
            X-Request-Id:
              description: Gateway request identifier for support and audit.
              schema:
                format: uuid
                type: string
        '401':
          content:
            application/json:
              example:
                error:
                  code: UNAUTHENTICATED
                  message: example error
              schema:
                additionalProperties: false
                properties:
                  error:
                    additionalProperties: false
                    properties:
                      code:
                        const: UNAUTHENTICATED
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Configure a valid API key; do not retry unchanged.
          headers:
            X-Request-Id:
              description: Gateway request identifier for support and audit.
              schema:
                format: uuid
                type: string
components:
  parameters:
    Limit:
      description: >-
        Maximum number of results to return. The Gateway may return fewer
        results.
      example: 10
      in: query
      name: limit
      required: false
      schema:
        maximum: 100
        minimum: 1
        type: integer
    Cursor:
      description: >-
        Opaque cursor returned by the preceding response. Omit it on the first
        request. Do not construct, modify, or reuse it outside this pagination
        flow.
      example: next-page-token
      in: query
      name: cursor
      required: false
      schema:
        maxLength: 1000
        type: string
    Status:
      description: Optional usage status filter.
      in: query
      name: status
      schema:
        enum:
          - success
          - failed
        type: string
    APIID:
      description: >-
        Optional AgentBody capability identifier returned by usage history. Use
        it only to filter this API key's usage records.
      in: query
      name: api_id
      schema:
        type: string
  responses:
    UsageHistorySuccess:
      content:
        application/json:
          example:
            has_more: false
            items:
              - api_id: instagram.post
                charged_usd: '0.02'
                completed_at: '2026-01-01T00:00:01Z'
                created_at: '2026-01-01T00:00:00Z'
                duration_ms: 185
                request_id: 00000000-0000-4000-8000-000000000001
                status: success
            next_cursor: null
          schema:
            additionalProperties: false
            properties:
              has_more:
                type: boolean
              items:
                items:
                  additionalProperties: false
                  properties:
                    api_id:
                      type: string
                    charged_usd:
                      type: string
                    completed_at:
                      format: date-time
                      type:
                        - string
                        - 'null'
                    created_at:
                      format: date-time
                      type: string
                    duration_ms:
                      format: int64
                      minimum: 0
                      type: integer
                    request_id:
                      format: uuid
                      type: string
                    status:
                      description: 'Usage settlement state: `success` or `failed`.'
                      type: string
                  required:
                    - request_id
                    - api_id
                    - status
                    - charged_usd
                    - duration_ms
                    - created_at
                    - completed_at
                  type: object
                type: array
              next_cursor:
                type:
                  - string
                  - 'null'
            required:
              - items
              - next_cursor
              - has_more
            type: object
      description: Recent API usage records.
      headers:
        X-Request-Id:
          description: Gateway request identifier for support and audit.
          schema:
            format: uuid
            type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````