pi-openrouter-realtime
v0.2.2
Published
OpenRouter extension for pi that loads the latest models from OpenRouter in real time and adds optional provider and quantization enrichment per model
Maintainers
Readme

pi-openrouter-realtime
Pi extension for OpenRouter that loads the latest models from OpenRouter in real time, keeps the default model list simple, and lets you enrich a specific model with provider and quantization variants.
Once the extension is installed and your OpenRouter credential is configured in pi, each new pi session automatically fetches the latest OpenRouter model list.
Npm package:
pi-openrouter-realtime
Features
- Loads the latest OpenRouter model list into pi in real time
- Keeps startup behavior fast by default
- Adds provider-specific variants on demand
- Adds quantization-specific variants for a chosen model
- Routes enriched selections through OpenRouter provider routing
- Enriches one model at a time to avoid slow full-catalog endpoint scans
Install
1) Install the extension
From npm:
pi install npm:pi-openrouter-realtimeFrom GitHub:
pi install git:github.com/olixis/pi-openrouter-plus2) Connect pi to OpenRouter
Recommended: use pi-connect to set up OpenRouter
The git:github.com/hk-vk/pi-connect package makes provider setup much easier and gives you a simple /connect flow inside pi.
Install it:
pi install git:github.com/hk-vk/pi-connectThen open pi and connect OpenRouter:
pi
/connect openrouterWhen prompted:
- Paste your OpenRouter API key
- Confirm/save it
- Start a new pi session, or restart the current one
pi-connect stores the credential in ~/.pi/agent/auth.json, and this extension will then automatically fetch the latest models from OpenRouter when pi starts.
Official pi ways to connect OpenRouter
Pi supports OpenRouter via either an environment variable or ~/.pi/agent/auth.json.
Using an environment variable:
export OPENROUTER_API_KEY=sk-or-...
piUsing ~/.pi/agent/auth.json:
{
"openrouter": { "type": "api_key", "key": "sk-or-..." }
}Pi's official provider docs use:
- Environment variable:
OPENROUTER_API_KEY auth.jsonkey:openrouter
After the key is available, this extension automatically syncs the latest plain OpenRouter model list at session start.
3) Try without installing
pi -e npm:pi-openrouter-realtimeor:
pi -e git:github.com/olixis/pi-openrouter-plusCommands
/openrouter-sync— fetch the latest OpenRouter model list in real time/openrouter-enrich <model-id>— add provider and quantization variants for one specific OpenRouter model
Example
/openrouter-enrich kwaipilot/kat-coder-pro-v2This keeps the normal OpenRouter catalog and adds variants like:
StreamLake — Kwaipilot: KAT-Coder-Pro V2AtlasCloud · fp8 — Kwaipilot: KAT-Coder-Pro V2
Behavior
- After the extension is installed and OpenRouter auth is configured, each new pi session syncs the latest plain OpenRouter model list from OpenRouter automatically
- Enrichment is manual and targeted to one model at a time
- Quantization variants are exposed as separate model choices when available
- Enriched variants are translated into OpenRouter provider routing fields at request time
- If you want to refresh manually or go back to the default list, run
/openrouter-sync
Development
Type-check locally:
bunx tsc --noEmitor:
npx tsc --noEmitTest the package locally with pi:
pi -e .Or load the extension entry file directly:
pi -e ./extensions/openrouter-routing/index.tsLicense
MIT
⁶ Jesus said unto him, I am the way, the truth, and the life: no man comes unto the Father, but by me.
— John 14:6
