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,
}
1
import os
2
3
from ellipsis import Ellipsis
4
5
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
6
7
result = client.agents.metrics("...", start="...", end="...")
8
print(result)
1
import { Ellipsis } from '@ellipsis-dev/sdk';
2
3
const client = new Ellipsis({
4
apiKey: process.env.ELLIPSIS_API_TOKEN!,
5
});
6
7
const result = await client.agents.metrics('...', { start: '...', end: '...' });
8
console.log(result);
1
curl "https://api.ellipsis.dev/v1/agents/{id}/metrics?start=...&end=..." \
2
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
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 of
hourdayweeksamplesarray<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).