What is LLM Gateway (theopenco)?
LLM Gateway (theopenco) is One OpenAI-compatible API to route, manage, and track LLM requests across providers. Instead of integrating each provider separately, you send requests to one endpoint that speaks the OpenAI API format and forwards them to OpenAI, Anthropic, Google Vertex AI, and others. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in TypeScript and licensed AGPL-3.0.
Overview
LLM Gateway is an open-source API gateway that sits between your applications and multiple LLM providers. Instead of integrating each provider separately, you send requests to one endpoint that speaks the OpenAI API format and forwards them to OpenAI, Anthropic, Google Vertex AI, and others.
It is aimed at teams that call several LLM providers and want a single place to manage API keys, watch token usage and costs, and compare model performance. Because the interface matches the OpenAI format, existing OpenAI client code can point at the gateway with minimal changes.
As an LLM gateway/proxy, it adds a routing and observability layer to your stack. You can run the hosted version at llmgateway.io or self-host the unified Docker image for full control over your data and configuration.
What it does
- OpenAI-compatible API so existing OpenAI clients work with little change
- Routes requests across multiple providers including OpenAI, Anthropic, and Google Vertex AI
- Central management of provider API keys in one place
- Usage analytics for requests, tokens, response times, and costs
- Performance monitoring to compare models on speed and cost-effectiveness
- Self-host with the unified Docker image or use the hosted service
Getting started
You can use the hosted service at llmgateway.io or self-host with Docker. The quickest path is to get an API key and call the gateway's OpenAI-compatible chat completions endpoint.
Call the hosted API
Get an API key from llmgateway.io, then send a chat completion request to the gateway. The endpoint follows the OpenAI format, so you pass a model and a messages array.
curl -X POST https://api.llmgateway.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Hello, how are you?"}
]
}'Self-host with Docker
Generate the required secrets and run the unified container script. Use Docker-managed named volumes for Postgres and Redis rather than bind-mounting a host directory.
export LLM_GATEWAY_SECRET="$(openssl rand -base64 32 | tr -d '\n')"
export GATEWAY_API_KEY_HASH_SECRET="$(openssl rand -base64 32 | tr -d '\n')"
./scripts/run-unified-container.shOr run a one-off container
If you prefer a single docker run, create named volumes first and pass the auth secrets as environment variables.
docker volume create llmgateway_postgres
docker volume create llmgateway_redis
docker run -d \
--name llmgateway \
--restart unless-stopped \
-p 3002:3002 -p 3003:3003 -p 3005:3005 \
-p 3006:3006 -p 4001:4001 -p 4002:4002 \
-v llmgateway_postgres:/var/lib/postgresql/data \
-v llmgateway_redis:/var/lib/redis \
-e AUTH_SECRET="$LLM_GATEWAY_SECRET" \
-e GATEWAY_API_KEY_HASH_SECRET="$GATEWAY_API_KEY_HASH_SECRET" \
ghcr.io/theopenco/llmgateway-unified:latestCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Route an app across OpenAI, Anthropic, and Google through one endpoint without writing per-provider integrations
- Track token usage and spend across all LLM calls in a single dashboard
- Manage and rotate provider API keys centrally instead of spreading them across services
- Compare models on latency and cost to decide which to use in production
How LLM Gateway (theopenco) compares
LLM Gateway (theopenco) alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| OmniRoute | ★ 91.4k | A local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression. |
| Free Claude Code | ★ 74.7k | A local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI. |
| LiteLLM | ★ 64.2k | A Python SDK and proxy server that gives one OpenAI-compatible API to 100+ LLM providers, with cost tracking, budgets, fallbacks, rate limiting, and an admin UI. |
| Kong Gateway | ★ 44.4k | A Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance. |
| magpie | ★ 43.7k | Menu bar app and local gateway that lets Claude Code, Codex, Gemini CLI and dozens of other coding agents run on any provider's model, with routing groups that fail over across accounts when a quota runs out. |
| 9Router | ★ 33k | Local OpenAI-compatible router for coding CLIs that tracks per-provider quota, falls back from subscription to cheap to free models, and compresses tool results to cut tokens. |
| Experiential | ★ 20.1k | An open-source gateway that puts hosted, BYOK, local and custom models behind one OpenAI-compatible API, with per-identity model and spend limits and routers fitted from your own traces. |
| LLM Gateway (theopenco) | ★ 1.8k | One OpenAI-compatible API to route, manage, and track LLM requests across providers |

