Admin API

Usage in UTC buckets, oldest first. See data_refreshed_at for freshness.

Query Parameters

starting_at string required
Start of the first bucket, with a UTC offset, rounded down to the bucket width and at most 12 months back.
ending_at string
End of the range, with a UTC offset, rounded up to the bucket width and capped at now (the default).
bucket_width enum<string>
Default: "1d"
Available options: 1h1d1mo
group_by enum<string>[]
Split each bucket by these; without it a bucket has one total.
api_key_ids string[]
endpoints string[]
Endpoint names as in the docs, e.g. web, news, llm_context.
plan_ids string[]
limit integer
Buckets per page for 1h / 1d / 1mo: default 24 / 7 / 3, at most 168 / 31 / 12.
Min: 1
page string
next_page of the previous page.

Headers

Bearer <admin key>.
x-admin-key string
The admin key, if you can’t send Authorization.
api-version string
Pins the response format, one of 2026-11-12.

Responses

200 Successful Response
object "list"
Default: "list"
data object[] required
data.object "usage_bucket"
Default: "usage_bucket"
data.starting_at string nullable required
data.ending_at string nullable required
data.results object[] required
data.results.api_key_id string nullable required
Null when not grouped by key, or for usage recorded without one.
data.results.endpoint string nullable required
Null when not grouped by endpoint, or for usage recorded without one.
data.results.plan_id string nullable required
Null when not grouped by plan.
data.results.requests integer nullable required
Null when requests apply to no plan in this row.
data.results.queries integer nullable required
Null when queries apply to no plan in this row.
data.results.input_tokens integer nullable required
Null when tokens apply to no plan in this row.
data.results.output_tokens integer nullable required
Null when tokens apply to no plan in this row.
api_keys object required
Labels for every api_key_id on this page.
plans object required
Labels for every plan with usage on this page; billed_on says which measures apply to each.
has_more boolean required
next_page string nullable required
data_refreshed_at string nullable required
When the last usage sync finished. Requests from the 5-10 minutes before it may not be in yet; buckets ending 2 hours before it are final.
401 Unauthorized
type string
Always ErrorResponse.
Default: "ErrorResponse"
error object required
error.id string required
A unique identifier for this particular occurrence of the problem.
error.status integer required
The HTTP status code applicable to this problem.
error.detail string nullable
Explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.
error.meta object nullable
A meta object containing non-standard meta-information about the error.
error.code enum<string> required
An Admin API error code, such as ADMIN_KEY_INVALID or ADMIN_RATE_LIMITED.
Available options: VALIDATIONINVALID_TIME_RANGEAPI_VERSION_NOT_FOUND
time integer
Unix time in seconds when the error occurred.
Default: 0
403 Forbidden
type string
Always ErrorResponse.
Default: "ErrorResponse"
error object required
error.id string required
A unique identifier for this particular occurrence of the problem.
error.status integer required
The HTTP status code applicable to this problem.
error.detail string nullable
Explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.
error.meta object nullable
A meta object containing non-standard meta-information about the error.
error.code enum<string> required
An Admin API error code, such as ADMIN_KEY_INVALID or ADMIN_RATE_LIMITED.
Available options: VALIDATIONINVALID_TIME_RANGEAPI_VERSION_NOT_FOUND
time integer
Unix time in seconds when the error occurred.
Default: 0
404 Not Found
type string
Always ErrorResponse.
Default: "ErrorResponse"
error object required
error.id string required
A unique identifier for this particular occurrence of the problem.
error.status integer required
The HTTP status code applicable to this problem.
error.detail string nullable
Explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.
error.meta object nullable
A meta object containing non-standard meta-information about the error.
error.code enum<string> required
An Admin API error code, such as ADMIN_KEY_INVALID or ADMIN_RATE_LIMITED.
Available options: VALIDATIONINVALID_TIME_RANGEAPI_VERSION_NOT_FOUND
time integer
Unix time in seconds when the error occurred.
Default: 0
422 Unprocessable Entity
type string
Always ErrorResponse.
Default: "ErrorResponse"
error object required
error.id string required
A unique identifier for this particular occurrence of the problem.
error.status integer required
The HTTP status code applicable to this problem.
error.detail string nullable
Explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.
error.meta object nullable
A meta object containing non-standard meta-information about the error.
error.code enum<string> required
An Admin API error code, such as ADMIN_KEY_INVALID or ADMIN_RATE_LIMITED.
Available options: VALIDATIONINVALID_TIME_RANGEAPI_VERSION_NOT_FOUND
time integer
Unix time in seconds when the error occurred.
Default: 0
429 Too Many Requests
type string
Always ErrorResponse.
Default: "ErrorResponse"
error object required
error.id string required
A unique identifier for this particular occurrence of the problem.
error.status integer required
The HTTP status code applicable to this problem.
error.detail string nullable
Explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.
error.meta object nullable
A meta object containing non-standard meta-information about the error.
error.code enum<string> required
An Admin API error code, such as ADMIN_KEY_INVALID or ADMIN_RATE_LIMITED.
Available options: VALIDATIONINVALID_TIME_RANGEAPI_VERSION_NOT_FOUND
time integer
Unix time in seconds when the error occurred.
Default: 0
503 Service Unavailable
type string
Always ErrorResponse.
Default: "ErrorResponse"
error object required
error.id string required
A unique identifier for this particular occurrence of the problem.
error.status integer required
The HTTP status code applicable to this problem.
error.detail string nullable
Explanation specific to this occurrence of the problem. Like title, this field’s value can be localized.
error.meta object nullable
A meta object containing non-standard meta-information about the error.
error.code enum<string> required
An Admin API error code, such as ADMIN_KEY_INVALID or ADMIN_RATE_LIMITED.
Available options: VALIDATIONINVALID_TIME_RANGEAPI_VERSION_NOT_FOUND
time integer
Unix time in seconds when the error occurred.
Default: 0