@tejasa97/pi-orcarouter-provider

Pi provider package for OrcaRouter (GLM 5.3 Flash Free, DeepSeek, Kimi, and more) — OpenAI-compatible gateway with dynamic model discovery.

Packages

Package details

extension

Install @tejasa97/pi-orcarouter-provider from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@tejasa97/pi-orcarouter-provider
Package
@tejasa97/pi-orcarouter-provider
Version
0.1.1
Published
Sep 13, 2026
Downloads
301/mo · 228/wk
Author
tejasa97
License
MIT
Types
extension
Size
21.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/orcarouter/index.ts"
  ]
}

Security note

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

README

@tejasa97/pi-orcarouter-provider

Pi provider package for OrcaRouter — an OpenAI-compatible API gateway with 200+ models, including the free GLM 5.3 Flash (Free) tier (z-ai/glm-5.3-flash-free).

Auth is an API key stored by /login in ~/.pi/agent/auth.json, with ORCAROUTER_API_KEY as a fallback. Model discovery uses GET /v1/models when a key is available, falling back to a small static catalog.

Install

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

For local development:

pi install ./pi-orcarouter-provider

Usage

  1. Create an API key in the OrcaRouter console
  2. In Pi: /loginOrcaRouter → paste your API key
  3. /model → pick a model such as orcarouter/z-ai/glm-5.3-flash-free

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

export ORCAROUTER_API_KEY="sk-orca-..."
pi

Optional base URL override:

export ORCAROUTER_BASE_URL="https://api.orcarouter.ai/v1"

Models

Models are fetched dynamically from GET https://api.orcarouter.ai/v1/models when a key is configured. Chat-completions models are selected from the catalog:

  • entries listing "openai" in supported_endpoint_types, plus
  • free-tier stubs with a null endpoint list (e.g. z-ai/glm-5.3-flash-free, deepseek/deepseek-v4-flash-free), excluding obvious non-chat offerings (image/video/tts/embeddings by id).

The static fallback includes:

Model Reasoning Input Context Max output
z-ai/glm-5.3-flash-free always-on text + image 110K* 128K
z-ai/glm-5.3-flash always-on text + image 1M 128K
z-ai/glm-5.3 always-on text 1M 128K
deepseek/deepseek-v4-flash-free yes text 164K 32K
tencent/hy3-free yes text 128K 32K

Free-tier limits

z-ai/glm-5.3-flash-free is $0 per request, but OrcaRouter gates it:

  • Single-request prompt cap ~122K tokens. The catalog advertises a 1M context, but prompts above roughly 122K tokens are rejected with free_rate_limited ("This prompt is longer than the free tier allows for a single request"). The provider registers the model with a 110K context window so Pi keeps sessions under the cap (Pi's system prompt and tool definitions consume part of it).
  • Rolling usage gate. After sustained heavy usage the same free_rate_limited error appears even for smaller prompts. It clears on its own after a quiet period.
  • Transient DNS failures. api.orcarouter.ai (EdgeOne CDN) intermittently fails to resolve, surfacing in Pi as "Connection error." Retrying after a minute usually works.

GLM-5 notes

Verified against the live endpoint:

  • Thinking is always on; reasoning_effort accepts low / medium / high / max. Pi's off maps to low, max maps to max.
  • The developer role is rejected upstream, so the provider uses system.
  • Token limits are sent as max_completion_tokens.
  • Costs come from the catalog's per-million price fields; the free tiers are $0 (flat per-request fee).

Tests

npm test