Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pi-tokenrouter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
pi-tokenrouter
A pi provider extension for TokenRouter.
Models are derived from TokenRouter's /v1/models list and enriched with metadata from models.dev first, then OpenRouter.
Install
pi install npm:pi-tokenrouterOr run directly:
pi -e /path/to/pi-tokenrouterAuthentication
Resolve via /login, environment variable, or auth.json:
# Option 1: Interactive login
/login tokenrouter
# Option 2: Environment variable
export TOKENROUTER_API_KEY=sk-...
# Option 3: auth.json (~/.pi/agent/auth.json)
# "tokenrouter": { "type": "api_key", "key": "sk-..." }How it works
- Registers TokenRouter as an API-key provider, so
/login tokenrouteris handled underUse an API key. - Uses a checked-in snapshot generated from TokenRouter's authenticated
/v1/modelsresponse. - Enriches each model with metadata from
models.devwhen available, then falls back to OpenRouter for pricing, context window, max output tokens, reasoning support, and image support.
License
MIT