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
What it does
Section titled “What it does”- 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
Supported endpoints
Section titled “Supported endpoints”| Method | Path | Auth |
|---|---|---|
GET | /health | None |
GET | /openapi.json | None |
GET | /v1/models | API key |
POST | /v1/chat/completions | API key |
POST | /v1/completions | API key |
POST | /v1/embeddings | API key |
POST | /admin/api-keys | Admin key |
GET | /admin/api-keys | Admin key |
POST | /admin/api-keys/:id/revoke | Admin key |
GET | /admin/usage | Admin key |
Key design decisions
Section titled “Key design decisions”- API keys are never stored in plain text. Only
sha256(key + pepper)is stored. - Streaming SSE responses pass through without buffering —
response.bodyis 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.