respan-gateway
Open-source LLM gateway in Rust. One endpoint for OpenAI, Anthropic, Gemini and every other vendor. Any SDK, any model, any tool.
Install / Use
claude mcp add respanai -- npx -y github:respanai/respan-gatewayIf the server publishes to npm under a different name, use that package instead โ check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of respan-gateway
respan-gateway scores 92/100 on our quality scale, 261st of 953 AI & Machine Learning skills we index (top 28%).
Its MCP Server is 21 KB long, well organised into 9 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
It has 559 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated today, so respan-gateway is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit โ read the skill file before letting an agent act on it.
respan-gateway compared with similar skills
All 4 of these similar skills score higher than respan-gateway; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| respan-gateway (this skill)by respanai | 92 | 559 | today | MCP Server |
| claude-memby thedotmack | 100 | 113.0k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 108.9k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 90.7k | 10d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
Frequently asked questions
- How do I install respan-gateway?
- Run
claude mcp add respanai -- npx -y github:respanai/respan-gateway. The install tabs above show the steps for each supported agent. - Which AI agents does respan-gateway work with?
- It is written for Claude Code, Claude Desktop and Gemini CLI, as a MCP Server file. Other agents that read the same format can often use it too.
- Is respan-gateway safe to use?
- It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is respan-gateway still maintained?
- The repository was last updated today, so respan-gateway is actively maintained.
Skill content
View source on GitHubRespan Gateway is a single Rust binary that sits between your code and every AI API. Point the SDK you already use at it, and it connects you to everything: chat models, images, video and voice from every major provider; tools for any model, from web search and memory to code sandboxes and any MCP server; and traffic control (format translation, fallback, retries and hedged requests), with a live log of every call. โถ Watch the demo
<br> <div align="center"> <img alt="Your app plugs into Respan Gateway, which connects it to models, voice, image and video, tools, embeddings and self-hosted models, with fallback, hedging, translation, tool loop, PII redaction and tracing built in" src="docs/assets/gateway-hero.png" width="900"> </div> <br>Key features
-
Any client, any model<br> OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini API clients can all call any model, with streaming, tools, images and reasoning translated.
-
Multimodal<br> Realtime voice across vendors (an OpenAI Realtime client talks to Gemini Live, and back), plus images, speech, transcription, embeddings and video through OpenAI's or Gemini's APIs, to any vendor that has them.
-
MCP tools for every model<br> Put MCP servers or built-in tool vendors behind the gateway, from web search to code sandboxes. It runs their tools inside chat requests, so a plain chat call can use them, whatever the client or model.
-
Traffic control<br> Named routes, globs and
provider/model; fallback, retries, cheapest or fastest; and hedged requests that race a slow call against a second provider. -
Observability<br> A live request log with cost, latency and tokens for every call, and traces in Respan, where span-02 analyzes how your agents behave.
-
Best-in-class performance<br> 0.07 ms of added latency, 56,000 requests per second and 31 MB of memory in our benchmarks: about 3ร the throughput of the next fastest gateway we tested.
-
Write your own plugin in minutes<br> Every feature above is a plugin, built on the same public Rust API you can use: one trait with four hooks. Start from the plugin guide or an example such as guardrails, PII masking or billing.
Quickstart
1. Install
pip install respan-gateway
Or cargo install respan-gateway, or a
GitHub release.
2. Run it with your keys
export OPENAI_API_KEY=sk-...
respan-gateway
No config file needed: every vendor whose key is set becomes a provider.
3. Call any model from any SDK
from anthropic import Anthropic
client = Anthropic(base_url="http://localhost:8080", api_key="unused")
reply = client.messages.create(
model="gpt-6-luna", max_tokens=256,
messages=[{"role": "user", "content": "Hello from the Anthropic SDK"}])
print(reply.content[0].text)
The web UI is at localhost:8080/ui/. Next: configuration and MCP tools.
Other ways to run it
- Python, in-process โ Run the gateway inside your Python app, with no server.
- Embed in Rust โ Mount the gateway in your own Rust service.
- Docker โ
docker run -p 8080:8080 -e OPENAI_API_KEY -e RESPAN_CLIENT_KEYS=<a key of yours> ghcr.io/respanai/respan-gatewayon any container host; listening beyond localhost, it needs a client key.
Performance
| | Respan Gateway | Bifrost | Portkey | LiteLLM (1 worker) | |---|---:|---:|---:|---:| | Added latency (p50) | 0.07 ms | 0.16 ms | 0.17 ms | 4.34 ms | | Throughput | 56,734/s | 18,182/s | 4,187/s | 268/s | | Memory | 31 MB | 488 MB | 350 MB | 418 MB | | 1k streams, success | 100% | 92โ100% | โ | 79% | | 1k streams, memory | 128 MB | 688 MB | โ | 493 MB | | p99, 5% slow calls | 105 ms | 2,002 ms | 2,003 ms | 2,024 ms |
Configuration
You don't need a config file to start. When you want more, run
respan-gateway init for a commented gateway.toml. One file sets up keys,
providers, traffic control, tools and tracing:
client_keys = [{ name = "app", key = "env:APP_KEY" }] # who may call the gateway
[providers.openai] # a built-in vendor: just add a key
vendor = "openai"
key = "env:OPENAI_API_KEY"
[providers.anthropic]
vendor = "anthropic"
key = "env:ANTHROPIC_API_KEY"
[providers.local] # any OpenAI-compatible endpoint
formats = ["openai-chat"]
base_url = "http://localhost:8000/v1"
[routes.smart] # clients ask for "model": "smart"
to = ["anthropic/claude-haiku-5-5", "openai/gpt-6-luna"]
hedge = "800ms" # race the second if the first is slow
[tools.search] # web search as MCP tools
vendor = "linkup"
key = "env:LINKUP_API_KEY"
[plugins.tool_loop] # every model can use them
servers = ["search"]
[plugins.respan] # trace every call in Respan
key = "env:RESPAN_API_KEY"
respan-gateway check validates it, and --watch or SIGHUP reloads it
without a restart. Without client keys, the gateway answers only on loopback
and refuses to start on a public address.
Reference: configuration ยท
vendors ยท tool vendors ยท
MCP and tools ยท gateway.example.toml
Supported API formats
Call the gateway in any format on the left, and it reaches every provider on the right, translating between them.
| | Your code calls | It can reach | |---|---|---| | Chat | OpenAI Chat Completions<br>OpenAI Responses<br>Anthropic Messages<br>Gemini API | <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openai-dark.svg"><img src="docs/assets/vendors/openai.svg" alt="OpenAI" title="OpenAI" width="20" height="20"></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/anthropic-dark.svg"><img src="docs/assets/vendors/anthropic.svg" alt="Anthropic" title="Anthropic" width="20" height="20"></picture> <img src="docs/assets/vendors/gemini.svg" alt="Gemini" title="Gemini" width="20" height="20"> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/xai-dark.svg"><img src="docs/assets/vendors/xai.svg" alt="xAI" title="xAI" width="20" height="20"></picture> <img src="docs/assets/vendors/deepseek.svg" alt="DeepSeek" title="DeepSeek" width="20" height="20"> <img src="docs/assets/vendors/mistral.svg" alt="Mistral" title="Mistral" width="20" height="20"> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/groq-dark.svg"><img src="docs/assets/vendors/groq.svg" alt="Groq" title="Groq" width="20" height="20"></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openrouter-dark.svg"><img src="docs/assets/vendors/openrouter.svg" alt="OpenRouter" title="OpenRouter" width="20" height="20"></picture> <img src="docs/assets/vendors/together.svg" alt="Together" title="Together" width="20" height="20"> <img src="docs/assets/vendors/deepinfra.svg" alt="DeepInfra" title="DeepInfra" width="20" height="20"> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/ollama-dark.svg"><img src="docs/assets/vendors/ollama.svg" alt="Ollama" title="Ollama" width="20" height="20"></picture> <img src="docs/assets/vendors/empiriolabs.png" alt="EmpirioLabs AI" title="EmpirioLabs AI" width="20" height="20"><br>any chat model, whichever of the four formats it speaks | | Realtime voice | OpenAI Realtime<br>Gemini Live | <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openai-dark.svg"><img src="docs/assets/vendors/openai.svg" alt="OpenAI" title="OpenAI" width="20" height="20"></picture> <img src="docs/assets/vendors/gemini.svg" alt="Gemini" title="Gemini" width="20" height="20"> <img src="docs/assets/vendors/mistral.svg" alt="Mistral" title="Mistral" width="20" height="20"><br>OpenAI โ Gemini voice; Mistral for transcription | | Images | OpenAI Images<br>Gemini Images | <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openai-dark.svg"><img src="docs/assets/vendors/openai.svg" alt="OpenAI" title="OpenAI" width="20" height="20"></picture> <img src="docs/assets/vendors/gemini.svg" alt="Gemini" title="Gemini" width="20" height="20"> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/xai-dark.svg"><img src="docs/assets/vendors/xai.svg" alt="xAI" title="xAI" width="20" height="20"></picture> <img src="docs/assets/vendors/together.svg" alt="Together" title="Together" width="20" height="20"> <img src="docs/assets/vendors/deepinfra.svg" alt="DeepInfra" title="DeepInfra" width="20" height="20"> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openrouter-dark.svg"><img src="docs/assets/vendors/openrouter.svg" alt="OpenRouter" title="OpenRouter" width="20" height="20"></picture> <img src="docs/assets/vendors/empiriolabs.png" alt="EmpirioLabs AI" title="EmpirioLabs AI" width="20" height="20"> | | Speech, transcription | OpenAI Speech<br>OpenAI Transcriptions | <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openai-dark.svg"><img src="docs/assets/vendors/openai.svg" alt="OpenAI" title="OpenAI" width="20" height="20"></picture> <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/groq-dark.svg"><img src="docs/assets/vendors/groq.svg" alt="Groq" title="Groq" width="20" height="20"></picture> <img src="docs/assets/vendors/deepinfra.svg" alt="DeepInfra" title="DeepInfra" width="20" height="20"> <img src="docs/assets/vendors/empiriolabs.png" alt="EmpirioLabs AI" title="EmpirioLabs AI" width="20" height="20"> | | Embeddings | OpenAI Embeddings | <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/vendors/openai-dark.svg"><img src="docs/assets/vendors/openai.svg" alt="OpenAI" title="OpenAI" width="20" height="20"></picture> <img src="docs/assets/vendors/gemini.svg" alt="Gemini" title="Gemini" width="20" height="20"> <img src="docs/assets/vendors/mistral.svg" alt="Mistral" title="Mistral" width="20" height="20"> <im
Truncated for display โ read the full file on GitHub.
Related Skills
claude-mem
113.0kPersistent Context Across Sessions for Every Agent โ Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
108.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu โ one CLI, zero API fees.
Understand-Anything
90.7kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit โ see the Safety scan above for what the skill file itself contains.
