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.

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.

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.

How it fits with Respan

Hosted Respan gatewayRespan Gateway (open source)
RunsAt https://api.respan.ai/api/On your machine or server
Provider keysRespan credits, or your keys stored in RespanYour keys, in your environment or config file
SetupChange your client’s base URLInstall, add keys, run

You can use both. 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.

Next steps