레퍼런스HTTP APILimits & receipts

The usage summary of a period, one bucket per UTC day

GET
/v1/usage/series

Splits GET /v1/usage/summary by the UTC day each session was created on: one bucket per day the period [since, until) touches, oldest first, days without sessions included. scope, since, until and who may read which scope are exactly the summary's; the period spans at most 366 days. bucket is day, the only size.

The buckets of one response add up to the summary of the same period: session_count, cost_usd and token_count sum, and cost_complete is false on a day whose sessions include one the summary would mark incomplete. run_seconds is the floor of the running total of turn time minus the floor of the one before it, so two days of 0.6 seconds read 0 and 1, as the summary reads 1. A long session's cost and time count on the day it started. 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.

bucket?"day"

The size of one bucket; day is the only one.

Default"day"
Value in"day"

Response Body

The buckets as of refreshed_at.

application/json
  1. response
period*
refreshed_at*string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
buckets*array<>
Example Request
curl -X GET 'https://example.com/v1/usage/series?scope=installation&since=2019-08-24'
Example Response
{  "period": {    "since": "2026-10-09T00:00:00.000Z",    "until": "2026-10-11T08:15:43.000Z"  },  "refreshed_at": "2026-10-11T08:15:43.000Z",  "buckets": [    {      "date": "2026-10-09",      "session_count": 5,      "cost_usd": "1.204100",      "cost_complete": true,      "token_count": 702300,      "run_seconds": 2210    },    {      "date": "2026-10-10",      "session_count": 0,      "cost_usd": "0",      "cost_complete": true,      "token_count": 0,      "run_seconds": 0    },    {      "date": "2026-10-11",      "session_count": 2,      "cost_usd": "0.381000",      "cost_complete": false,      "token_count": 154200,      "run_seconds": 640    }  ]}