/ agents / pi

Pi

Configure the Pi coding agent to route through base/mnt.ai.

Pi (the pi coding agent) supports custom model providers. Pi’s model configuration accepts any OpenAI-compatible base URL, so base/mnt.ai drops in directly.

Env vars

~/.zshrc
export OPENAI_BASE_URL=https://api.basemnt.ai/v1
export OPENAI_API_KEY=sk-your-key

Bash function

Scope the routing to invocations of the binary only:

~/.zshrc
pi() {
  OPENAI_BASE_URL=https://api.basemnt.ai/v1 \
  OPENAI_API_KEY="$SK_KEY" \
  command pi "$@"
}

Config alternative

Pi stores provider overrides in ~/.pi/models.json (or ~/.config/pi/models.json, depending on version). The schema is a map of provider names to base URL + key:

~/.pi/models.json
{
  "basemnt": {
    "baseUrl": "https://api.basemnt.ai/v1",
    "apiKey": "{env:SK_KEY}",
    "models": {
      "z-ai/glm-5.2": {},
      "deepseek/deepseek-v4-flash-0731": {}
    }
  }
}
Check your version
Pi's config surface moves fast. Run pi --help and look for provider/models flags — if your version reads env vars, the bash function is the lowest-maintenance path.

Verify

Run pi with a prompt. Requests appear in your usage dashboard; a 401 means the key didn’t reach the process (check SK_KEY is exported in the shell you launched from).