Agents

Get agent usage

GET /v1/agents/{id}/metrics
Permission
read:configs
Tokens
API key, CLI user token, Session token

Read usage and spend windows for an agent.

Path parameters

idstringrequired

Query parameters

startstring, date-timerequired

Inclusive start of the usage window. Naive timestamps use UTC.

endstring, date-timerequired

Exclusive end of the usage window. Naive timestamps use UTC.

{
"interval": str,
}

Response

bucketsarray<ConfigUsageBucket>required

Sessions created and usage in each bucket of the window, oldest first, with zeros for buckets without either.

intervalenumrequired

The width of each bucket, chosen from the window's length.

one ofhourdayweek
samplesarray<AgentSessionSample>required

One entry per finished session, unordered.

spend_windowsarray<ConfigSpendWindow>required

Trailing spend versus the budget, one entry per window (1, 7, and 28 days).

On this page

No Headings
Schedule a demo