Skip to Content
Launching the open-source gateway

Open-source gateway

Call any model from the SDK you already use.

The gateway sits between your code and the AI APIs you call. Point the OpenAI, Anthropic or Gemini SDK at it, ask for any model, and it translates the request to that model’s provider and the answer back.

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)

It is licensed MIT or Apache-2.0. It runs as one binary, as a Python package (a server, or inside your process), or as a Docker image.

To set it up with a coding agent, paste this prompt into Claude Code, Cursor, Codex, or any other:

Help me set up the open-source Respan Gateway: fetch and follow https://www.respan.ai/docs/oss-gateway/agent-setup.md

What it does

FeatureFor example
Any SDK, any modelThe Anthropic SDK calls GPT, and the OpenAI SDK calls Claude. Streaming, tools, images and reasoning are translated.
Images, speech, video, embeddingsOne OpenAI client generates images, speech and transcriptions, and client.videos.create makes a Google Veo video.
Realtime voiceAn OpenAI Realtime client talks to Gemini Live, and a Gemini Live client talks to OpenAI.
Tools and MCPPut MCP servers and built-in tool vendors (web search, browsers, code sandboxes, memory) behind the gateway. It runs their tools inside a chat request, so any model can use them.
Routing and fallbackClients ask for a route such as smart. The gateway falls back to the next candidate on errors, picks the cheapest or fastest, or races a slow call against a second provider.
Request log with costThe web UI at /ui/ lists every request with its provider, latency, tokens and cost.
Respan tracingThe respan plugin sends each request to Respan as a trace.

16 vendors are built in, including OpenAI, Anthropic, Gemini, Groq, DeepSeek, Mistral, xAI, OpenRouter and Ollama. Any OpenAI-compatible endpoint works with a base URL. Every feature is a plugin on a public Rust API, and you can write your own.

Use it with Respan

Add your Respan API key  as a provider (vendor = "respan", or RESPAN_API_KEY in the environment), and turn on the respan plugin to trace every request in Respan. See Providers and Plugins.