Tera Router is an open source AI gateway and LLM router. Speak OpenAI, Anthropic, or Responses — route across accounts with fallback, keys, guardrails, and usage analytics built in.
v1.27.0 · GPL-3.0 licensed · self-hosted · no per-token markup.
Routes to the accounts you already pay for — API keys, coding plans, or local models
OpenAI
Anthropic
Gemini
OpenRouter
NVIDIA NIM
Mistral AI
Together AI
Fireworks AI
Nebius Token Factory
Groq
Cline
Cloudflare AI
Meta Muse
OpenAI Codex
Exa
Tavily
Firecrawl
Brave Search
Serper
Voyage AI
Jina AI
ElevenLabs
Deepgram
OpenAI
Anthropic
Gemini
OpenRouter
NVIDIA NIM
Mistral AI
Together AI
Fireworks AI
Nebius Token Factory
Groq
Cline
Cloudflare AI
Meta Muse
OpenAI Codex
Exa
Tavily
Firecrawl
Brave Search
Serper
Voyage AI
Jina AI
ElevenLabs
Deepgram
Turn every account you own into one endpoint.
Connect accounts once, then let the planner handle the rest: priority order, cooldowns, fallback across providers, and full metering of what each key consumes.
providers in the catalog
20+
providers in the catalog
API dialects, one gateway
3
API dialects, one gateway
Your tools
native SDKs
Claude CodeAnthropic SDK/v1/messages
CursorOpenAI-compatible/v1/chat
Codex CLIResponses API/v1/responses
LangChainOpenAI SDK/v1/chat
curl & scriptsany HTTP clientBearer tr_…
Tera Router
plan · transform · meter
Your accounts
priority order
Anthropicpriority 1api key
Geminipriority 2account #2
OpenAI Codexoauth sessionresponses
OpenRouterfallbackany model
Self-hosted vLLMcustom endpoint:8000/v1
01
Connect providers
Pick from the built-in catalog — API keys, OAuth sessions, or custom OpenAI- and Anthropic-compatible endpoints. Multiple accounts per provider, each with its own base URL and priority.
openai · anthropic · gemini · openrouter …
02
Route with fallback
Every request enters one endpoint. The planner resolves accounts in priority order, cools down failures, and falls back across accounts and providers automatically.
glm-4.7 → kimi-k2 → claude-sonnet (fallback)
03
Observe everything
Token usage is metered per request — including SSE streams — and lands in the admin dashboard: per key, per account, per model.
GET /admin/usage → per-key analytics
Overview
A concise view of traffic, spend, and routing performance.
Today7D30D
Traffic
48.2Krequests
9.8M
Input
2.8M
Output
6.1M
Cache read
Spend & Value
$184.32tracked cost
$412.80
Value saved
$0.0038
Cost / Request
98%
Pricing coverage
Reliability
99.2%successful
386
Failed
1.4s
Avg latency
412ms
TTFT
Usage trend
Busiest request bucket Oct 19
RequestsTokensCostFailures
Sep 22Sep 29Oct 6Oct 13Oct 21
Provider mix
5 providers
Traffic share and delivery quality.
Anthropic
99.6% success · 1.8s avg
18.4k req
$96.10
38.2%
Gemini
99.1% success · 0.9s avg
12.1k req
$31.42
25.1%
OpenAI Codex
98.7% success · 3.2s avg
9.6k req
$41.85
19.9%
OpenRouter
97.9% success · 1.3s avg
5.2k req
$12.03
10.8%
Groq
99.8% success · 0.4s avg
2.9k req
$2.92
6%
Built for running, not just proxying.
Routing is the headline. The gateway also carries the operational load — access control, policy, and telemetry — in a single Go service you deploy once.
Streaming-first request log
SSE passes straight through for chat and messages, with token usage extracted from the stream itself — no buffering, no lost metrics.
Filter requests, keys, models…live
17:02:14INFsearchexa · 200 · 8 results · 412 ms
17:02:13INFresponsesgpt-5-codex → codex · stream · 22.7k tok
17:02:12ERRguardrailkey tr_live_…9f2 · model not in allowlist
17:02:10WRNmessagesanthropic#1 429 · cooling down 60s
17:02:09INFchatgemini-2.5-pro → gemini#2 · 200 · 1,204 tok
Three dialects, one gateway
The transform engine rewrites between OpenAI Chat, Anthropic Messages, and Responses, so a request in one dialect can land on a provider that speaks another.
OpenAI Chat Completions
POST /v1/chat/completions
Anthropic Messages
POST /v1/messages
OpenAI Responses
POST /v1/responses
Fallback across accounts and providers
Several accounts per provider, tried in priority order. Failures cool down automatically and traffic moves to the next account in the chain.
anthropic#197.8%
gemini#2100%
openrouter99.6%
groq#1100%
Policy before traffic leaves your box
Scope every gateway key to specific models, cap its concurrency, and run requests through the guardrails engine — enforced centrally.
Per-key model allowlists
Guardrails policy engine
Concurrency limits per key
Quotas & budgets per account
Proxy pools for upstream egress
Bring every account you already have.
A built-in catalog of presets — base URL, dialect, and auth mode included — plus custom endpoints for anything OpenAI- or Anthropic-compatible.
Chat & LLM
13
Bring your own key — catalog presets ship the base URL and dialect.
OpenAI
Anthropic
Gemini
OpenRouter
NVIDIA NIM
Mistral AI
Together AI
Fireworks AI
Nebius Token Factory
Groq
Cline
Cloudflare AI
Meta Muse
Subscription / OAuth
1
Sign in with an existing ChatGPT subscription and route it over the Responses dialect.
OpenAI Codex
Search & embeddings
7
Served on /v1/search, /v1/web/fetch, and /v1/embeddings behind the same gateway keys.
Exa
Tavily
Firecrawl
Brave Search
Serper
Voyage AI
Jina AI
Voice
2
Text-to-speech and transcription on /v1/audio/speech and /v1/audio/transcriptions.
ElevenLabs
Deepgram
Custom
2
Any OpenAI- or Anthropic-compatible endpoint, with per-account base URLs.
OpenAI-compatible
Anthropic-compatible
One container, one base URL.
One container next to your stack, one base URL in every tool. From clone to first routed request in minutes.
01Run the gateway
bash
$ git clone https://github.com/montara-project/tera-router
$ cd tera-router/deploy
$ echo "APP_MACHINE_ID=1" > .env
$ echo "APP_SECRET=$(openssl rand -base64 48)" >> .env
$ docker compose up -d
✔ Container deploy-app-1 Started
✔ Gateway and dashboard on http://localhost:8080
$ git clone https://github.com/montara-project/tera-router$ cd tera-router/deploy$ echo "APP_MACHINE_ID=1" > .env$ echo "APP_SECRET=$(openssl rand -base64 48)" >> .env$ docker compose up -d✔ Container deploy-app-1 Started✔ Gateway and dashboard on http://localhost:8080