Skip to content

Introduction

BVE Gateway is an OpenAI-compatible API gateway that proxies requests to the Fuelix AI platform. It runs as a Cloudflare Worker on the edge with no cold-start latency.

Base URL: https://api.bve.me/v1

OpenAPI spec: https://api.bve.me/openapi.json

  • Accepts OpenAI-format requests from any client or SDK
  • Authenticates callers with hashed API keys stored in Cloudflare D1
  • Enforces per-minute, per-day, and per-month request quotas using Cloudflare Durable Objects
  • Forwards requests to Fuelix and streams responses back without buffering
  • Records usage asynchronously via ctx.waitUntil
MethodPathDescription
GET/healthHealth check
GET/openapi.jsonOpenAPI 3.1 spec

Public API (Authorization: Bearer sk-bve-YOUR_KEY)

Section titled “Public API (Authorization: Bearer sk-bve-YOUR_KEY)”
MethodPathDescription
GET/v1/usageReal-time quota snapshot for the authenticated key (does not consume quota)
GET/v1/modelsList available models
GET/v1/models/:idGet a single model
POST/v1/chat/completionsChat completions (streaming supported)
POST/v1/completionsLegacy text completions (emulated via chat completions; streaming supported)
POST/v1/embeddingsText embeddings
POST/v1/responsesOpenAI Responses API (GPT models only)
GET/v1/responses/:idRetrieve a stored response by ID
DELETE/v1/responses/:idDelete a stored response by ID
POST/v1/messagesAnthropic Messages API (Anthropic response format)
GET/v1/messages/:idAnthropic Messages API — individual message
POST/v1/audio/speechText-to-speech (binary audio stream)
POST/v1/audio/transcriptionsAudio transcription (Whisper)
POST/v1/images/generationsImage generation (Imagen 3/4; not dall-e-3)
POST/v1/images/editsImage editing (multipart/form-data)
GET/POST/v1/filesFiles API — list / upload
GET/DELETE/v1/files/:idFiles API — retrieve / delete
GET/v1/files/:id/contentFiles API — download file content
GET/POST/v1/assistantsAssistants API — list / create
GET/POST/DELETE/v1/assistants/:idAssistants API — manage assistant
*/v1/assistants/:id/…Assistants sub-resources (steps, files, etc.)
POST/v1/threadsThreads API — create thread
GET/POST/DELETE/v1/threads/:idThreads API — manage thread
*/v1/threads/:id/…Thread sub-resources (messages, runs, steps)
GET/POST/v1/vector_storesVector Stores API — list / create
GET/POST/DELETE/v1/vector_stores/:idVector Stores — manage store
*/v1/vector_stores/:id/…Vector Store sub-resources (files, batches)

Admin API (Authorization: Bearer admin_bve_YOUR_ADMIN_KEY)

Section titled “Admin API (Authorization: Bearer admin_bve_YOUR_ADMIN_KEY)”
MethodPathDescription
POST/admin/api-keysCreate API key
GET/admin/api-keysList API keys
GET/admin/api-keys/:idGet a single API key
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/quotaReal-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 percentiles, token totals, error breakdown)
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/usageUsage statistics
GET/admin/model-statsPer-model aggregate statistics (request counts, token sums, latency from sampled logs)
GET/admin/endpoint-statsPer-endpoint aggregate statistics (request counts, latency percentiles, error rate from sampled logs)
GET/admin/key-statsPer-key leaderboard — top keys by request count, with token totals and latency
GET/admin/audit-logsAudit log entries
GET/admin/request-logsSampled request log entries
GET/admin/model-allowlistList global model allowlist
GET/admin/model-allowlist/:modelInspect allowlist status and registry metadata for one model
POST/admin/model-allowlistAdd or update model allowlist entry using an exact live Fuelix model ID
DELETE/admin/model-allowlist/:modelRemove model from allowlist

See the Admin API Overview for full details on each endpoint.

  • API keys are never stored in plain text. Only sha256(key + pepper) is stored.
  • Streaming SSE responses pass through without bufferingresponse.body is piped directly.
  • Rate limiting uses a Cloudflare Durable Object (ApiKeyLimiter) per key. If the DO fails, the request is allowed (fail-open) to avoid blocking legitimate traffic.
  • Usage is recorded asynchronously — it does not add latency to the request path.