Knowledge Base Sections ▾

Tools

Tools

ZCode: Cheap GLM inference instead of GLM Coding Plan

In June 2026, Z.ai released ZCode 3.0 — a desktop agentic development environment which the company calls the «Official Harness for GLM-5.2». The product quickly gained attention: its own agent core, autonomous tasks via /goal, multi-agent mode, and remote session control straight from Telegram. However, along with the wave of reviews came a wave of questions from early GLM Coding Plan subscribers: quotas are calculated in "prompts" within 5-hour windows, usage is tripled during peak hours, lower plans allow only one concurrent request, and users on Hacker News complain about sudden blocks after a heavy day of work.

The good news: ZCode officially supports a custom provider — you can connect any OpenAI- or Anthropic-compatible API and pay for actual tokens instead of subscription quotas. In this guide, we will break down what ZCode is and how the GLM Coding Plan is structured, then step-by-step configure ZCode for the JoinGonka Gateway — a gateway for the decentralized Gonka network, which has already added GLM-5.2 to its registry. The result: the same tool, the same open-weight models, but the economics are based on tokens and are hundreds of times cheaper than centralized APIs.

What is ZCode: Agentic development environment from Z.ai

ZCode is not a «chat sidebar editor», but an ADE: you describe a goal, the agent creates a plan, edits files, runs checks, and iterates until the result is achieved. It works as a desktop application on macOS and Windows (Linux build is in beta status).

Key features of version 3.0:

  • ZCode Agent — native agent core with deep GLM-5.2 integration; in addition to it, you can connect third-party agents (Claude Code, Codex, Gemini CLI, and others);
  • Goal-mode (/goal) — long autonomous tasks: plan → execution → step-by-step verification;
  • Multi-agent — parallel work of multiple agents on a project;
  • Remote control — starting and controlling sessions from Telegram, WeChat, and Feishu: the agent runs on your machine, and you answer questions from your phone.

The client itself is free, and Z.ai gives new users a daily GLM-5.2 token quota for trial. After that — either a GLM Coding Plan subscription or your own API key. And this is where it is worth diving into the details, as the subscription model is the most discussed part of the product.

GLM Coding Plan: Price, limits, and quotas

GLM Coding Plan is a Z.ai subscription that provides access to GLM models in ZCode and two dozen other third-party tools. As of the publication date (July 2026), the basic grid looks like this — but prices and promos change, so verify with the live page z.ai/subscribe:

PlanPrice, $/moQuotaConcurrent requests
Lite$18 (on promo — from ~$12.6)«Prompts» in 5h windows + weekly cap1
Pro$72×4 of Lite1
Max$160×16 of Liteup to 30

What subscribers are complaining about (Hacker News and GitHub threads):

  • Peak multiplier. During peak hours (14:00—18:00 UTC+8 — evening in Asia, morning/day in Europe), each request deducts quota with a ×3 coefficient, off-peak — ×2. You have to plan consumption according to Beijing time zone.
  • Quota in «prompts», not tokens. It is opaque exactly how many tokens are left; there are stories in threads like «I burned ~17M tokens on GLM — and got a four-day block».
  • One concurrent request on Lite and Pro. For an agentic environment, this is significant: ZCode's own multi-agent mode and any parallel sub-agents are bottle-necked by the queue.
  • GLM-5.2 consumes quota faster than smaller models — the flagship burns the limit with its own multiplier.

The conclusion is simple: for calm solo development, the subscription works honestly. But the more «agentic» your workflow is — parallel tasks, long autonomous sessions, overnight runs — the more often the quota model turns into a lottery. The alternative is paying for actual tokens: no windows, multipliers, or queues — however much the agent consumed, that much is deducted. This is exactly the model that the built-in ZCode custom provider mechanism provides, and it can be set up in five minutes.

BYOK in ZCode: Your own API key and custom provider

ZCode officially has built-in support for BYOK: the documentation expressly permits adding "any service compatible with OpenAI or Anthropic protocols" — public APIs, enterprise channels, and even self-hosted installations. It can be configured in three ways:

  • Connect button on the welcome screen → "Set Your API Key";
  • Manage Models in the model selector;
  • Gear icon → Settings → Model Settings → Add Provider.

Specify the OpenAI Base URL and/or Anthropic Base URL plus the API Key for the provider — ZCode will automatically fetch the list of available models.

Three common stumbling blocks:

  • Z.ai endpoints differ. The Coding Plan subscription only works via the coding-endpoint https://api.z.ai/api/coding/paas/v4; the general /api/paas/v4 with a subscription key will return an error — a classic reason for "I'm getting 401/429 even though my plan is paid".
  • "Works in Claude Code ≠ works in ZCode". Environment variables like ANTHROPIC_BASE_URL used to configure Claude Code are not read by ZCode: it has its own provider settings storage. Configure it specifically via Settings.
  • "Model is visible in the selector ≠ key has quota". The model list is fetched from the provider's API, while availability depends on the balance and limits of your specific key.

