Overview
Pi (slug pi) is a coding agent CLI driven non-interactively through its
--print mode. It reaches its model through OpenRouter, so a Pi run reports
OpenRouter-style model IDs and is priced from the model’s list price. The
harness itself is at pi.dev.
Model IDs
Section titled “Model IDs”Every session is launched with --provider openrouter, so Pi’s model IDs are
OpenRouter provider-prefixed slugs. The ID is passed to the CLI exactly as
supplied, with no routing prefix added. Illustrative examples:
z-ai/glm-5.2moonshotai/kimi-k2.7-codeqwen/qwen3.7-plus
Invocation
Section titled “Invocation”The harness probes and invokes the pi binary, installed into the run container
at run time with:
npm install -g --ignore-scripts @earendil-works/pi-coding-agent && npm cache clean --forceA session runs in --print mode with JSON output. The Test Cabinet passes these
flags:
| Flag | Purpose |
|---|---|
--mode json | Emit the line-delimited JSON event stream consumed for events and usage. |
--print | Run non-interactively, printing output rather than entering an interactive session. |
--provider openrouter | Reach the model through OpenRouter. |
--model <id> | The model to run. |
The prompt is passed as the final positional argument.
Authentication and cost
Section titled “Authentication and cost”Pi’s API key is sourced from OPENROUTER_API_KEY on the host and injected into
the run container under the same name. See
Authentication.
The model ID is already an OpenRouter slug, so it resolves as-is to the catalog entry the comparable cost is priced from. Pi reports no run cost of its own, so its actual cost equals the comparable cost. See Metrics.