API ReferenceAgents
Get Usage
Retrieve usage logs and per-provider summary for your API key.
Get Usage
Returns detailed usage logs and aggregated stats grouped by provider.
Authentication
Requires X-API-Key header.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 100 | Max records to return (max 500) |
offset | number | 0 | Pagination offset |
Request
curl "http://localhost:4000/v1/usage?limit=10" \
-H "X-API-Key: ak_your_key"Response (200)
{
"logs": [
{
"id": "log-uuid",
"api_key_id": "key-uuid",
"provider": "anthropic",
"model": "claude-sonnet-4-20250514",
"tokens_in": 150,
"tokens_out": 500,
"cost_usd": 0.003,
"created_at": "2026-03-26T12:00:00.000Z"
}
],
"summary": {
"by_provider": {
"anthropic": {
"calls": 42,
"total_cost": 0.35,
"total_tokens_in": 5000,
"total_tokens_out": 15000
},
"openai": {
"calls": 10,
"total_cost": 0.12,
"total_tokens_in": 2000,
"total_tokens_out": 8000
}
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
logs | array | Individual usage log entries |
summary.by_provider | object | Aggregated stats per provider |