Get Model APIs usage
Returns your organization’s Model APIs token usage as a series of contiguous time buckets, broken down by the dimensions you pass in group_by. Buckets with no usage are included, so the series has no gaps. Usage is retained for 92 days, so buckets older than that are returned with no results.
Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Query Parameters
Start of the query range (ISO 8601, UTC), inclusive. Snapped down to the start of its bucket. Required on the first page, and ignored when you pass a cursor.
End of the query range (ISO 8601, UTC), exclusive. Defaults to the current time.
Width of each time bucket: 1m, 1h, or 1d. Defaults to 1d.
1m, 1h, 1d Dimensions to break usage down by, repeated once per dimension: api_key, user, model. Defaults to model.
api_key, user, model Return only usage for these API key prefixes, repeated once per prefix.
Return only usage attributed to these user IDs, repeated once per ID.
Return only usage for these models, repeated once per model.
Number of time buckets to return. Defaults and maximums depend on bucket_width: 1d defaults to 7 and allows 31, 1h defaults to 24 and allows 168, 1m defaults to 60 and allows 1440.
Opaque cursor from the pagination.cursor field of a previous response