Usage Statistics
Endpoint
Section titled “Endpoint”GET https://api.bve.me/admin/usageAuthorization: Bearer admin_bve_YOUR_ADMIN_KEYReturns aggregated usage statistics from Cloudflare D1. Usage is recorded asynchronously after each request via ctx.waitUntil.
Query parameters
Section titled “Query parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
key_id | string | No | Filter by API key UUID. Omit to get all keys. |
Response
Section titled “Response”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" } ]}cURL — all keys
Section titled “cURL — all keys”curl "https://api.bve.me/admin/usage" \ -H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"cURL — single key
Section titled “cURL — single key”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 always0— token tracking from upstream responses is not yet implemented. OnlyrequestCountis accurate. - Usage data is stored in the
monthly_usageanddaily_usagetables in Cloudflare D1. - Sampled request logs are stored in
request_logs_sampled(not exposed via this endpoint).