An Oh My Pi plugin that adds Z.AI GLM Coding Plan browser sign-in (OAuth).
Run /login, pick "Z.AI (GLM Coding Plan · Sign in)", finish the sign-in in your browser, and the plugin provisions a durable Z.ai id.secret API key for you. No key to paste. Ships a /glm-usage command to read your remaining plan quota.
The provider id is zai-coding-plan, independent from the paste-key zai provider, so both can be configured at once.
| Model | Context | Max output | Thinking |
|---|---|---|---|
zai-coding-plan/glm-5.2 |
1,000,000 | 131,072 | high, max |
zai-coding-plan/glm-5-turbo |
200,000 | 131,072 | on (single tier) |
Mirrors the ZCode desktop "Individual Plan" browser flow:
- Authorize — opens
chat.z.ai(authorization code, no PKCE) and hosts a loopback callback server on port54548. - Token exchange — trades the returned code for a short-lived OAuth access token.
- Business login — exchanges that token for a durable biz token.
- Key mint — resolves your default org/project, finds or creates an
oh-my-pi-named API key, and reads its secret, yielding the durableapiKey.secretKeybearer.
If the browser can't reach this machine, paste the final redirect URL (or the code/state) when prompted.
# From GitHub:
omp plugin install github:cefege/omp-zai-coding-plan
# Or link a local checkout during development:
omp plugin link /path/to/omp-zai-coding-planThen start omp:
/login # choose "Z.AI (GLM Coding Plan · Sign in)"
/model zai-coding-plan/glm-5.2 # after sign-in — no key pasted
/glm-usage # show remaining plan quota
- A Z.AI GLM Coding Plan account.
- Oh My Pi v17+ (
@oh-my-pi/pi-coding-agent,@oh-my-pi/pi-aipeers). Bun ≥ 1.3.14.
Override defaults via environment variables:
| Variable | Default |
|---|---|
ZAI_OAUTH_CLIENT_ID |
client_P8X5CMWmlaRO9gyO-KSqtg |
ZAI_OAUTH_AUTHORIZE_URL |
https://chat.z.ai/api/oauth/authorize |
ZAI_OAUTH_TOKEN_URL |
https://zcode.z.ai/api/v1/oauth/token |
ZAI_BUSINESS_LOGIN_URL |
https://api.z.ai/api/auth/z/login |
ZAI_BIZ_BASE |
https://api.z.ai |
MIT © Mihai