Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omp-zai-coding-plan

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.

Models

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)

How sign-in works

Mirrors the ZCode desktop "Individual Plan" browser flow:

  1. Authorize — opens chat.z.ai (authorization code, no PKCE) and hosts a loopback callback server on port 54548.
  2. Token exchange — trades the returned code for a short-lived OAuth access token.
  3. Business login — exchanges that token for a durable biz token.
  4. Key mint — resolves your default org/project, finds or creates an oh-my-pi-named API key, and reads its secret, yielding the durable apiKey.secretKey bearer.

If the browser can't reach this machine, paste the final redirect URL (or the code/state) when prompted.

Install

# 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-plan

Then 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

Requirements

  • A Z.AI GLM Coding Plan account.
  • Oh My Pi v17+ (@oh-my-pi/pi-coding-agent, @oh-my-pi/pi-ai peers). Bun ≥ 1.3.14.

Configuration (optional)

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

License

MIT © Mihai

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages