Pi
Use Router9 as a custom provider in Pi
Pi is a terminal coding agent from Earendil. It speaks both the OpenAI and Anthropic API formats and supports custom providers, so it runs on Router9 with no code changes.
Setup
Add Router9 as a custom provider pointing at Router9's OpenAI-compatible endpoint, and supply your key:
export OPENAI_BASE_URL=https://api.router9.com/v1
export OPENAI_API_KEY=sk-r9k-your-key-herePi resolves provider keys from your environment or auth file. See Pi's Providers guide for the exact custom-provider block and how to register model ids.
Using the Anthropic Endpoint
Pi also supports Anthropic-native models. Point it at Router9's Anthropic endpoint instead:
export ANTHROPIC_BASE_URL=https://api.router9.com/anthropic
export ANTHROPIC_API_KEY=sk-r9k-your-key-hereRouter9's Anthropic endpoint authenticates with the x-api-key header that the Anthropic SDK sends from ANTHROPIC_API_KEY.
Add Skills via MCP
If your Pi setup supports MCP servers, expose Router9 Skills as tools by adding Router9's hosted MCP server over HTTP:
{
"mcpServers": {
"router9": {
"type": "http",
"url": "https://api.router9.com/v1/mcp",
"headers": {
"Authorization": "Bearer sk-r9k-your-key"
}
}
}
}See Install MCP Server for the full client configuration.
Tips
- Router9's flat monthly pricing suits Pi's long, autonomous sessions — no per-token surprises.
- Keep your
sk-r9k-key in the environment or Pi's auth file rather than in committed config. - Swap the model id in your custom-provider block for any model Router9 routes on.