Skip to main content

GET /v1/usage

Returns a cursor-paginated usage summary broken down by user, model, and time period. Use this endpoint to build reports, power dashboards, or feed data into external analytics systems.

Query parameters

string
default:"daily"
Aggregation period for usage records.Allowed values: hourly, daily, weekly, monthly
string
Start of the date range (inclusive). ISO 8601 date format: YYYY-MM-DD.
string
End of the date range (inclusive). ISO 8601 date format: YYYY-MM-DD.
string
Filter results to a single user by their UUID.
string
Filter results to a specific model name (e.g., gpt-4, claude-3-opus).
string
Opaque pagination cursor. Pass next_cursor from the previous response. Omit for the first page.
integer
default:"25"
Items per page. Min 1, max 100.

Response

Returns a paginated envelope where each item is a UsageSummary object.
UsageSummary[]
required
Array of usage records for the requested period and filters.
string | null
required
Cursor to pass on the next request. null on the last page.
boolean
required
true if more pages exist.
integer
Total number of matching records.

Examples

Response

Error responses