Next steps — practice: connect the JoinGonka gateway to ZCode and get the GLM stack for tokens.

Setting up JoinGonka Gateway in ZCode: GLM for tokens

JoinGonka Gateway is a gateway to the decentralized Gonka network with two native protocols: OpenAI-compatible /v1/chat/completions and Anthropic Messages /v1/messages. For ZCode, this means it connects directly to both custom provider fields without proxy layers. The economics are pay-per-token: no 5-hour windows, no ×3 peak multipliers, and no single parallel request limit; consumption is visible in the dashboard in real-time, and the gateway does not store prompt content.

Step-by-step:

StepAction
1. KeyRegister at gate.joingonka.ai/register (10M free tokens for new accounts), create an API key in the Keys section. More on keys and your first request in API Quick Start.
2. ProviderZCode → Settings → Model Settings → Add Provider (or Connect → "Set Your API Key" on the welcome screen).
3. OpenAI Base URLhttps://gate.joingonka.ai/v1
4. Anthropic Base URLhttps://gate.joingonka.ai (the client will add the /v1/messages endpoint itself)
5. API Keyyour key in the format jg-…
6. ModelSelect from the fetched list: today these are moonshotai/Kimi-K2.6 and MiniMaxAI/MiniMax-M2.7; once GLM-5.2 is enabled, zai-org/GLM-5.2-FP8 will appear in the list.

Check: ask the agent any question. If you get a response, everything is working; error 401 — check your key, 402 — account balance.

Price Comparison: Coding Plan, Z.ai API, OpenRouter, and Gonka

How much does GLM inference cost on different channels (prices per 1M tokens; competitor prices fixed as of July 2026, JoinGonka price is pulled live to the page from the gateway API):

ChannelInput, $/1MOutput, $/1MBilling Model
Z.ai API (GLM-5.2)$1.40 (cached input — $0.26)$4.40per token
GLM Coding Plan$18—160/mosubscription: "prompt" quotas, ×3 peak multiplier, concurrency limits
OpenRouter (z-ai/glm-5.2)$0.93$3.00per token; no free GLM-5.2 option available
JoinGonka Gateway$0.003$0.009per token, Gonka network

The difference of two to three orders of magnitude is not marketing rounding, but a different economic model: computations are performed by participants of a decentralized network who earn from the work itself, not from data center margins. A detailed analysis of how this works and where its applicability boundaries lie can be found in the article on the cheapest AI API.

Fair disclaimer regarding GLM-5.2: the exact price of the model will be set by the network at the moment of activation (the table above shows the current live network model price). The figures on this page update automatically; no manual recalculation required.

GLM-5.2 in the Gonka network: Status and FAQ

The zai-org/GLM-5.2-FP8 model has already been added to the Gonka network on-chain registry: the configuration specifies a context window of up to 400K tokens, and the model itself is heavy (requiring more than a terabyte of VRAM per replica). Rollout is currently in progress: network nodes are warming up the weights. As soon as the checks turn green, the model will automatically appear in the gateway's model list — the base URL and key remain unchanged; you will just need to select it in the ZCode selector.

About the model: open weights under the MIT license, MoE architecture with ~750B parameters (about 40B active per token), and a native window of up to 1M tokens. According to Z.ai, the model scores 62.1 on SWE-bench Pro — higher than GPT-5.5, and on FrontierSWE it lags behind Claude Opus 4.8 by about one percent. For an open-weight model, this is the top spot in coding.

FAQ:

  • Why do 429s happen right after a new model is enabled? — This is the rollout phase: some nodes are still loading weights. Retry your request in a few seconds — the balancer will find an active node.
  • What is available today? — Kimi K2.6 and MiniMax M2.7: both models work in ZCode via the same custom provider, and the configuration from this guide is fully functional right now.
  • What about privacy? — The gateway does not store the content of prompts and responses; statistics only include consumption aggregates.
  • When is the Coding Plan more cost-effective? — If you work solo, stay within the Lite quota, and do not run parallel agents, a subscription with a fixed bill is convenient and predictable. Calculate based on your usage profile: with active agent tasks, paying per token through the network is orders of magnitude cheaper, whereas for light code edits a couple of times a day, the difference may not be noticeable.
  • Does this work for other tools? — Yes: the same endpoint works in Claude Code, Cursor, Cline, and any OpenAI/Anthropic-compatible client.
ZCode 3.0 is a notable agentic IDE, but its native GLM Coding Plan subscription is quota-based: "prompts" in 5-hour windows, a ×3 multiplier during peak hours, and one parallel request on lower-tier plans. The more agentic the workload, the more expensive and unpredictable it becomes. The official BYOK solves this: connect JoinGonka Gateway as a custom provider and pay for actual tokens at Gonka decentralized network prices, hundreds of times lower than centralized APIs. GLM-5.2 is already in the network registry and will appear in your model selector automatically, whilst Kimi K2.6 and MiniMax M2.7 are working today. Start with 10M free tokens.

Want to learn more?

Explore other sections or start earning GNK right now.

Get 10M free tokens →