Export usage as CSV
GET /api/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.
Authenticate with a portal session token.
Parameters
fromstring (date) querytostring (date) queryproviderstring queryLength: 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
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
429 The five-requests-per-minute route throttle was exceeded.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string