pi (gateway)
Route pi’s LLM calls through the Respan gateway for automatic logging, caching, and model switching. pi loads custom providers from ~/.pi/agent/models.json, so only your RESPAN_API_KEY is needed.
Trace pi sessions
This page covers gateway routing. To also capture turns, tool calls, and compactions from inside pi, see pi (tracing).
Setup
Switch models
Add more entries to the models array and pick any of them with --model respan/<id>. Any of the 1000+ models available through the gateway work, for example:
See the full model list.
Use a provider-native API
pi also speaks the Anthropic Messages and OpenAI Responses protocols. Point those at the matching Respan passthrough if you prefer the native format:
The openai-responses route only serves OpenAI models. Use openai-completions for Claude, Gemini, and other providers.