Skip to content
Sign in Create account

Export usage as CSV

GET /api/v1/billing/usage/export

Streams a CSV of up to 10,000 usage rows with request ID, provider, model, token counts, costs, response time, and creation time. Requires billing.read. Optional date and provider filters are supported; the route is limited to five requests per minute. This operation is also available under the versioned path.

Authenticate with a portal session token.

Parameters

  • from string (date) query
  • to string (date) query
  • provider string query
    Length: at most 64 characters. Pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$

Responses

200 CSV export with at most 10,000 rows.

text/csv string

401 Missing or invalid bearer token.

application/json object

Any keys are accepted.

403 The caller does not meet the route requirements: accepted Terms of Service and Privacy Policy.

application/json object

Any keys are accepted.

422 Date or provider query value failed validation.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 The five-requests-per-minute route throttle was exceeded.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string