Skip to main content
GET
CSharp (SDK)

Authorizations

Authorization
string
header
required

Send Authorization: Bearer , using an MKA1 API key for automation or an OAuth API access token for a signed-in application. Use a dynamic security callback to refresh OAuth access tokens. Browser session-only operations still require their declared cookie.

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Query Parameters

start_time
integer
required

Start time (Unix seconds), inclusive

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1704067200

end_time
integer

End time (Unix seconds), exclusive

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1704153600

bucket_width
enum<string>
default:1d

Width of each time bucket (1m, 1h, 1d), aligned to UTC

Available options:
1m,
1h,
1d
Example:

"1d"

limit
integer

Maximum number of buckets per page, 1-1440. Defaults to 60 for 1m, 24 for 1h and 7 for 1d buckets; values above 168 for 1h or 31 for 1d are capped there. When the window holds more buckets, has_more is true and next_page continues

Required range: 1 <= x <= 1440
Example:

30

page
string

Cursor from a previous page's next_page. Resumes at the bucket after that page; keep every other query parameter the same. A cursor issued for another start_time or bucket_width, or that resumes outside [start_time, end_time), is a 400

Example:

"WzEsMTcwNDY3MjAwMCwiMWQiLDE3MDQwNjcyMDBd"

user_ids
string[]

Filter by platform user IDs (the same dimension group_by=user_id reports)

Example:
external_user_ids
string[]

Filter by delegated end-user IDs (externalUserId, i.e. X-On-Behalf-Of subs)

Example:
all_orgs
string

Aggregate usage across all organizations (cluster admins only)

org_ids
string[]

Filter by organization IDs (cluster admins only, implies cluster scope)

Example:
group_by
enum<string>[]

Group by specified fields

Available options:
user_id,
api_key_id,
org_id,
model
models
string[]

Filter by model names

Response

200 - application/json

OK

object
any
required
data
object[]
required
has_more
boolean
required

True when the requested window holds more buckets than this page returned; fetch them with next_page

next_page
string | null
required

Cursor for the next page: pass it as page with the same query parameters to continue at the next bucket. Null on the last page

as_of
integer
required

Unix timestamp when these figures were computed. A cached report keeps the time it was computed, so this shows the report's age

Required range: -9007199254740991 <= x <= 9007199254740991
settlement_window_seconds
integer
required

How long after it occurs usage stays provisional: 86400 (24 hours). Usage older than that is final and no longer changes

Required range: -9007199254740991 <= x <= 9007199254740991
final_through
integer
required

Unix timestamp (as_of minus settlement_window_seconds) before which usage is final; usage at or after it is provisional

Required range: -9007199254740991 <= x <= 9007199254740991
final
boolean
required

True when the whole requested window ends at or before final_through, so every figure in the report is final