Skip to content

Usage Statistics

GET https://api.bve.me/admin/usage
Authorization: Bearer admin_bve_YOUR_ADMIN_KEY

Returns aggregated usage statistics from Cloudflare D1. Usage is recorded asynchronously after each request via ctx.waitUntil.

ParameterTypeRequiredDescription
key_idstringNoFilter by API key UUID. Omit to get all keys.

The response is an object with two arrays: daily (last 30 days for a specific key, last 100 rows for all keys) and monthly (last 12 months for a specific key, last 50 rows for all keys).

{
"daily": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"keyId": "550e8400-e29b-41d4-a716-446655440000",
"date": "2026-05-21",
"requestCount": 47,
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"updatedAt": "2026-05-21T14:32:00.000Z"
}
],
"monthly": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"keyId": "550e8400-e29b-41d4-a716-446655440000",
"yearMonth": "2026-05",
"requestCount": 1420,
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"updatedAt": "2026-05-21T14:32:00.000Z"
}
]
}
Terminal window
curl "https://api.bve.me/admin/usage" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
Terminal window
curl "https://api.bve.me/admin/usage?key_id=550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
  • Token counts (promptTokens, completionTokens, totalTokens) are always 0 — token tracking from upstream responses is not yet implemented. Only requestCount is accurate.
  • Usage data is stored in the monthly_usage and daily_usage tables in Cloudflare D1.
  • Sampled request logs are stored in request_logs_sampled (not exposed via this endpoint).