Api
Management API
Manage API keys and retrieve usage data
Management API
These endpoints allow you to programmatically manage your API keys and retrieve usage statistics.
API Keys
List API Keys
URL: GET https://api.docsrouter.com/v1/api-keys
{
"object": "list",
"data": [
{
"id": "apk_...",
"name": "Production Key",
"prefix": "dr_sk_live_a...",
"created_at": 1716300000,
"last_used_at": 1716400000
}
]
}Create API Key
URL: POST https://api.docsrouter.com/v1/api-keys
Body:
{
"name": "New Key Name"
}Response: Returns the full key only once.
{
"id": "apk_...",
"name": "New Key Name",
"key": "dr_sk_live_...",
"prefix": "dr_sk_live_a...",
"created_at": 1716300000
}Revoke API Key
URL: DELETE https://api.docsrouter.com/v1/api-keys/:id
Revokes the key immediately.
Usage Analytics
Get Usage Logs
URL: GET https://api.docsrouter.com/v1/usage
Retrieve detailed logs of every request.
Parameters:
start_date(timestamp): Filter logs after this time.end_date(timestamp): Filter logs before this time.limit(int): Number of logs to return (max 100).offset(int): Pagination offset.status: Filter bysuccessorerror.
Get Usage Summary
URL: GET https://api.docsrouter.com/v1/usage/summary
Returns aggregated stats for a period.
{
"total_requests": 150,
"successful_requests": 148,
"total_tokens_used": 250000,
"cost": {
"total_usd": 1.25,
"formatted": "$1.25"
}
}