Skip to content

Admin API Overview

The Admin API provides endpoints for provisioning API keys, listing them, revoking them, and querying usage statistics.

https://api.bve.me

All admin routes require the admin API key in the Authorization header:

Authorization: Bearer admin_bve_YOUR_ADMIN_KEY

The 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.

MethodPathDescription
POST/admin/api-keysCreate a new API key
GET/admin/api-keysList all API keys
GET/admin/api-keys/:idGet a single API key by ID
PATCH/admin/api-keys/:idUpdate key name or limits
POST/admin/api-keys/:id/rotateRotate (replace) the raw key value
POST/admin/api-keys/:id/suspendSuspend an active key
POST/admin/api-keys/:id/unsuspendUnsuspend a suspended key
POST/admin/api-keys/:id/revokePermanently revoke a key
POST/admin/api-keys/bulk-suspendSuspend up to 100 active keys in one request
POST/admin/api-keys/bulk-unsuspendUnsuspend up to 100 suspended keys in one request
POST/admin/api-keys/bulk-revokePermanently revoke up to 100 keys in one request
GET/admin/api-keys/:id/quotaGet real-time quota status and remaining capacity
POST/admin/api-keys/:id/reset-quotaReset Durable Object quota counters for a key
GET/admin/api-keys/:id/statsPer-key aggregate stats from sampled logs (latency, tokens, error rate)
GET/admin/api-keys/:id/auditPer-key lifecycle event history (create, update, suspend, rotate, revoke); 404s if key not found
GET/admin/api-keys/:id/usagePer-key daily and monthly usage history (404s if key not found)
GET/admin/statsGateway-wide aggregate statistics (key counts, monthly totals, isolate cap status)
GET/admin/usageGet usage statistics
GET/admin/audit-logsList audit log entries
GET/admin/request-logsList sampled request log entries
GET/admin/model-statsPer-model aggregate statistics from sampled request logs (request counts, token sums, latency)
GET/admin/endpoint-statsPer-endpoint aggregate statistics from sampled request logs (request counts, latency, error rate)
GET/admin/key-statsPer-key leaderboard from sampled request logs (top keys by request count, token totals, latency)
GET/admin/model-allowlistList global model allowlist entries
GET/admin/model-allowlist/:modelInspect allowlist status and registry metadata for one model
POST/admin/model-allowlistAdd or update a model allowlist entry using an exact live Fuelix model ID
DELETE/admin/model-allowlist/:modelRemove a model from the allowlist

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

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 with status=active and no past expiry (truly functional)
  • keys.expired — keys with status=active but expires_at in the past (will return 401)
  • keys.expiring_soon — active keys expiring within the next 7 days
  • keys.totalactive + suspended + revoked + expired

The admin dashboard surfaces expired and expiringSoon as operational alerts on the overview page.

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.