English
Documentation
Console
Harnesses
Pi

Pi

Use OpenCode Console models from the Pi coding agent.

Pi (opens in a new tab) includes OpenCode providers for pay-as-you-go Console access. It picks the right API for each paid or Go model. Free-tier chat models require OpenCode and return HTTP 403 from Pi.

Note: The Console CLI sets up Pi with one command, including the workspace's policies, MCP servers, skills and instructions. Run npx @opencode/console setup pi. The steps below set it up by hand.

ProviderPlan
opencodePay-as-you-go

Configure

Both providers read the key from OPENCODE_API_KEY. Create a personal API key.

export OPENCODE_API_KEY="oc_sk_..."
pi --model opencode/claude-sonnet-5-5

You can also run /login in Pi and select the provider. Pi stores the key in ~/.pi/agent/auth.json.

/login opencode

Models

Select a model as <provider>/<model-id>, using IDs from the Console or Go table. List the models Pi knows about with --list-models.

pi --list-models opencode-go

Set a default in ~/.pi/agent/settings.json, or press Ctrl+S in the /model picker.

~/.pi/agent/settings.json
{
  "defaultProvider": "opencode-go",
  "defaultModel": "kimi-k3"
}

Run pi update --models when a new Console model doesn't appear yet.

Console MCP

Pi v0.99.0 and later support MCP. Add the Console MCP server, then sign in from the browser.

pi mcp add opencode-console --url https://opencode.ai/console/mcp
pi mcp login opencode-console