레퍼런스HTTP APILimits & receipts

The usage summary of a period by model or by agent

GET
/v1/usage/breakdown

Groups the sessions GET /v1/usage/summary adds up by the model their metered calls named (by=model) or by their agent (by=agent), largest cost first, with the input, output, cache read and cache write tokens of those calls. scope, since, until and who may read which scope are exactly the summary's; the period spans at most 366 days.

token_count is the four token columns' sum; the 1-hour cache writes are inside cache_creation_input_tokens. totals is the summary of the same period: its session_count, token_count and cost_usd equal it.

  • by=agent: each session counts once under its agent (key is the agent id, label its name), so the rows add up to totals in every column. Sessions without an agent are the row whose key and label are null.
  • by=model: a session counts under every model it called, so the rows' session_count may add up to more than the totals'. A session's cost its metered calls do not explain, such as an engine's turn totals from before proxy metering, is the row whose key and label are null, with no tokens.

It changes nothing.

Scope: sessions:read (API key or cookie session).

Authorization

headerAuthorizationBearer <token>

For servers and scripts: an API key sent as an HTTP bearer token, Bearer <key>. It holds exactly the scopes it was issued with; a key issued before scopes existed holds none. It never needs the CSRF header, and it cannot manage agents, members, teams or API keys. Issue one in the web console under Settings → API keys; each operation names the scope it needs.

Scope: sessions:read

Query Parameters

scope*string

Whose sessions to count. The description says who may read each scope.

Value in"installation""me"
since*|

Start of the period, inclusive: a date (2026-10-01, that day's 00:00 UTC) or a timestamp with an offset, moved to UTC.

until?|

End of the period, exclusive, in the same forms as since. Without it the period ends when the figures are read.

by*string

Groups by the model the metered calls named, or by agent.

Value in"model""agent"

Response Body

The groups and their totals; this example is by=model.

application/json
  1. response
rows*array<>
totals*
Example Request
curl -X GET 'https://example.com/v1/usage/breakdown?scope=installation&since=2019-08-24&by=model'
Example Response
{  "rows": [    {      "key": "claude-opus-5-5",      "label": "claude-opus-5-5",      "session_count": 9,      "input_tokens": 182000,      "output_tokens": 64000,      "cache_read_input_tokens": 1210000,      "cache_creation_input_tokens": 96000,      "token_count": 1552000,      "cost_usd": "2.811000"    },    {      "key": null,      "label": null,      "session_count": 1,      "input_tokens": 0,      "output_tokens": 0,      "cache_read_input_tokens": 0,      "cache_creation_input_tokens": 0,      "token_count": 0,      "cost_usd": "0.407400"    }  ],  "totals": {    "session_count": 10,    "input_tokens": 182000,    "output_tokens": 64000,    "cache_read_input_tokens": 1210000,    "cache_creation_input_tokens": 96000,    "token_count": 1552000,    "cost_usd": "3.218400"  }}