Go · 48+ providers · OpenAI-compatible

One endpoint.
All models.

High-performance AI gateway unifying 48+ LLM providers behind a single OpenAI-compatible API. Format translation, model combos, token compression, and a built-in dashboard.

View Source Download
OpenAI
Anthropic
Gemini
Groq
DeepSeek
Mistral
xAI
Together
Fireworks
OpenRouter
Ollama
+37
/v1/chat/completions
Model Combos

Three routing strategies.

Define how requests flow through providers. Automatic failover, load distribution, or parallel synthesis.

fallback

Priority Chain

Try primary. On failure, exponential backoff, then next provider. Zero downtime.

round_robin

Sticky Rotation

Distribute across providers. Sticky sessions per conversation. Multi-account support.

fusion

Parallel Synthesis

Fan-out to multiple providers. Judge model synthesizes the best response.

Capabilities

What's inside.

Format Translation

Auto-detect OpenAI, Claude, Gemini, Vertex, Ollama formats. Pivot architecture through OpenAI canonical.

RTK Compression

20-40% token savings. Auto-detects git-diff, grep, ls, tree, log output. Fail-open on errors.

Multi-Account

Round-robin across API keys. Exponential backoff (5s → 10s → 20s → cap 5min). Per-account limits.

OAuth Refresh

Proactive refresh 5min before expiry. Reactive on 401/403. Per-account locking prevents races.

Web Dashboard

React SPA: provider/account management, model browser, combo editor, request logs, usage charts.

SSE Streaming

Full streaming with format translation. Client disconnect detection. OpenAI-compatible event stream.

API

OpenAI-compatible endpoints.

Drop-in replacement. Use existing OpenAI SDKs and tools against any provider.

POST
/v1/chat/completions
Chat completions with streaming support
GET
/v1/models
List all available models
POST
/v1/embeddings
Generate text embeddings
POST
/v1/images/generations
Image generation (DALL-E, SDXL)
POST
/v1/audio/speech
Text-to-speech synthesis
POST
/v1/audio/transcriptions
Speech-to-text (Whisper)
Use with any OpenAI SDK
python
from openai import OpenAI client = OpenAI( base_url="http://localhost:8080/v1", api_key="your-api-key-or-jwt-token", ) response = client.chat.completions.create( model="gpt-4o-mini", # or any model from 48+ providers messages=[{"role": "user", "content": "Hello!"}], ) print(response.choices[0].message.content)
RTK

Request Token Killer.

Auto-compress tool results by 20-40%. Detects content patterns and applies the best filter.

git-diff 30-50%
git-log 25-40%
git-status 20-35%
grep 30-50%
find 20-30%
ls 15-25%
tree 20-30%
dedup-log 40-60%
smart-truncate fallback
Providers

191+ models pre-configured.

OpenAI12
Anthropic6
Gemini8
Groq10
DeepSeek4
Mistral8
xAI4
Cohere6
Together15
Fireworks12
OpenRouter20+
Perplexity5
Replicate10+
Ollamalocal
NVIDIA8
HuggingFace10+
GitHub4
Cerebras3
Architecture

Hexagonal design.

Ports and adapters. Inbound HTTP, domain logic, outbound providers. Clean separation.

architecture
inbound HTTP/REST, SSE Stream, React SPA | ports ProxyService, AuthService | use cases ProxyUsecase, AdminUsecase, AuthUsecase | domain Model, Provider, Account, Combo, Error | outbound ProviderRegistry, SQLite, Translator
Stack

Built with.

Go 1.21+
chi v5
SQLite
React 18
Tailwind
Zustand
JWT
Caddy
Get Started

Three install methods.

Docker Compose

git clone https://github.com/ardiannurcahya/svclabs-router.git cd svclabs-router cp .env.example .env make compose-up # includes Caddy reverse proxy with auto-HTTPS # dashboard at http://localhost:8080

From Source

git clone https://github.com/ardiannurcahya/svclabs-router.git cd svclabs-router cp config.yaml.example config.yaml make full-build # run ./bin/router-svclabs -config config.yaml

Enable Providers

# set API keys as env vars export OPENAI_API_KEY=sk-... export ANTHROPIC_API_KEY=sk-ant-... export GOOGLE_API_KEY=AI... # or add via admin API curl -X POST /admin/accounts \ -d '{"provider":"openai",...}'