Pi
An extensible terminal coding agent that lets you override built-in providers.
Set it up from a GUI instead
Prefer not to edit config files: use CC-Switch (Claude Code / Codex) or Magpie (one place for every agent).
Install
bash
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
pi --versionConfigure
Override the built-in openai provider in ~/.pi/models.json:
json
{
"openai": {
"baseUrl": "https://leekbox.ai/v1",
"models": ["gpt-6-astra", "claude-sonnet-5"],
"apiKeyEnv": "LEEKBOX_API_KEY"
}
}Store the key
Either put the same key in ~/.pi/auth.json, or export it:
bash
export LEEKBOX_API_KEY="sk-..."Verify
bash
pi "summarise this repository in three lines"Troubleshooting
| Symptom | Fix |
|---|---|
| Still hits the official API | models.json is not in the global path |
| 401 | LEEKBOX_API_KEY not exported in this shell |
| 404 model | Model id differs from your group's list |