Respan Gateway Unifies OpenAI, Anthropic and Gemini Behind one Rust Proxy
A single Rust binary proxies every major LLM vendor behind one endpoint, with hedged requests, MCP tools and sub-millisecond overhead.
Takeaways
- Respan Gateway is an open-source Rust binary proxying OpenAI, Anthropic, Gemini and 13+ other vendors behind one endpoint
- Any SDK can call any model, with streaming, tools, images and reasoning translated between formats automatically
- Claims 0.07ms added latency and 56k req/s, roughly 3x the next fastest gateway tested
- Hedged requests race a slow primary call against a backup provider, killing latency spikes
- Built-in MCP tool loop lets any model use web search, browsers, sandboxes and memory servers
- Dual-licensed MIT/Apache-2.0, installable via pip, cargo or Docker
Respan Gateway is an open-source proxy that translates requests among OpenAI, Anthropic and Gemini API formats. Applications can keep an existing SDK while routing calls to supported models from another provider, reducing the provider-specific code required for migrations, failover and multi-model systems.
The gateway ships as a single Rust binary under the MIT and Apache-2.0 licenses. It supports chat, image, video and voice models, external tools, retries, fallbacks, hedged requests and request logging. Teams can run it as a standalone service, install it through Python or Cargo, deploy it with Docker, or embed it in Python and Rust processes.
Four client APIs, one model layer
Clients can send OpenAI Chat Completions, OpenAI Responses, Anthropic Messages or Gemini requests to the same gateway. Respan translates supported streaming events, tool calls, images and reasoning fields between the client format and the selected provider.
- Client interfaces: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini
- Model types: Chat, image, video, voice and realtime models
- Traffic controls: Provider selection, retries, fallback and hedging
- Integrations: MCP servers, hosted tool vendors and custom plugins
- Observability: A live log of requests routed through the gateway
An Anthropic client can therefore address a supported GPT model by changing its endpoint and model selection. Respan also claims protocol translation between OpenAI Realtime voice clients and Gemini Live, allowing applications to switch voice backends without replacing the client library.
A three-line local start
The Python package can start the gateway with an API key supplied through the environment:
pip install respan-gateway
export OPENAI_API_KEY=sk-...
respan-gateway
Environment variables are sufficient for a basic deployment. Each supported provider whose credentials are present becomes available to the gateway. A TOML configuration file is optional until the application needs named routes or more detailed traffic policies.
Routes put failure policy in TOML
Named routes let clients request a routing policy as though it were a model. A route can match providers and models through explicit selectors or globs, then choose among retries, fallback, price-based selection, latency-based selection and hedging.
| Control | Behavior | Operational cost |
|---|---|---|
| Retry | Repeats a failed request according to the configured policy. | Raises latency and may create another billable call. |
| Fallback | Moves to another provider or model after a failure. | Requires compatible prompts, tools and output handling. |
| Cheapest or fastest | Selects a target using the route’s price or latency criteria. | Depends on accurate model metadata and representative latency data. |
| Hedge | Starts a backup after a delay and accepts the first response. | Can reduce tail latency while producing duplicate billable work. |
A hedge configured for 800 milliseconds starts the primary request immediately, then sends the same request to a backup if the first token has not arrived by the deadline. The gateway uses the first response, which limits the number of duplicated calls compared with racing both providers from the start. Production users need to confirm whether the losing request is cancelled and how each provider bills interrupted generations.
Tool calls move into the gateway
Model Context Protocol, or MCP, standardizes how AI applications expose external tools and data sources. Respan can manage that tool loop inside the proxy, allowing a regular chat request to invoke an MCP server even when the client does not implement MCP directly.
The built-in integrations include Linkup and Tavily for search, Browserbase for browsing, E2B and Daytona for code sandboxes, and Zep for memory. The gateway sends tool definitions to the model, executes selected calls and returns the results to the conversation. This centralizes tool access across providers, while also placing authentication, sandboxing and tool permissions inside the gateway’s security boundary.
Plugins open the request path
Routing, tool execution, pricing and tracing use the same public Rust plugin trait. The plugin guide describes four lifecycle hooks, and the repository includes examples for guardrails, personally identifiable information masking, billing and LLM-based evaluation.
Custom plugins give teams a defined extension point for request and response processing. The approach is especially relevant when an organization needs internal authorization, audit logging, cost allocation or content controls that the bundled features do not cover.
Fast numbers, self-reported
Respan’s published benchmarks report 0.07 milliseconds of added latency, 56,000 requests per second and 31 MB of memory. Its comparison places the gateway ahead of Bifrost, Portkey and LiteLLM on latency, throughput, memory use and streaming success rate, with roughly three times the throughput of the next-fastest tested gateway.
Those figures come from the project and need independent reproduction. Rust and a single-binary architecture can keep proxy overhead low, while hardware, concurrency, payload size, network placement, logging and benchmark configuration can materially change the result. Teams evaluating throughput should repeat the test with their own streaming patterns, plugins and provider connections.
Where the gateway fits
- Multi-provider applications that want one client interface across several model vendors
- Agent systems that need a shared MCP tool catalog across models
- Latency-sensitive workloads that can justify the extra cost of delayed hedging
- Resilient services that need retries and provider fallback outside application code
- Self-hosted environments that cannot send prompts through a managed aggregation service
Checks before production
- API compatibility: Test provider-specific parameters, streaming events, reasoning fields and tool-call behavior for every model pair the application will use.
- Billing behavior: Measure the cost of retries and hedges, including requests cancelled after another provider responds.
- Security: Protect the centralized provider keys, authenticate gateway clients and restrict external tools and sandboxes.
- Logging: Decide whether prompts, responses and tool results may enter the live request log, then configure retention and redaction accordingly.
- Operational maturity: The project is new and public adoption remains modest, so upgrades, failure modes and benchmark claims require direct testing.
Respan Gateway concentrates provider translation, routing and tool execution in one deployable service. Its practical value comes from removing those concerns from application code, especially for systems that already span several model vendors. The remaining evaluation work centers on translation fidelity, duplicate-request costs, security controls and performance under the application’s real traffic.