GLM
Connect a Z.ai account to AI Wallet through the sign in of ZCode, which creates a coding plan key on the account.
The GLM account answers with the visitor's Z.ai account, on Z.ai's coding plan endpoint. The wallet lists it as GLM under "With your plan", with the id glm.
What the visitor needs
A Z.ai account with a project for a coding plan key. The wallet creates the key in that project and calls Z.ai's coding plan endpoint with it, so the answers count against the account's coding plan.
Sign in
- In the wallet, the visitor picks GLM under "With your plan".
- The wallet starts a ZCode sign in flow for Z.ai at
https://zcode.z.ai/api/v1/oauth/cli/initand opens the authorization page the flow returns in a window. The side panel asks the visitor to sign in and approve in that window, with no code to compare. - The visitor signs in to Z.ai and approves.
- The wallet reads the flow each time a page finishes loading in the window, when the window closes, and when the visitor presses "I approved it". The flow reads
pendinguntil the visitor approves. - With the Z.ai token the flow returns, the wallet signs in to Z.ai's API and reads the account's organizations.
- It picks the organization and the project whose name contains "default" or "默认", else the first ones.
- It creates an API key named
aiconnectin that project, reads its secret, and keeps the key with its secret as the account's credential. The account is connected.
The flow lasts until the time Z.ai gives, and at least one minute. An account without a project ends the sign in with "this Z.ai account has no project for a coding plan key". The key has no expiry in the wallet and stays in the vault until the visitor removes the account.
Models
The wallet has no model list for GLM. The account answers with glm-5.3, and the side panel shows no model buttons for its sites.
Usage and limits
The wallet reads no usage header specific to GLM. It reads x-ratelimit-remaining-tokens and x-ratelimit-limit-tokens on any answer that carries them, as it does for every account. Without them, the card keeps saying "Usage shows after the first answer", and Auto ranks the account among the accounts with no reading.
Calls
Answers come from https://api.z.ai/api/coding/paas/v4/chat/completions in the OpenAI chat completions protocol, with the key. All four request options reach Z.ai.
Known issues
- The sign in borrows the login of ZCode.
- Each sign in creates a new API key named
aiconnectin the visitor's Z.ai project. Removing the account in the wallet leaves the key on Z.ai.