Connect pi

Updated

Minimal open-source terminal coding agent; custom endpoints live in models.json.

Use cases

For anyone who wants a small, extensible terminal coding agent. pi keeps custom endpoints in ~/.pi/agent/models.json; api: openai-completions selects the chat/completions protocol.

Tips

A coding agent sends many long requests per task, so pick a long-context model with tool calling and set a daily spend limit on the key.

Reasoning effort

Whether a reasoning level is sent depends on the reasoning setting you give the model (reasoning_effort on the Chat API). The platform follows the levels the serving line accepts: a level the upstream rejects becomes the next higher accepted level, or its highest one. If the model cannot turn reasoning off, asking for it returns 422 model.reasoning_off_unsupported. Each model's table is under Reasoning effort on its page in the catalog; rewritten calls show the rewrite in usage records.

If it cannot connect

  1. Set baseUrl to https://omnimodel.me/v1, without /chat/completions.
  2. The key starts with key_ and is not paused or revoked; auth.invalid_key means the key cannot be used.
  3. The model ID matches the catalog and is in the key's allowed models.
  4. billing.insufficient_credit means the balance is too low; see common errors for more.

Setup

  1. Install: npm install -g --ignore-scripts @earendil-works/pi-coding-agent (Node.js 22.19 or later).
  2. Put the block below in ~/.pi/agent/models.json.
  3. Run pi --model a2agent/{{model}} in your project, or switch with /model inside a session.

Settings

  • API host:https://omnimodel.me/v1
  • API key:YOUR_API_KEY
  • Model:MODEL_ID

This setup follows the pi docs and has not been tested by the platform yet; if something breaks, open a ticket with the request ID.

{
  "providers": {
    "a2agent": {
      "name": "A2Agent",
      "baseUrl": "https://omnimodel.me/v1",
      "api": "openai-completions",
      "apiKey": "YOUR_API_KEY",
      "models": [{ "id": "MODEL_ID" }]
    }
  }
}

FAQ

The context size looks wrong. What now?
pi assumes 128K context and 16K output for custom models. If yours differs, add contextWindow and maxTokens to the model entry.
Do I need to restart after editing models.json?
No. Opening /model inside a session reloads it.