pi-zro-provider
v1.2.2
Published
Zro provider extension for pi - GLM-5.2, Kimi K3 & DeepSeek V4 Flash through the Zro inference endpoint
Maintainers
Readme
✨ pi-zro-provider
3+ models through Zro
GLM-5.2, Kimi K3, and DeepSeek V4 Flash — run through the Zro inference endpoint with pi.
Features
- 3+ AI Models — GLM-5.2 (default), Kimi K3, and DeepSeek V4 Flash, straight from Zro's production catalog
- Native reasoning effort — every model ships its published
piLevel→ level-id map (glm-5.2:off/high/max,kimi-k3:low/high/max,deepseek-v4-flash-0731:off/low/high/max), so/thinking highetc. maps exactly to what the Zro proxy expects - OpenAI-compatible API at
https://zro.moonmath.ai/v1 - Official catalog sync from Zro's
/api/cli/modelsendpoint — same onezro modelsuses - Zro login reuse — if you've run
zro login, the extension picks up~/.config/zro/credentials.jsonautomatically (no duplicated keys) - Footer status widget — session spend/requests and account plan / available spend / usage packs / 30-day activity at a glance
Available Models
| Model | Type | Context | Max Tokens | Input Cost | Output Cost | |-------|------|---------|------------|------------|-------------| | DeepSeek V4 Flash | Text | 1.0M | 384K | $0.14 | $0.28 | | GLM-5.2 | Text | 524K | 64K | $1.10 | $4.00 | | Kimi K3 | Text + Image | 1.0M | 131K | $2.50 | $12.00 | Costs are per million tokens. Billing is metered by your Zro plan and usage packs — see zro.moonmath.ai for pricing.
Installation
Option 1: Using pi install (Recommended)
Install from npm:
pi install npm:pi-zro-providerOr directly from GitHub:
pi install https://github.com/monotykamary/pi-zro-providerThen make sure you're logged in (or set a key) and run pi:
# Recommended: reuse your zro CLI login
zro login
# Or set as environment variable
export ZRO_API_KEY=your-api-key-here
piGet your API key from zro.moonmath.ai.
Option 2: Manual Clone
Clone this repository:
git clone https://github.com/monotykamary/pi-zro-provider.git cd pi-zro-providerMake sure you have a Zro credential (any of the Authentication options).
Run pi with the extension:
pi -e /path/to/pi-zro-provider
Usage
After loading the extension, select a model with:
/model zro glm-5.2Or start pi directly with a Zro model:
pi --provider zro --model glm-5.2Reasoning Effort
All Zro models are reasoning models. Control thinking depth with /thinking or the CLI:
pi --provider zro --model glm-5.2 --thinking xhighThe available levels are model-specific and come straight from Zro's catalog:
| Model | pi levels | Sent as reasoning_effort |
|-------|-----------|----------------------------|
| glm-5.2 | off, high, max | none, high, max |
| kimi-k3 | low, high, max | low, high, max |
| deepseek-v4-flash-0731 | off, low, high, max | none, low, high, max |
Levels map one-to-one through thinkingLevelMap, so off sends Zro's none token instead of silently dropping the field.
Footer Status
A Neuralwatt-style status line sits below the editor. It appears after the session's first Zro turn completes (never before — no half-empty line on fresh sessions or other providers), refreshes its balance when the agent run fully settles, and makes no status-related API calls in sessions that never use Zro:
⚡ $0.42 · 7 req Pro ◆ $12.34 avail · $2.50 pack · 1.2k req/30d
└─ session spend+requests ─┘ └─ plan · available spend · packs · activity ──┘The left side tracks what this session has done — request count, the spend
Zro attaches to a response when it reports one, and elapsed time (raw token
totals stay in pi's own footer, which can't show
Zro cost since its catalog carries no pricing). The right
side shows your plan name, total available spend, usage-pack balance, and
30-day request/token activity from Zro's /api/cli/status endpoint — the
same account view zro status prints — plus a request-rate atom from
response headers when present. The right side compresses progressively as
the terminal narrows, and turns to a warning color at/below the
lowBalanceUsd threshold.
Configuration
Edit ~/.pi/agent/extensions/zro.json or run /zro-status:
| Setting | Values | Default |
|---------|--------|---------|
| session | widget | statusbar | off | widget |
| account | widget | statusbar | off | widget |
| hideOnOtherProvider | true | false | true |
| lowBalanceUsd | number | null | 10 |
Non-interactive toggles:
/zro-status session widget|statusbar|off
/zro-status account widget|statusbar|off
/zro-status hide true|false
/zro-status lowBalance 25|off
/zro-status refresh
/zro-status resetAuthentication
The Zro API key can be configured in multiple ways (resolved in this order):
auth.json(recommended) — Add to~/.pi/agent/auth.json:
The{ "zro": { "type": "api_key", "key": "your-api-key" } }keyfield supports literal values, env var names, and shell commands (prefix with!). See pi's auth file docs for details.- Environment variable — Set
ZRO_API_KEY zro loginreuse — If you've already runzro login, the extension reads~/.config/zro/credentials.json(XDG_CONFIG_HOMEaware) automatically. No extra configuration needed.- Runtime override — Use the
--api-keyCLI flag
Get your API key from zro.moonmath.ai.
Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| ZRO_API_KEY | No | Your Zro API key (env var fallback) |
| ZRO_ENDPOINT_ROOT | No | Override the endpoint root (default https://zro.moonmath.ai) |
| ZRO_AUTH_URL | No | Override the authentication/API host (used by zro login; the extension resolves catalog/status from it too) |
Configuration
Add to your pi configuration for automatic loading:
{
"extensions": [
"/path/to/pi-zro-provider"
]
}Catalog and Compat Settings
Model metadata matches the transform Zro's own pi adapter applies to its
/api/cli/models catalog:
- canonical ids, display names, context windows, and output caps
thinkingLevelMapbuilt from each model's published reasoning levels (piLevel→ provider level id)compat.supportsReasoningEffort: trueandmaxTokensField: "max_tokens"(plainopenai-completions, no customthinkingFormat)supportsDeveloperRole: false- all text-only inputs
patch.json is reserved only for a verified provider regression and is
currently empty.
Patch Overrides
patch.json is applied on top of models.json only for verified endpoint
corrections. It is currently empty because every live field comes from Zro's
canonical model catalog.
Updating Models
Run the update script to fetch the latest models from the Zro catalog:
node scripts/update-models.js # uses zro login credentials
# or
ZRO_API_KEY=your-api-key node scripts/update-models.jsThis will:
- Fetch models from
https://zro.moonmath.ai/api/cli/models - Regenerate
models.jsonas pure metadata from the live catalog - Apply overrides from
patch.jsononly when building the README - Remove custom models now available upstream from
custom-models.json - Reconcile delisted models through the 14-day
deprecated-models.jsongrace layer - Update
models.jsonand the README model table
License
MIT
