pi
Our pi extension registers indoRouter as a provider and reads the model list from /v1/models every time pi starts, so new models appear without configuration changes. pi connects to indoRouter through Chat Completions.
Before you start
Section titled “Before you start”Create an API key on the API Key page before you start.
Store the key:
export INDOROUTER_API_KEY="ir_..."Install the extension:
mkdir -p ~/.pi/agent/extensionscurl -fsSL https://console.indorouter.ai/pi/indorouter.ts -o ~/.pi/agent/extensions/indorouter.tsStart pi on a model, then switch any time with /model:
pi --provider indorouter --model openai/gpt-4o-miniWhat the extension does
Section titled “What the extension does”- It lists the chat models that support tool calls.
- It sets each model’s context window, reasoning and image input from what
/v1/modelssays. - It caps each model’s output at 32,000 tokens, or lower where the model’s own limit is lower. Before a request runs we reserve enough balance for its whole output cap, so a smaller cap keeps less of your balance on hold. See How billing works.
- It shows prices as zero inside pi, because pi would print them in dollars and our prices are in rupiah. The real cost of each request is on the console’s Requests page.
- It reads the key from
INDOROUTER_API_KEY.
Check the connection
Section titled “Check the connection”Ask pi something short. The request appears on the console’s Requests page.
Troubleshooting
Section titled “Troubleshooting”- No indoRouter models: check that the file is in
~/.pi/agent/extensions/and that pi could reach the internet when it started. Restart pi once the connection is back. - 401:
INDOROUTER_API_KEYisn’t set in the terminal pi was started from.