curl -X GET "https://api.danubeai.com/v1/api-keys/KEY_ID/usage?days=7" \
-H "danube-api-key: YOUR_API_KEY"
{
"key": {
"id": "0b6a2c1e-9f4d-4e3a-b7c8-5d6e7f8a9b0c",
"name": "research-bot",
"agent_name": "research-bot",
"agent_type": "coding_agent",
"purpose": "Nightly literature sweep",
"created_at": "2026-08-20T10:00:00+00:00"
},
"window_days": 7,
"calls": 148,
"successes": 141,
"success_rate": 0.9527,
"p50_seconds": 0.842,
"paid_calls": 12,
"spent_cents": 36,
"first_call_at": "2026-09-05T02:10:11.482+00:00",
"last_call_at": "2026-09-11T23:58:40.017+00:00",
"top_tools": [
{
"tool_id": "8ca97ef7-acf5-4869-b043-a9960a9f8085",
"tool_name": "Hacker News - Get Top Stories With Content",
"service_name": "Hacker News",
"calls": 96,
"successes": 96
}
]
}
API Keys
Get API Key Usage
Calls, success rate, latency, spend and top tools for one API key over a window of days
GET
/
v1
/
api-keys
/
{key_id}
/
usage
curl -X GET "https://api.danubeai.com/v1/api-keys/KEY_ID/usage?days=7" \
-H "danube-api-key: YOUR_API_KEY"
{
"key": {
"id": "0b6a2c1e-9f4d-4e3a-b7c8-5d6e7f8a9b0c",
"name": "research-bot",
"agent_name": "research-bot",
"agent_type": "coding_agent",
"purpose": "Nightly literature sweep",
"created_at": "2026-08-20T10:00:00+00:00"
},
"window_days": 7,
"calls": 148,
"successes": 141,
"success_rate": 0.9527,
"p50_seconds": 0.842,
"paid_calls": 12,
"spent_cents": 36,
"first_call_at": "2026-09-05T02:10:11.482+00:00",
"last_call_at": "2026-09-11T23:58:40.017+00:00",
"top_tools": [
{
"tool_id": "8ca97ef7-acf5-4869-b043-a9960a9f8085",
"tool_name": "Hacker News - Get Top Stories With Content",
"service_name": "Hacker News",
"calls": 96,
"successes": 96
}
]
}
Overview
Returns what one API key did over the lastdays days: how many tool calls it made, how many succeeded, its median latency, how much it spent, and the ten tools it called most. Each key is one agent’s identity in Danube, so this is the per-agent usage view.
Only tool executions stamped with this key are counted. Synthetic probe calls are excluded.
Auth: Requires authentication (JWT or API key). The key must belong to the caller.
Path Parameters
The API key UUID: the
id from List API Keys, not the key valueQuery Parameters
Response
Median execution time of successful calls, in seconds, rounded to three decimals.
null when there were none.Errors
| Code | Meaning |
|---|---|
| 401 | Missing or invalid auth |
| 404 | No API key with this id belongs to the caller |
| 503 | Usage is temporarily unavailable |
Example
The Python and TypeScript SDKs do not wrap this endpoint yet.curl -X GET "https://api.danubeai.com/v1/api-keys/KEY_ID/usage?days=7" \
-H "danube-api-key: YOUR_API_KEY"
{
"key": {
"id": "0b6a2c1e-9f4d-4e3a-b7c8-5d6e7f8a9b0c",
"name": "research-bot",
"agent_name": "research-bot",
"agent_type": "coding_agent",
"purpose": "Nightly literature sweep",
"created_at": "2026-08-20T10:00:00+00:00"
},
"window_days": 7,
"calls": 148,
"successes": 141,
"success_rate": 0.9527,
"p50_seconds": 0.842,
"paid_calls": 12,
"spent_cents": 36,
"first_call_at": "2026-09-05T02:10:11.482+00:00",
"last_call_at": "2026-09-11T23:58:40.017+00:00",
"top_tools": [
{
"tool_id": "8ca97ef7-acf5-4869-b043-a9960a9f8085",
"tool_name": "Hacker News - Get Top Stories With Content",
"service_name": "Hacker News",
"calls": 96,
"successes": 96
}
]
}
