Every model. Every tool. One gate.
opengate is a self-hosted AI gateway and MCP host. Your API keys, your AI subscriptions and your MCP servers, behind one address.
Every provider you pay for. Every plan you already have. Every MCP server you trust.
Two endpoints
- chat
- responses
- messages
- embeddings
- images
- video
- speech
- transcription
- rerank
- decisions
- realtime
- Streamable HTTP
- OAuth 2.1
- npm
- PyPI
- remote servers
One API for all your model providers.
Use the OpenAI or Anthropic SDK, name any model as provider/model, and opengate
translates where the formats differ.
Clients
Providers
47 provider presets, or anything that speaks the OpenAI API.
Your AI subscriptions work as providers too.
Sign in the way each CLI does, then call the plan through /api.
Left this week, pick a plan to use it
When a plan runs out, the alias moves on
Using a subscription this way is subject to its vendor’s terms.
A budget on each API key.
Pick which models a key may use and how much it may spend; past that it gets a 429.
Daily budget
Simulated, with the day sped up.
Fast, even while logging each request.
Benchmarked against LiteLLM, Bifrost, Portkey, Helicone, TensorZero, agentgateway and ContextForge.
- /api/v1, 64 at once
- 10,983 answers a second
- next best 3,278
- /mcp, 64 sessions
- 15,624 tool calls a second
- next best 14,438
- One request at a time
- 0.19 ms median answer
- next best 0.22 ms
2 CPUs per gateway, mock provider, 2026-11-30. It is not first everywhere; see the full benchmark results.
All your MCP servers behind one URL.
Agents sign in once with OAuth and see the tools their user is allowed to use.
Connects
claude mcp add --transport http opengate https://gate.example.com/mcp # then /mcp inside Claude Code to sign in through the browser
codex mcp add opengate --url https://gate.example.com/mcp codex mcp login opengate
# Settings, Connectors, Add custom connector, and paste: https://gate.example.com/mcp
# Settings, Connectors, developer mode, create a connector with: https://gate.example.com/mcp # needs a publicly reachable https address
Tools, one switch each
- Servers from npm, PyPI or a URL
- Owned by a user or a team
- Each user brings their own credentials
Installed servers run in a sandbox.
Each process gets its own uid and can only reach public addresses. gVisor is optional.
no route to the database, the host or another process’s files
All requests and tool calls, in one log.
With tokens, cost and status. Tool arguments and results are not stored.
Simulated traffic.
Also included.
Open your own gate.
It runs on your server.
Run it with Docker Compose.
Free software. Docker 28 or newer, or the NixOS module.
git clone https://git.cumsek.com/opengate/opengate.git && cd opengate cp .env.example .env # set PUBLIC_URL, ENCRYPTION_KEY, RUNNER_TOKEN and POSTGRES_PASSWORD in .env docker compose --profile prod up -d --build docker compose logs opengate | grep -i "setup token" # Then open http://localhost:8080/setup and create the first admin.