Pi
Pi (pi-mono) is a minimal, highly extensible terminal coding framework — TypeScript extensions, skills, prompt templates, themes, tree-shaped sessions, and 15+ built-in providers. Add WRouter as an OpenAI-compatible provider in the config.
Prerequisites
| Item | Requirement |
|---|---|
| Pi (pi-mono) | Installed |
| WRouter | A working sk- token |
Set the API key
bash
export WROUTER_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Configure
Add to Pi's config file:
json
{
"providers": {
"wrouter": {
"baseUrl": "https://wrouter.ai/v1",
"api": "openai-completions",
"apiKey": "$WROUTER_API_KEY",
"models": [
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6",
"contextWindow": 200000,
"maxTokens": 128000,
"input": ["text"],
"reasoning": true,
"compat": {
"requiresReasoningContentOnAssistantMessages": true,
"thinkingFormat": "anthropic",
"reasoningEffortMap": {
"minimal": "low",
"low": "low",
"medium": "medium",
"high": "high",
"xhigh": "max"
}
}
},
{
"id": "gemini-2.5-flash",
"name": "Gemini 2.5 Flash",
"contextWindow": 1000000,
"maxTokens": 65536,
"input": ["text"],
"reasoning": false
}
]
}
}
}Field notes:
| Field | Note |
|---|---|
baseUrl | https://wrouter.ai/v1 |
api | openai-completions |
apiKey | Use $WROUTER_API_KEY to read from env |
compat.requiresReasoningContentOnAssistantMessages | true for Claude thinking models — preserves reasoning trace across turns |
compat.thinkingFormat | anthropic for Claude models |
Verify
bash
piPick wrouter provider and prompt.
Known limitations
- Pi's tree-shaped session model is a Pi feature, not a WRouter feature; conversation branching uses local state.
- For per-model reasoning-effort customization, refer to Pi's
compatdocumentation.