Skip to content

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.

Create an API key on the API Key page before you start.

Store the key:

Terminal window
export INDOROUTER_API_KEY="ir_..."

Install the extension:

Terminal window
mkdir -p ~/.pi/agent/extensions
curl -fsSL https://console.indorouter.ai/pi/indorouter.ts -o ~/.pi/agent/extensions/indorouter.ts

Start pi on a model, then switch any time with /model:

Terminal window
pi --provider indorouter --model openai/gpt-4o-mini
  • It lists the chat models that support tool calls.
  • It sets each model’s context window, reasoning and image input from what /v1/models says.
  • 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.

Ask pi something short. The request appears on the console’s Requests page.

  • 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_KEY isn’t set in the terminal pi was started from.