Account

Get usage

GET /v1/account/usage
Permission
read:account
Tokens
API key, CLI user token, Session token

Read usage for a UTC calendar month.

Query parameters

period_startstring, date
modelarray<string>

Keep only the usage of these models. CPU, memory, and the platform fee belong to no model, so they are left out.

developerarray<string>

Keep only the usage of these developers, each a developer_key from by_developer.

{
"period_end": str,
"period_start": str,
}

Response

agent_sessionsUsageTotalsrequired

Cost and tokens of agent sessions only.

billing_periodsarray<BillingPeriodOption>required
by_dayarray<UsageDay>required

One entry per day of the period, oldest first, with zeros for days without usage.

by_developerarray<DeveloperUsage>required

Agent session cost and tokens for each developer, highest cost first.

costCostrequired

What the period's usage has cost so far.

period_endstringrequired
period_startstringrequired
prior_costCostrequired

What the prior period cost over the same number of elapsed days.

prior_tokensTokensrequired

The tokens the prior period used over the same number of elapsed days.

tokensTokensrequired

The tokens used in the period so far.

On this page

No Headings
Schedule a demo
For HumansFor Agents