█

AI/TLDR

Buy me a coffee
Buy me a coffee

Respan Gateway

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

Gateways & RoutingOpen source
Latest
0.3.0
Updated
25 Oct 2026
Language
Rust
License
MIT OR Apache-2.0
$pip install respan-gateway

What's new

0.3.025 Oct 2026

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.

IN SHORT

What is Respan Gateway?

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.

Updated Markdown version ↗

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.

Diagram of an app plugged into Respan Gateway, which adds fallback, hedging, translation, tool loop, PII redaction and tracing and connects to models, voice, image and video, tools, embeddings and self-hosted models.
Your app talks to the gateway; the gateway adds fallback, hedging, translation, tools and tracing and reaches every kind of model.Respan Gateway README ↗

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.

VideoRespan Gateway Demo: Any LLM, Any API Format, MCP Tools in One ClickRespan ↗

Install

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

bashbash
pip install respan-gateway

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/.

bashbash
export OPENAI_API_KEY=sk-...
respan-gateway

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.

pythonpython
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)

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.

bashbash
respan-gateway init

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

respan-gateway check

Or run it in Docker

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

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

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

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

How Respan Gateway compares

Respan Gateway alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
OmniRoute★ 91.4kA 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.7kA 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.2kA 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.4kA 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.7kMenu 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★ 33kLocal 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.1kAn 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.
Respan Gateway★ 1.2kOne Rust binary between your code and every AI API, translating SDK formats in both directions