Get organization usage

Organization-wide spend rollup: day-granular totals, month-granular per-model breakdown, and optional per-project / per-key / per-vendor grouping. Requires the read_usage scope.

Authentication

AuthorizationBearer

A management key (prefixed mgmt_), created in the dashboard under Settings, API keys, Management keys. Distinct from a regular gateway API key, and never used to call models.

Query parameters

startdateOptional

YYYY-MM-DD, inclusive. Defaults to the start of the current month.

enddateOptional

YYYY-MM-DD, inclusive. Defaults to today.

group_byenumOptional
Allowed values:

Response

Organization spend for the range.
merge_hosted_spenddouble

Managed-credential spend, USD.

byok_spenddouble

BYOK usage at list price, USD (raw vendor cost is $0 for unpriced customer vendors).

web_search_spenddouble

Server-side web search cost, USD.

total_spenddouble
request_countinteger
model_spendmap from strings to doubles

Per-model spend, BYOK-corrected. Month-granular: covers the months the range overlaps.

model_spend_granularityenum
projectslist of objects

Present with group_by=project.

api_keyslist of objects

Present with group_by=api_key.

vendorsmap from strings to doubles

Present with group_by=vendor.

startdate
enddate

Errors

400
Bad Request Error