nc://zai-coding-plan

v0.1.0Pinned
Backnodecode-ai
pomterrecells: thirty-three cells, ported from oh-my-pi -- providers oh-my-pi carries (can1357/oh-my-pi at c9383c1, MIT, credited in each folder's NOTICE), each as a cell of its own: Alibaba's Coding and Token Plans, Amazon Bedrock, Anthropic's Pro/Max sign-in, Apple's on-device Foundation Models (macOS), Azure OpenAI, ClinePass, Cloudflare AI Gateway, Cursor, Devin, Factory Droid, GitHub Copilot, GitLab Duo and its agent, Antigravity, the Gemini CLI's Cloud Code Assist, Vertex AI, Kilo, Kimi Code, local ONNX and MLX workers, Muse Code, Ollama Cloud, ChatGPT's Codex sign-in and its device-code variant, OpenRouter, Snowflake Cortex, xAI's SuperGrok sign-in, Xiaomi MiMo and Z.AI's Coding Plan; and four that are not chat providers: language servers (nodecode-lsp), Perplexity search, keyless web search engines (nodecode-web-provider) and TypeSafe judgments. Each stands alone: it loads, starts, stops and tests by itself, depends only on nodecode, and shares no code with another; one whose wire none of the four lanes speaks registers a lane of its own. Written against the cell contract (src/CELLS.md) at nodecode fb4bdabc1. Their tests ran green against that tree with no network (~/nodecode-cells/tools/test-cell.sh, 663 tests over the 33, 0 failed).914a3fe· 8 Oct1 commit
test1 filecell.lisp6.3 KBmodels.json6.8 KBprovider.lisp8.4 KBsignin.lisp22.2 KB

nodecode-zai-coding-plan

A Nodecode cell for Z.AI's GLM Coding Plan, signed in from the browser. With it, /zai-coding-plan login signs the plan in, /models lists GLM-5.3 and its kin, and a turn goes to Z.AI the way oh-my-pi sends it:

  • every GLM model omp knows rides the Anthropic Messages endpoint at https://api.z.ai/api/anthropic, the key sent as a bearer, thinking on a budget (budget_tokens, and for GLM-5.2 and GLM-5.3 the effort beside it)
  • GLM-5.3-Flash, which that endpoint does not carry, rides the native chat endpoint at https://api.z.ai/api/coding/paas/v4, with Z.AI's thinking switch beside reasoning_effort
  • a model only models.dev lists for zai-coding-plan keeps riding the chat endpoint, as it did before this cell

Ported from oh-my-pi's zai-coding-plan sign-in and zai provider. See NOTICE.

Sign in

/zai-coding-plan login

answers at once with the address to open. It is ZCode's own sign-in: Z.AI allows this client only ZCode's desktop redirect, zcode://zai-auth/callback, so when the browser lands there (or offers to open ZCode), copy that whole address, or the code in it, and paste it:

/zai-coding-plan code zcode://zai-auth/callback?code=...&state=...

The sign-in finishes in the background and says how it went as a notice. It exchanges the code for a short-lived token, logs in to Z.AI's business API with it, finds or creates a key named nodecode in the account's default project, and keeps <apiKey>.<secretKey> in auth.json under oauth_tokens.zai-coding-plan. That key does not expire, so nothing is refreshed. /zai-coding-plan status says whether the plan is signed in, /zai-coding-plan logout forgets the key (it stays live at Z.AI until you delete it there).

Without the sign-in: make a key at <https://z.ai/manage-apikey/apikey-list> and save it with /connect, or set ZAI_API_KEY (or ZAI_CODING_PLAN_API_KEY). A key saved with /connect wins over the sign-in, the sign-in over the variables. No other provider's key is ever sent to Z.AI: with none of these the round goes keyless and Z.AI says why.

omp's environment overrides work here too: ZAI_OAUTH_CLIENT_ID, ZAI_OAUTH_AUTHORIZE_URL, ZAI_OAUTH_REDIRECT_URI, ZAI_OAUTH_TOKEN_URL, ZAI_BIZ_BASE, ZAI_BUSINESS_LOGIN_URL.

Install

Copy this folder into ~/.nodecode/cells/nodecode-zai-coding-plan/ and restart Nodecode, or run (restart-cells).

Configure

Optional. The section is on unless it says "enabled": false:

{
  "zai-coding-plan": {
    // the chat endpoint (GLM-5.3-Flash, and what only models.dev lists)
    "base_url": "https://api.z.ai/api/coding/paas/v4",
    // the Messages endpoint; the lane appends /messages
    "anthropic_base_url": "https://api.z.ai/api/anthropic/v1"
  }
}

A providers.zai-coding-plan entry in the config that names an sdk or a base_url outranks both: the operator's declaration wins over omp's route.

Test

From this repository's root:

tools/test-cell.sh nodecode-zai-coding-plan

Not ported

  • omp's native scheme receiver: on a supported desktop omp registers itself for zcode:// for the length of the sign-in, so the redirect comes back on its own. Here the address is pasted.
  • omp replays a GLM model's unsigned thinking as thinking blocks (replayUnsignedThinking); the core's Messages lane drops unsigned thinking from the history it sends.

MIT licensed.

Add nc://zai-coding-plan

  1. 1

    Install Nodecode

    Once per machine.

    $ curl -fsSL https://nodecode.ai/install.sh | sh
  2. 2

    Add the cell

    Pinned at 914a3fe.

    $ nodecode add nc://zai-coding-plan

    Or tell the agent add the zai coding plan cell.

  3. 3

    Sign in

    Run /zai-coding-plan login and follow what it says.