A high-performance Rust API gateway use **a single endpoint** to access multiple LLM providers.
9.1K
One Router is a high-performance API gateway written in Rust that gives you a single endpoint for multiple LLM providers. Point your existing OpenAI or Anthropic SDK at it — requests are automatically translated and routed to AWS Bedrock, Google Gemini, Anthropic, or OpenAI.
Full documentation: https://github.com/XtraVisionsAI/one-router
/v1/chat/completions) and Anthropic (/v1/messages) request formats/v1/responses compatible with the Codex CLI: named-event SSE streaming and stateful multi-turn via previous_response_id/v1/responses, one-hop conversion on /v1/messages and /v1/chat/completions)/v1/embeddings and /v1/images/generations, Cohere-compatible /v1/rerank, backed by Bedrock / OpenAI / Geminigpt-4o → Claude Sonnet) with exact match, wildcards, and priorities["*", "!openai.*"]), and model-level failover chains/admin; changes hot-reload without restartGET /v1/usage query API and an unauthenticated ointlinux/amd64 and linux/arm64; self-update support on bare metaldocker run -d -p 8000:8000 \
-e MASTER_API_KEY=sk-your-secret \
-e ENCRYPTION_KEY=your-64-char-hex-key \
-v one-router-data:/app/data \
xtravisions/one-router:latest
Then open http://localhost:8000/admin, sign in with your master key, add backend credentials, and create API keys for the /v1/* endpoints.
Point your existing SDK at One Router — no code changes needed.
from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="http://localhost:8000/v1")
response = client.chat.completions.create(
model="gpt-4o", # automatically routed to Claude on Bedrock
messages=[{"role": "user", "content": "Hello!"}],
)
import anthropic
client = anthropic.Anthropic(api_key="sk-...", base_url="http://localhost
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
The Codex CLI works too: set its base URL to http://localhost:8000/v1.
Claude Code works too: set ANTHROPIC_BASE_URL=http://localhost:8000 and ANTHROPIC_AUTH_TOKEN=sk-....
Infrastructure config comes from environment variables; all runtime settind are managed via the Admin UI.
| Variable | Default | Description |
|---|---|---|
DATABASE | sqlite://./data/gateway.db | sqlite://, postgres://, |
PORT | 8000 | HTTP listen port |
HOST | 0.0.0.0 | HTTP bind host |
LOG_LEVEL | info | trace / debug / info / warn / error |
MASTER_API_KEY | (required in Docker) | Admin-only key for /admin |
ENCRYPTION_KEY | (required in Docker) | AES-256 key for credential encryption and API key HMAC |
SEED_DEFAULTS | empty | Seed default model mappings: off / `empty |
The container refuses to start without MASTER_API_KEY and `ENCRYPTION_Kpersist the SQLite database.
| Endpoint | Description |
|---|---|
POST /v1/chat/completions | OpenAI protocol chat |
POST /v1/messages | Anthropic protocol chat |
POST /v1/responses | OpenAI Responses API (Codex CLI) |
POST /v1/embeddings | OpenAI-compatible embeddings |
POST /v1/rerank | Cohere-compatible rerank |
POST /v1/images/generations | Image generation |
GET /v1/usage | Usage & cost statistics |
GET /metrics | Prometheus metrics |
GET /admin | Admin Web UI |
GET /health | Health check |
Content type
Image
Digest
sha256:5b8fa7774…
Size
48.1 MB
Last updated
6 days ago
docker pull xtravisions/one-router