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

Unix timestamp, inclusive

Required range: 0 <= x <= 9007199254740991
end_time
integer
required

Unix timestamp, exclusive

Required range: 0 <= x <= 9007199254740991
org_id
string

Cluster admins only: org whose costs to report (defaults to caller's org)

group_by

Group cost by model / api_key_id (tenant key) / team_id (sub-tenant within an org) / external_user_id (caller-supplied end user, X-On-Behalf-Of, for resale chargeback) / org_id

Available options:
model,
api_key_id,
team_id,
external_user_id,
org_id

Response

200 - application/json

OK

object
any
required
currency
string | null
required
start_time
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
end_time
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
group_by
enum<string>[]
required
Available options:
model,
api_key_id,
team_id,
external_user_id,
org_id
data
object[]
required
total_cost
number
required
total_cost_nano
string
required

Total cost in integer NANO-units (1e9 per major unit, NOT cents); use total_cost for the major amount.

unpriced_entries
integer
required

Usage entries in the window with no cost yet, which add 0 to the totals: a missing price or a rating failure, or a response still in progress (priced when it completes, and then counted in its completion window). A response cancelled or failed before it used any tokens costs nothing and is not counted

Required range: -9007199254740991 <= x <= 9007199254740991
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