← Catalog

@tejasa97/pi-agentrouter-provider

Pi provider package for AgentRouter (Opus, GPT-5.5/5.6, GLM-5.2/5.3).

ExtensionProvider

Install

Install with PiG

pig install npm:@tejasa97/pi-agentrouter-provider

Install with Pi

pi install npm:@tejasa97/pi-agentrouter-provider
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.

{
  "extensions": [
    "./extensions/agentrouter/index.ts"
  ]
}

README

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

@tejasa97/pi-agentrouter-provider

Pi package that registers the agentrouter provider for AgentRouter.

The catalog is AgentRouter's documented coding models, plus glm-5.3 (their Pi page still lists glm-5.2). Auth is an API key stored by /login in ~/.pi/agent/auth.json, with AGENTROUTER_API_KEY as a fallback. One login covers both APIs.

This is a static list from their docs, not a live /v1/models fetch. Confirm ids in the personal console if a request 404s.

Install

pi install npm:@tejasa97/pi-agentrouter-provider

Or from git:

pi install git:github.com/tejasa97/pi-agentrouter-provider

Usage

  1. Create an API key at https://agentrouter.org/console/token
  2. In Pi: /login → Use an API key → AgentRouter
  3. /model → agentrouter/glm-5.3 (or any other catalog id)

The key is written to ~/.pi/agent/auth.json under agentrouter. Stored credentials win over the environment.

You can skip /login by exporting the key in the shell that starts Pi:

export AGENTROUTER_API_KEY="your-key"
pi

Optional endpoint overrides. Do not mix the two URLs.

export AGENTROUTER_BASE_URL="https://agentrouter.org/v1"
export AGENTROUTER_ANTHROPIC_BASE_URL="https://agentrouter.org"

If Ctrl+P cycling ignores a model, add agentrouter/<id> to enabledModels in ~/.pi/agent/settings.json. /model still lists the full catalog without that.

Models

IdAPIBase URL
claude-opus-4-6anthropic-messageshttps://agentrouter.org
claude-opus-4-7anthropic-messageshttps://agentrouter.org
claude-opus-4-8anthropic-messageshttps://agentrouter.org
gpt-5.5openai-completionshttps://agentrouter.org/v1
gpt-5.6openai-completionshttps://agentrouter.org/v1
glm-5.2openai-completionshttps://agentrouter.org/v1
glm-5.3openai-completionshttps://agentrouter.org/v1

GLM thinking uses Pi's Z.AI flags. Opus uses adaptive thinking and omits eager_input_streaming because AgentRouter is a gateway. GPT uses Chat Completions, matching AgentRouter's Pi docs, not the Codex Responses path.

Testing

npm test