Admin API Overview
The Admin API provides endpoints for provisioning API keys, listing them, revoking them, and querying usage statistics.
Base URL
Section titled “Base URL”https://api.bve.meAuthentication
Section titled “Authentication”All admin routes require the admin API key in the Authorization header:
Authorization: Bearer admin_bve_YOUR_ADMIN_KEYThe admin key is the ADMIN_API_KEY secret set on the Cloudflare Worker. It is separate from client API keys (sk-bve-...) and does not follow that format.
Admin endpoints
Section titled “Admin endpoints”| Method | Path | Description |
|---|---|---|
POST | /admin/api-keys | Create a new API key |
GET | /admin/api-keys | List all API keys |
GET | /admin/api-keys/:id | Get a single API key by ID |
PATCH | /admin/api-keys/:id | Update key name or limits |
POST | /admin/api-keys/:id/rotate | Rotate (replace) the raw key value |
POST | /admin/api-keys/:id/suspend | Suspend an active key |
POST | /admin/api-keys/:id/unsuspend | Unsuspend a suspended key |
POST | /admin/api-keys/:id/revoke | Permanently revoke a key |
POST | /admin/api-keys/bulk-suspend | Suspend up to 100 active keys in one request |
POST | /admin/api-keys/bulk-unsuspend | Unsuspend up to 100 suspended keys in one request |
POST | /admin/api-keys/bulk-revoke | Permanently revoke up to 100 keys in one request |
GET | /admin/api-keys/:id/quota | Get real-time quota status and remaining capacity |
POST | /admin/api-keys/:id/reset-quota | Reset Durable Object quota counters for a key |
GET | /admin/api-keys/:id/stats | Per-key aggregate stats from sampled logs (latency, tokens, error rate) |
GET | /admin/api-keys/:id/audit | Per-key lifecycle event history (create, update, suspend, rotate, revoke); 404s if key not found |
GET | /admin/api-keys/:id/usage | Per-key daily and monthly usage history (404s if key not found) |
GET | /admin/stats | Gateway-wide aggregate statistics (key counts, monthly totals, isolate cap status) |
GET | /admin/usage | Get usage statistics |
GET | /admin/audit-logs | List audit log entries |
GET | /admin/request-logs | List sampled request log entries |
GET | /admin/model-stats | Per-model aggregate statistics from sampled request logs (request counts, token sums, latency) |
GET | /admin/endpoint-stats | Per-endpoint aggregate statistics from sampled request logs (request counts, latency, error rate) |
GET | /admin/key-stats | Per-key leaderboard from sampled request logs (top keys by request count, token totals, latency) |
GET | /admin/model-allowlist | List global model allowlist entries |
GET | /admin/model-allowlist/:model | Inspect allowlist status and registry metadata for one model |
POST | /admin/model-allowlist | Add or update a model allowlist entry using an exact live Fuelix model ID |
DELETE | /admin/model-allowlist/:model | Remove a model from the allowlist |
Key lifecycle
Section titled “Key lifecycle”API keys progress through three statuses:
active ──suspend──► suspended ──unsuspend──► active │ │ └────revoke──────────┴────revoke──────────► revoked- active — key can make requests
- suspended — key is blocked (403), can be re-activated
- revoked — permanent, cannot be restored
Key expiry (expires_at)
Section titled “Key expiry (expires_at)”Keys can optionally have an expires_at timestamp (ISO 8601). After that date, all requests using the key return 401 api_key_expired regardless of the key’s status field. The key is not automatically revoked — its status stays active — so it can be extended by PATCHing expires_at to a future date or null.
The /admin/stats endpoint returns expiry-aware counts:
keys.active— keys withstatus=activeand no past expiry (truly functional)keys.expired— keys withstatus=activebutexpires_atin the past (will return 401)keys.expiring_soon— active keys expiring within the next 7 dayskeys.total—active + suspended + revoked + expired
The admin dashboard surfaces expired and expiringSoon as operational alerts on the overview page.
Error format
Section titled “Error format”Admin endpoints use the same error envelope as the public API:
{ "error": { "message": "Invalid admin API key", "type": "invalid_request_error", "code": "invalid_api_key" }}See Errors for a full reference.