Skip to content
All use cases

Pi

Run Pi through AnyRouter

Add AnyRouter as a custom OpenAI-compatible provider in Pi's models.json — one key, the Chat Completions catalog, and request logs.

What this is for

Pi ships with its own provider list. Pointing it at a gateway means a custom provider entry, and without one every model switch needs a separate key.

Steps, then copy

  1. 1.Install Pi, then create an AnyRouter key in the dashboard (sk-ar-…) and export it as ANYROUTER_API_KEY.
  2. 2.Add AnyRouter to ~/.pi/agent/models.json as an openai-completions provider.
  3. 3.Open /model in Pi, pick an anyrouter model, and confirm the call in request logs.
Install Pi
bash
curl -fsSL https://pi.dev/install.sh | sh
export ANYROUTER_API_KEY="sk-ar-..."
~/.pi/agent/models.json
json
{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "anyrouter": {
      "baseUrl": "https://anyrouter.dev/api/v1",
      "api": "openai-completions",
      "apiKey": "$ANYROUTER_API_KEY",
      "models": [
        { "id": "anyrouter/auto" }
      ]
    }
  }
}

Limits

  • Pi reads models.json each time you open /model. Add one entry per model id you want in the picker.

Ready to try it

The guide has the full walkthrough. Sign up if you still need a key.