# Respan Gateway

> One Rust binary between your code and every AI API, translating SDK formats in both directions

- Category: Evaluation & Production Ops / Gateways & Routing
- Language: Rust
- Licence: MIT OR Apache-2.0
- Repository: https://github.com/respanai/respan-gateway
- Website: https://respan.ai/ai-gateway
- Canonical page: https://ai-tldr.dev/tools/respan-gateway/
- Updated: 2026-10-25

## In short

Respan Gateway is an open-source LLM gateway shipped as a single Rust binary that sits between your code and the AI APIs you call. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in Rust and licensed MIT OR Apache-2.0.

## Overview

Respan Gateway is an open-source LLM gateway shipped as a single Rust binary that sits between your code and the AI APIs you call. You point the SDK you already use at it — OpenAI Chat Completions, OpenAI Responses, Anthropic Messages or the Gemini API — and it translates the request into whatever format the target vendor speaks, including streaming, tool calls, images and reasoning. An Anthropic SDK client can call an OpenAI model, and the reverse, without code changes beyond the base URL.

It covers more than chat. The README lists realtime voice across vendors (an OpenAI Realtime client can talk to Gemini Live), images, speech, transcription, embeddings and video, routed through OpenAI's or Gemini's API shapes to any vendor that offers them, plus a 'decisions' format for closed-set decision models. A vendor's own API that the gateway does not translate is relayed untouched.

Two features set it apart from a plain proxy. Its tool loop puts MCP servers or built-in tool vendors (web search, browsing, code sandboxes, documents, memory) behind the gateway and runs their tools inside ordinary chat requests, so any model can use them whatever the client. Its traffic control adds named routes, fallback, retries, cheapest-or-fastest selection and hedged requests that race a slow call against a second provider. Every feature is a plugin on one public Rust API, and the project publishes its own benchmark against Bifrost, Portkey and LiteLLM (0.07 ms added p50 latency and 31 MB of memory, as claimed in the README). Respan, the company behind it, also offers a managed version with dashboards and evals.

## What it does

- Any client, any model: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini API clients can all call any chat model, with streaming, tools, images and reasoning translated
- Multimodal routing for realtime voice, images, speech, transcription, embeddings and video, including OpenAI Realtime ⇄ Gemini Live
- MCP gateway and tool loop that runs MCP servers and built-in tool vendors inside plain chat requests for any model
- Traffic control with named routes, globs, provider/model addressing, fallback, retries, cheapest or fastest provider, and hedged requests
- A live request log with cost, latency and tokens per call, a web UI, and optional tracing to Respan
- Plugin architecture: every feature is built on one public Rust trait with four hooks, with examples for guardrails, PII masking, billing and an LLM judge

## Getting started

The gateway installs from PyPI, crates.io, a GitHub release or a Docker image, and needs no config file to start: every vendor whose API key is set becomes a provider.

1. Install

   Install the binary with pip; cargo install respan-gateway and the GitHub release builds work too.

```bash
pip install respan-gateway
```

2. Run it with your keys

   Export the API keys of the vendors you use and start the gateway. It listens on localhost:8080 and serves a web UI at /ui/.

```bash
export OPENAI_API_KEY=sk-...
respan-gateway
```

3. Call any model from any SDK

   Point an existing SDK at the gateway. Here the Anthropic SDK calls an OpenAI model; the gateway translates the Messages request and the reply.

```python
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)
```

4. Add routes, tools and client keys

   Generate a commented gateway.toml, then define providers, a hedged route, MCP tools and client keys. Validate it with check; --watch or SIGHUP reloads it without a restart. Without client keys the gateway only answers on loopback.

```bash
respan-gateway init

# gateway.toml
[routes.smart]
to = ["anthropic/claude-haiku-5-5", "openai/gpt-6-luna"]
hedge = "800ms"

respan-gateway check
```

5. Or run it in Docker

   Listening beyond localhost, the container needs a client key of your own.

```bash
docker run -p 8080:8080 -e OPENAI_API_KEY -e RESPAN_CLIENT_KEYS=<a key of yours> ghcr.io/respanai/respan-gateway
```

## When to use it

- Keep one SDK in your codebase while switching or mixing models from OpenAI, Anthropic, Google and other vendors
- Give models that lack built-in tools web search, sandboxes or any MCP server through the gateway's tool loop
- Cut tail latency by hedging slow calls against a second provider and failing over when one is down
- See the cost, latency and token count of every LLM call an app or coding agent makes in one live log

## Version history

- 2026-10-25 0.3.0: Added EmpirioLabs AI, DeepInfra, Perplexity and Cerebras as vendors, Mistral speech and realtime, Gemini image clients and multimodal embeddings, and a Docker image; the systemone format was renamed decisions.
