API Documentation
OpenAI-compatible API gateway with lenox/auto smart intent routing, backup key failover, 15 built-in providers, and custom OpenAI-compatible providers.
Base URL
https://api.lenoxbest.eu.cc/v1
Works with official OpenAI SDKs. /api/v1/* is also supported.
Authentication
Send your Lenox API key via Authorization: Bearer YOUR_KEY, X-Api-Key, or Api-Key.
Smart Auto-Router: lenox/auto
Send "model": "lenox/auto" to automatically dispatch each request to the best pipeline:
- Coding →
lenox/coding(code blocks, programming languages, debugging, SQL, HTML/JS) - Reasoning →
lenox/reasoning(step-by-step analysis, math, architecture, logic) - Images →
lenox/image(works on/v1/images/generationsAND directly inside/v1/chat/completionsas an inline image) - Embeddings →
lenox/embed(on/v1/embeddingsor via/embed ...in chat) - Fast / General →
lenox/fast(all other queries & automatic fallback)
GET /v1/models & GET /v1/usage
/v1/models lists all available models and aliases (including lenox/auto). /v1/usage returns your API key's rate limit, daily quota, token budget, and today's usage.
POST /v1/chat/completions
OpenAI-compatible chat completions with streaming, retries, circuit breaker, backup key failover, smart alias routing, and optional response caching (X-Lenox-Cache: true|false).
curl https://api.lenoxbest.eu.cc/v1/chat/completions \
-H "Authorization: Bearer YOUR_LENOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"lenox/auto","messages":[{"role":"user","content":"Write a TypeScript debounce function"}]}'POST /v1/embeddings
Generates vector embeddings via upstream providers or Cloudflare Workers AI (lenox/embed, lenox/auto, or cloudflare/@cf/baai/bge-base-en-v1.5).
curl https://api.lenoxbest.eu.cc/v1/embeddings \
-H "Authorization: Bearer YOUR_LENOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"lenox/embed","input":"Hello world"}'POST /v1/images/generations
Generates images via upstream providers or Cloudflare Workers AI (lenox/image, lenox/auto, or cloudflare/@cf/black-forest-labs/flux-1-schnell). Cloudflare returns base64 b64_json.
curl https://api.lenoxbest.eu.cc/v1/images/generations \
-H "Authorization: Bearer YOUR_LENOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"lenox/image","prompt":"A futuristic neon city at night"}'POST /v1/audio/transcriptions
Multipart form-data audio transcription via Groq Whisper, OpenAI-compatible endpoints, lenox/auto, or cloudflare/@cf/openai/whisper.
Response Headers
x-request-id— unique request trace IDx-lenox-alias,x-lenox-auto-intent&x-lenox-routed-model— resolved target model & auto-detected intentx-lenox-key-slot— which provider key slot served the request (primary,backup_1,backup_2)x-lenox-cache—HITorMISSwhen caching is activex-lenox-latency-ms— upstream execution timex-ratelimit-limit,x-ratelimit-remaining,x-lenox-daily-remaining