Pi

Route Pi, the minimal terminal coding harness, through BitRouter as an OpenAI-compatible provider.

Pi is a minimal terminal coding harness that defines model providers in ~/.pi/agent/models.json. Add BitRouter as an OpenAI-compatible provider and Pi routes across the whole registry.

Prerequisites

  • BitRouter running — local proxy at http://127.0.0.1:4356, or BitRouter Cloud at https://api.bitrouter.ai.

  • Pi installed:

    npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Point Pi at BitRouter

Add a provider to ~/.pi/agent/models.json. Use api: "openai-completions" and point baseUrl at the /v1 root.

{
  "providers": {
    "bitrouter": {
      "baseUrl": "http://127.0.0.1:4356/v1",
      "api": "openai-completions",
      "apiKey": "local-placeholder",
      "models": [
        { "id": "openai/gpt-4o", "name": "GPT-4o via BitRouter" },
        { "id": "anthropic/claude-sonnet-4-6", "name": "Claude Sonnet 4.6 via BitRouter" }
      ]
    }
  }
}

Then pick the model with /model in the TUI.

Pick a model

Each models[].id is a registry id in provider/model form, optionally with a :cost / :latency variant. See Models.

Learn more

How is this guide?

On this page