Quickstart
Install the gateway, add your provider keys, and call a Claude model from the OpenAI SDK.
This runs the gateway on your machine with no config file. Every provider key in your environment becomes a provider, and the model name in each request decides where it goes.
Install
pip install respan-gatewayThis installs the respan-gateway command. To use cargo, a release binary or Docker instead, see Install.
respan-gateway --versionAdd your provider keys
Export a key for each provider you want to use:
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."The gateway also reads the nearest .env file in the current directory or its parents. Variables already set in your shell win over .env. Other vendors use their own variables, such as GEMINI_API_KEY or GROQ_API_KEY; see Providers.
Start the gateway
respan-gatewayIt listens on 127.0.0.1:8080 and prints the providers it found, the endpoints it serves, and the web UI’s address. To use another address, pass --listen, such as --listen 9000.
Make a call
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna",
"messages": [{"role": "user", "content": "Say hello"}]
}'With no client keys set, any API key value works, and the gateway only answers on loopback. To require keys, see Client keys.
Open the web UI
Open localhost:8080/ui/ . The request log shows each call with its provider, model, latency, tokens and cost.
Next steps
- Point your own app at the gateway: Connect your app.
- Run it inside a Python process, with no server: Python, in your code.
- Add routes, tools and tracing in a config file.
respan-gateway initwrites a commentedgateway.tomlfrom the keys in your environment, andrespan-gateway checkvalidates it. See Config file.