Skip to main content
GET
Get API key usage
Get usage statistics for a specific API key within a date range. Supports aggregation by different time periods and optional grouping by user, model, custom fields, or labels. Supported group_by fields: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, extra.<field_name>, api_key_label.<label_key>, and group_label.<label_key>.

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

id
string<uuid>
required

Body

application/json
start
string<date-time>
required

Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required. The date range cannot exceed 100 days from start to end.

Example:

"2025-01-01T00:00:00Z"

end
string<date-time>

End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional. Defaults to 24 hours from start if not specified. Must be after start date. The date range cannot exceed 100 days.

Example:

"2025-01-31T23:59:59Z"

group_by
string[]

Fields to group by: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, extra.<field_name>, api_key_label.<label_key>, or group_label.<label_key>. Rows missing a requested label are grouped under "Unknown".

resolution
enum<string>
default:day

Time resolution for aggregation

Available options:
hour,
day,
month

Response

Successfully retrieved usage data

usage
object
required

Map of period (string) to usage entry

Last modified on August 4, 2026