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, split by billing source.

Query parameters

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

Response

agent_sessionsUsageTotalsrequired

Cost and tokens of agent sessions only.

billing_periodsarray<BillingPeriodOption>required
by_billing_sourcearray<BillingSourceUsage>
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