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_spenddoubleOptional

Managed-credential spend, USD.

byok_spenddoubleOptional

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

web_search_spenddoubleOptional

Server-side web search cost, USD.

total_spenddoubleOptional
request_countintegerOptional
model_spendmap from strings to doublesOptional

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

model_spend_granularityenumOptional
projectslist of objectsOptional

Present with group_by=project.

api_keyslist of objectsOptional

Present with group_by=api_key.

vendorsmap from strings to doublesOptional

Present with group_by=vendor.

startdateOptional
enddateOptional

Errors

400
Bad Request Error