Downsizing logodownsizing
Documentation

Using Downsizing with Pi

Route Pi (earendil-works/pi, a minimal terminal coding agent) traffic through Downsizing by overriding its built-in Anthropic provider endpoint.


Prerequisites

Install the Downsizing CLI — see the CLI guide if you haven't already.

Link Pi (Recommended)

Link Pi to Downsizing:

bash
ds link pi

This idempotently writes ~/.pi/agent/models.json, overriding the baseUrl and apiKeyof Pi's built-in anthropicprovider so its requests route through Downsizing's proxy, using the native Anthropic Messages API — not the OpenAI Chat Completions API. Because the override doesn't redefine Pi's models array, every built-in Claude model Pi ships (claude-opus-4-*, claude-sonnet-4-*, etc.) keeps working unchanged. It only ever touches the providers.anthropic entry it owns, leaving the rest of your config untouched.

Verify

Run a quick one-shot query to confirm traffic is routing through Downsizing:

bash
pi -p "Reply with the single word: pong"

If Pi responds, Downsizing is set up correctly. You can also check your savings dashboard to see the request appear in your usage metrics.

Manual Setup

If you prefer to configure manually, edit ~/.pi/agent/models.json and add:

json
{
  "providers": {
    "anthropic": {
      "baseUrl": "https://api.downsizing.dev/YOUR_INFERENCE_ID/anthropic",
      "apiKey": "dws_YOUR_API_KEY"
    }
  }
}

Find your Inference ID and API key on the Inference API page. Pi reloads models.json automatically the next time you open the model picker, so no restart is required.

Unlinking

To remove Downsizing from Pi:

bash
ds unlink pi

This restores any baseUrl/apiKey Pi had configured before linking, or removes the keys entirely if there was nothing there originally.

Note on MCP

Pi does not ship with built-in MCP support — its own docs describe extending it with CLI tools/skills or a custom extension instead. This is unrelated to Downsizing routing: the link above only changes which endpoint Pi's Anthropic provider talks to.


Spot an error or something not working? Tell us on Discord or email docs@downsizing.dev.