@thesethrose/pi-zai-provider
v1.0.0
Published
Z.AI (GLM models) provider extension for pi coding agent with API key authentication
Downloads
82
Readme
@thesethrose/pi-zai-provider
Z.AI (GLM models) provider extension for the pi coding agent. Registers all Z.AI GLM models using the OpenAI-compatible coding API with API key authentication.
Models
| Model | Context | Max Output | Input $/MTok | Output $/MTok | |---|---|---|---|---| | GLM-5.1 | 200K | 128K | $1.00 | $3.20 | | GLM-5 | 200K | 128K | $1.00 | $3.20 | | GLM-5 Turbo | 200K | 128K | $1.20 | $4.00 | | GLM-5 Code | 200K | 128K | $1.20 | $5.00 | | GLM-4.7 | 200K | 128K | $0.60 | $2.20 | | GLM-4.7 Flash | 200K | 128K | Free | Free | | GLM-4.7 FlashX | 200K | 128K | $0.07 | $0.40 | | GLM-4.6 | 200K | 128K | $0.60 | $2.20 | | GLM-4.5 | 200K | 96K | $0.60 | $2.20 | | GLM-4.5 Air | 200K | 96K | $0.20 | $1.10 | | GLM-4.5 Flash | 200K | 96K | Free | Free | | GLM-4.5 X | 200K | 96K | $2.20 | $8.90 | | GLM-4.5 AirX | 200K | 96K | $1.10 | $4.50 |
Installation
# From npm
pi install npm:@thesethrose/pi-zai-provider
# From GitHub (no npm account needed)
pi install git:github.com/TheSethRose/pi-zai-providerSetup
After installing, authenticate with your Z.AI API key:
/login zaiGet your API key at: https://z.ai/manage-apikey
Usage
Switch to a Z.AI model:
/model glm-5.1Notes
- Uses the coding-specific endpoint (
api.z.ai/api/coding/paas/v4) for plan quota consumption - Pi has native Z.AI compat built-in:
enable_thinkingparam,reasoning_contentstreaming, and correct compat flags auto-detected from theapi.z.aiURL - GLM-5.1 is available on all GLM Coding Plan tiers; GLM-5 requires Pro or Max
