chore: update @mariozechner/pi-ai to version 0.50.3 and enhance OpenRouter documentation with provider routing details

This commit is contained in:
Matthijs Hoekstra 2026-01-29 13:04:12 +01:00
parent 6372242da7
commit 87b1c2bfb7
2 changed files with 41 additions and 1 deletions

View File

@ -33,3 +33,43 @@ moltbot onboard --auth-choice apiKey --token-provider openrouter --token "$OPENR
- Model refs are `openrouter/<provider>/<model>`.
- For more model/provider options, see [/concepts/model-providers](/concepts/model-providers).
- OpenRouter uses a Bearer token with your API key under the hood.
## Provider routing
OpenRouter supports provider routing via the `compat.openRouterRouting` field, which controls which upstream providers handle your requests. Configure this in `agents.defaults.models` for individual models.
### Configuration options
- `compat.openRouterRouting.only`: List of provider slugs to exclusively use for this request (e.g., `["anthropic", "openai"]`).
- `compat.openRouterRouting.order`: List of provider slugs to try in sequence (e.g., `["anthropic", "openai"]`).
### Example
```json5
{
env: { OPENROUTER_API_KEY: "sk-or-..." },
agents: {
defaults: {
model: { primary: "openrouter/anthropic/claude-sonnet-4-5" },
models: {
"openrouter/anthropic/claude-sonnet-4-5": {
alias: "Claude Sonnet",
compat: {
openRouterRouting: {
only: ["anthropic"]
}
}
},
"openrouter/openai/gpt-5.2": {
alias: "GPT-5.2",
compat: {
openRouterRouting: {
order: ["anthropic", "openai"]
}
}
}
}
}
}
}
```

View File

@ -164,7 +164,7 @@
"@line/bot-sdk": "^10.6.0",
"@lydell/node-pty": "1.2.0-beta.3",
"@mariozechner/pi-agent-core": "0.49.3",
"@mariozechner/pi-ai": "0.49.3",
"@mariozechner/pi-ai": "0.50.3",
"@mariozechner/pi-coding-agent": "0.49.3",
"@mariozechner/pi-tui": "0.49.3",
"@mozilla/readability": "^0.6.0",