Pi
pi needs no config file from you. LunaRoute ships as a pi extension
(@lunaroute/pi-extension) that registers the gateway as a provider and syncs models from
/v1/models; the CLI installs it, and the credential lives in pi’s own ~/.pi/agent/auth.json.
1. Install the extension
Section titled “1. Install the extension”npx @lunaroute/cli setup piIt runs pi install npm:@lunaroute/pi-extension for you. That is the whole configuration: the
extension registers the LunaRoute provider and pulls the model list at runtime, so nothing is written
into pi’s settings and no model list goes stale.
Two things it will ask:
- Decline the extension install and setup falls back to merging a
providers.lunarouteblock into~/.pi/agent/models.json(backup kept, your other providers preserved). That path writes the key into the file, so it needs you logged in first — and it does not sync models later. --keyskips the browser step:npx @lunaroute/cli setup pi --key lr_… --yesverifies the key, installs the extension, and stores the key in~/.pi/agent/auth.json.
pi itself must already be on your PATH, version 0.84.1 or newer — this installs the extension, not
pi:
npm install -g --ignore-scripts @earendil-works/pi-coding-agent2. Sign in and pick a model
Section titled “2. Sign in and pick a model”piThen, inside pi:
/login lunaroute # browser login, if setup carried no key/model # pick a lunaroute/* modelModels sync from /v1/models on your first interactive run, so a scripted pi -p start before
that finds no catalog. After the first run new models appear on refresh, and /model lists every
model your organization serves.
3. Undo
Section titled “3. Undo”pi remove npm:@lunaroute/pi-extensionThat drops the extension and its provider; pi is back to its previous configuration. Signing out is
separate — delete the lunaroute entry from ~/.pi/agent/auth.json, or replace it with a fresh
/login lunaroute. A providers.lunaroute block left over from the models.json path has to go from
that file by hand. lunaroute logout clears the CLI’s own stored credential (in ~/.config/lunaroute/),
which nothing on this page needs once pi is signed in.
There is no one-session lunaroute run pi today; run covers Claude Code, Codex and Zed.
Verify without starting pi
Section titled “Verify without starting pi”curl https://gw.lunaroute.com/v1/models \ -H "Authorization: Bearer $LUNAROUTE_API_KEY"Related
Section titled “Related”- CLI — install,
run,setup, and the Windows/WSL notes. - Harness setup — the other harnesses, and the MCP server.
- OpenCode — the other extension-first harness.