@neilurk12/pi-tokenrouter

TokenRouter AI model provider extension for pi coding agent

Packages

Package details

extension

Install @neilurk12/pi-tokenrouter from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@neilurk12/pi-tokenrouter
Package
@neilurk12/pi-tokenrouter
Version
0.1.0
Published
Jun 13, 2026
Downloads
not available
Author
neilurk12
License
MIT
Types
extension
Size
3.1 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-tokenrouter

TokenRouter AI model provider extension for pi coding agent.

Installation

pi install npm:@neilurk12/pi-tokenrouter

Setup

Get an API key from TokenRouter, then choose one of the following methods:

Environment variable (recommended)

export TOKENROUTER_API_KEY="your-api-key"

Config file

Create ~/.pi/tokenrouter.json:

{
  "apiKey": "your-api-key"
}

If both are set, the environment variable takes precedence.

Custom Models

Override or extend the default model list in ~/.pi/tokenrouter.json:

{
  "models": [
    { "id": "MiniMax-M3", "name": "MiniMax M3" },
    { "id": "my-custom-model", "name": "Custom Model", "contextWindow": 256000 }
  ]
}

When models is provided, it replaces the defaults entirely.

Default Models

Model ID Name
MiniMax-M3 MiniMax M3

Usage

Select a TokenRouter model in pi with /model command.