← Catalog

@dtmirizzi/pi-openrouter-live-models

Always-fresh OpenRouter model list with an enhanced model selector for pi

Package

Install

Install with PiG

pig install npm:@dtmirizzi/pi-openrouter-live-models

Install with Pi

pi install npm:@dtmirizzi/pi-openrouter-live-models
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "image": "https://raw.githubusercontent.com/dtmirizzi/pi-openrouter-live-models/main/assets/logo.png",
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.2.1 (README.md). PiG does not review it.

pi-openrouter-live-models

Logo

Always-fresh OpenRouter model list for pi.

Every time pi starts, this extension fetches the latest models from the OpenRouter API and replaces pi's static snapshot. No more stale model lists.

Features

  • Live model fetching — pulls from OpenRouter's API at startup (cached for 24h)
  • Enhanced model selector — /ormodels opens a rich TUI with:
    • Fuzzy search across model ID + name
    • Provider filtering (toggle specific providers on/off with single-letter keys)
    • Sort by name, price, or context window
    • Filter by modality (text-only vs text+image)
    • Model detail preview showing pricing, context window, and capabilities
  • Automatic caching — avoids hitting the API every launch
  • Force refresh — /ormodels --refresh re-fetches instantly

Installation

pi install git:github.com/dtmirizzi/pi-openrouter-live-models

Or install from a local path:

pi install /path/to/pi-openrouter-live-models

Requirements

An OpenRouter API key must be configured. Any of these work:

  1. Environment variable: OPENROUTER_API_KEY
  2. pi's models.json:
{
  "providers": {
    "openrouter": {
      "apiKey": "$OPENROUTER_API_KEY"
    }
  }
}
  1. pi's /login flow (if logged in to OpenRouter)

Usage

Open the enhanced model selector:

/ormodels

Force a refresh from the API:

/ormodels --refresh

Keyboard shortcuts in the selector

KeyAction
↑ ↓Navigate models
EnterSelect model
EscCancel
/Focus search bar
sCycle sort mode (name → price↑ → price↓ → context)
mCycle modality filter (all → text → image)
pToggle provider filter panel
aToggle all providers (in provider panel)
provider keysToggle individual providers (e.g., o for openai)

Provider letters

Each provider is toggled by its first letter in the provider panel (p to open/close):

LetterProvider
aToggle all
oopenai
nanthropic
ggoogle
mmeta-llama
ddeepseek
ccohere
...(varies by available models)

How it works

  1. On startup, reads cache from ~/.pi/agent/openrouter-models-cache.json
  2. If cache is older than 24h, fetches fresh from https://openrouter.ai/api/v1/models
  3. Maps API models to pi's model format
  4. Registers them via pi.registerProvider("openrouter", ...) — replacing the static list
  5. Filters out batch-only (:batch) variants that don't support streaming

If the API is unreachable at startup, the extension falls back to cached data or pi's built-in static models.

License

MIT