Skip to main content
Pi is a terminal coding agent installed from npm. Route it through Edgee to reduce token costs with lossless compression and gain full observability over every session. The fastest way to connect Pi to Edgee is the CLI. It authenticates, registers an Edgee provider in your Pi config (populated from the live Edgee model catalog), and starts Pi.
1

Install the Edgee CLI

2

Install Pi

Pi 0.79.4 or newer is required. Earlier versions read the credential differently and the gateway answers 401.
3

Launch Pi through Edgee

Token compression is enabled automatically. Pick an Edgee model from Pi’s model picker, or pass one directly:
After the session ends, the CLI prints a link to view token usage, compression savings, and cost breakdown in the Edgee Console. The CLI adds a single edgee provider to ~/.pi/agent/models.json (or your PI_CODING_AGENT_DIR, if set). It is additive: every other provider, model, and login you already had keeps working. Each model carries its context window and per-million-token rates from the Edgee catalog, so Pi’s context gauge and session cost readout work instead of reporting every session as 0.YourAPIkeyisstoredasa0. Your API key is stored as a `EDGEE_API_KEY` reference and supplied at launch, never written to disk.

Manual setup (advanced)

Prefer to configure Pi yourself? Add the provider to ~/.pi/agent/models.json and declare the models you want:
Then export your key from the Edgee Console before running pi:
baseUrl carries no /v1 suffix: with api: "anthropic-messages", Pi appends /v1/messages itself. A custom provider in Pi is defined by its models, so the models list cannot be empty. edgee launch pi writes all of this for you from the live catalog.

Benefits

Cost reduction

Edgee’s token compression reduces the tokens sent to and from the model, with no change to output quality.

Observability

Every request is logged in the Edgee Console with token counts, latency, and cost breakdowns.

Reliability

Automatic retry and fallback across providers keeps your sessions running even when a provider has issues.

One command

No config to edit, the CLI wires everything up.

Next Steps