Skip to content
API documentation

Export usage records (self-serve)

GET/api/v1/usage/export

Authentication · x-api-key

Streams the caller's usage line items for a period as JSON (default) or CSV (?format=csv or Accept: text/csv). The range defaults to the last 30 days and may span at most 366 days. Requires the usage:read scope.

Request

startDatequery · Optional
string

endDatequery · Optional
string

apiKeyIdquery · Optional
string

formatquery · Optional
"json" | "csv"

Default: "json".
Acceptheader · Optional
"application/json" | "text/csv"

Select JSON (default) or CSV. The format query parameter takes precedence when supplied.

Default: "application/json".

Responses

200 OK

Usage records streamed in the requested representation.

application/json

text/csv

    See the complete schema in the API explorer.

    400 Bad Request

    application/json

    • Response 400 · errorRequired

      object
      3 fields
      • Response 400 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 400 · error.messageRequired

        string

        Human readable error message

      • Response 400 · error.detailsOptional

        object

        Additional error details (optional)

    • Response 400 · successRequired

      false

      Always false for error responses

    401 Unauthorized

    application/json

    • Response 401 · errorRequired

      object
      3 fields
      • Response 401 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 401 · error.messageRequired

        string

        Human readable error message

      • Response 401 · error.detailsOptional

        object

        Additional error details (optional)

    • Response 401 · successRequired

      false

      Always false for error responses

    403 Forbidden

    application/json

    • Response 403 · errorRequired

      object
      3 fields
      • Response 403 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 403 · error.messageRequired

        string

        Human readable error message

      • Response 403 · error.detailsOptional

        object

        Additional error details (optional)

    • Response 403 · successRequired

      false

      Always false for error responses

    429 Too Many Requests

    Request allowance or task admission capacity exceeded. Follow Retry-After when present; otherwise wait for active tasks and use bounded backoff. Limits do not guarantee throughput. For SSE, this is the HTTP connection response, not an event.

    application/json

    • Response 429 · errorRequired

      object
      3 fields
      • Response 429 · error.codeRequired

        string

        RATE_LIMITED for request and task admission rejections.

      • Response 429 · error.messageRequired

        string
      • Response 429 · error.detailsOptional

        object

        Optional and scope-dependent. Request limits supply scope/policy/type/limit/current/retryAfterSec. Task admission supplies inFlight/limit/tier, plus scope=apiKey for a key cap. IP rejection can omit details. In-flight rejection does not promise Retry-After.

        8 fields
    • Response 429 · successRequired

      false

      Default: false.

    500 Internal Server Error

    application/json

    • Response 500 · errorRequired

      object
      3 fields
      • Response 500 · error.codeRequired

        string

        Application-specific error code (see error catalog)

      • Response 500 · error.messageRequired

        string

        Human readable error message

      • Response 500 · error.detailsOptional

        object

        Additional error details (optional)

    • Response 500 · successRequired

      false

      Always false for error responses

    Interactive API Explorer → · OpenAPI JSON