Skip to navigation

Get Project Usage

Spend totals for one project over a date range, plus a per-model breakdown. Totals are by day; the per-model breakdown is by month and covers the whole months the range overlaps.

Authentication

AuthorizationBearer

A management key (mgmt_...), sent as Authorization: Bearer <key>. Reading /v1/routing-policies also accepts the organization’s gateway API keys; writing there needs a management key.

Path parameters

project_idstringRequiredformat: "uuid"

The project’s id.

Query parameters

startstring or nullOptional

First day of the range, YYYY-MM-DD, inclusive. Defaults to the 1st of this month.

endstring or nullOptional

Last day of the range, YYYY-MM-DD, inclusive. Defaults to today.

Response

The project's spend and usage for the range
byok_spenddouble

Spend on your own provider credentials (BYOK), at list price, USD.

endstring

Last day of the range, inclusive, YYYY-MM-DD.

merge_hosted_spenddouble

Spend on Merge-managed credentials, USD.

model_spendmap from strings to doubles

Spend in USD per provider/model, with BYOK spend at list price. Covers the whole months the range overlaps. Months before per-project model tracking began have totals but no entries here.

model_spend_granularity"month"

model_spend covers the whole months overlapping start to end.

project_idstringformat: "uuid"
The project.
request_countinteger
Number of requests.
startstring

First day of the range, YYYY-MM-DD.

total_spenddouble
All spend, USD.
web_search_spenddouble

Server-side web search cost, USD.

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error