GLM Coding Plan: Cheap Claude-Code-Style Coding with GLM
The GLM Coding Plan is Z.ai's coding subscription — tiers Lite, Pro and Max — that plugs GLM models into agent and IDE tools you already use, including Claude Code and Cline, via an Anthropic-compatible endpoint. It is pitched as a cheap alternative to paying per token, and for high-volume coding it usually is. This guide covers what the plan actually includes, how its usage limits and per-token pricing work (with every number sourced to Z.ai's own docs), how it stacks up against a Claude subscription, and how to route GLM through a gateway when you want one key across many models. One caveat up front: Z.ai's exact tier prices are published on a JavaScript pricing page that we could not verify from a single primary source, so we flag those figures and tell you where to confirm them.
What the GLM Coding Plan is
It is Z.ai's coding subscription that streams GLM models into the agent and IDE tools you already use — a cheap, Claude-Code-shaped way to code with GLM instead of paying Anthropic prices. Rather than metering you per token, it sells a monthly allowance of coding prompts across three tiers — Lite, Pro and Max — and lets you spend them inside officially supported tools. Per Z.ai's docs the officially supported coding agents are Claude Code, Claude for IDE, OpenCode, Cursor, Cline, TRAE, Qoder, Droid, Kilo Code, Roo Code, Crush, Goose and Eigent (source).
The important design decision: because the plan exposes an Anthropic-compatible endpoint at https://api.z.ai/api/anthropic, it can pretend to be Claude to any tool that speaks Claude's API — which is why Claude Code works with almost no reconfiguration. If you arrived here searching "glm 4.6 coding plan," note that the default model the tooling now maps to is GLM-5.2; more on that below.
GLM coding-access options compared
There are three distinct ways to code with GLM — the subscription, raw per-token API, and a gateway — and they trade off price predictability against flexibility. This table is our synthesis of the options from the sources cited throughout; use it to pick a lane before you read the details.
| Access option | How you pay | Best for | Tool lock-in | Claude Code? |
|---|---|---|---|---|
| GLM Coding Plan (Lite/Pro/Max) | Flat monthly, capped by prompts | High-volume steady coding in one tool | Officially supported tools only | Yes (native endpoint) |
| GLM API (pay-as-you-go) | Per token (input/cached/output) | Bursty or occasional use, custom apps | None — any OpenAI/Anthropic client | Yes (same endpoint) |
| Via an LLM gateway | Per token, one key across providers | Multi-model apps, routing, failover | None — provider-agnostic | Yes (through the gateway) |
Options and behaviours synthesised from Z.ai docs (July 2026). The plan is restricted to officially supported tools per Z.ai's FAQ; per-token API access is not.
Tiers and usage limits
The plan meters you in prompts, not tokens — and one prompt is a whole agentic task, not a single API call. Z.ai's docs estimate that one "prompt" (one query) invokes the model roughly 15–20 times as the agent reasons, reads files and edits — which is why a modest-looking prompt budget goes a long way in real coding. Approximate published limits (all figures "approximate and subject to change," per the overview docs):
| Tier | Prompts / 5 hours | Approx. per week | Price |
|---|---|---|---|
| Lite | ~80 | ~400 | From $18/mo (vendor-reported) |
| Pro | ~400 | ~2,000 | Not cleanly verifiable |
| Max | ~1,600 | ~8,000 | Not cleanly verifiable |
There is also a promotional wrinkle worth knowing: through the end of September 2026, Z.ai's FAQ says GLM-5.2 and GLM-5-Turbo consume only 1× quota during off-peak hours under the plan, while peak hours (14:00–18:00 UTC+8) consume more (source). If your work is time-shiftable, that stretches a tier further.
Wiring GLM into Claude Code
Claude Code reads two environment variables to decide where to send requests — point them at Z.ai and it talks to GLM instead of Anthropic. Z.ai's Claude Code integration docs use the Anthropic-compatible endpoint and map the default Sonnet slot to glm-5.2:
# Point Claude Code at Z.ai's Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-z-ai-key"
# The docs map the default Sonnet model to glm-5.2
export ANTHROPIC_MODEL="glm-5.2"
claude # now runs on GLM, not Claude
The same pattern generalises: any tool that lets you override the Anthropic base URL and token — Goose, for instance, uses the identical endpoint per Z.ai's FAQ — can run on GLM. Because the endpoint mimics Anthropic's wire format, this is a close cousin of the OpenAI-compatible pattern that lets one client talk to many providers by swapping a base URL.
GLM API pricing per token
If you skip the subscription and pay per token, GLM is priced well below flagship Claude — and two GLM models are free. These are Z.ai's vendor-reported API prices from its docs pricing page (per 1M tokens, USD, July 2026):
| Model | Input | Cached input | Output | Role |
|---|---|---|---|---|
| GLM-5.2 (flagship) | $1.40 | $0.26 | $4.40 | Current default for coding |
| GLM-5 | $1.00 | — | $3.20 | General |
| GLM-5-Turbo | $1.20 | — | $4.00 | Faster tier |
| GLM-4.7 | $0.60 | — | $2.20 | Mid-tier |
| GLM-4.7-Flash | Free | Free | Free tier | |
| GLM-4.6 | $0.60 | $0.11 | $2.20 | Older mid-tier |
Vendor-reported (Z.ai docs, July 2026). Legacy GLM-4.5 was $0.60 in / $2.20 out, GLM-4.5-Air $0.20 / $1.10, GLM-4.5-X $2.20 / $8.90, and GLM-4.5-Flash was free — all now superseded by the 4.7 and 5.x lines. For where GLM lands among all coding models, see our best coding LLM guide; for the raw price race, the cheapest LLM API roundup.
Plan vs paying per token vs Claude
The subscription wins on predictable high volume; per-token wins on flexibility; Claude wins when you need its specific strengths and will pay for them. The mechanics that decide it:
- Prompt fan-out favours the plan. Since one prompt drives ~15–20 model calls, a Pro-tier week of ~2,000 prompts is tens of thousands of underlying calls. Paying per token for that same volume on a flagship model would usually cost more than a flat monthly fee — that is the plan's core value.
- Bursty use favours per-token. If you code in short spurts, a fixed subscription you barely dent is worse than metered API calls that cost nothing when idle.
- Lock-in cuts both ways. The plan only works in officially supported tools; per-token API access works in your own scripts, CI, or a gateway.
- Claude vs GLM is a capability call. On raw output price GLM-5.2 ($4.40/1M) undercuts Claude Sonnet 5 ($10) and Opus 4.8 ($25). Whether the cheaper model is good enough for your codebase is the real question — weigh it against where Sonnet and Opus each earn their price, and mind Claude's own rate limits when you scale.
GLM-4.6 vs GLM-5.2 today
If you came for "GLM-4.6," the plan still applies — but 4.6 is no longer the default; GLM-5.2 is. Z.ai's model lineup moved fast: in the July 2026 docs, GLM-5.2 is the flagship the coding tools map to, and GLM-4.6 has slid down to a lower-cost mid-tier model ($0.60 in / $2.20 out vs GLM-5.2's $1.40 / $4.40). GLM-4.6 is still a legitimate, cheaper choice if it clears your quality bar — you can pin it explicitly by setting the model name — but new coding work defaults to 5.2.
The broader lesson: this lineup renames and reshuffles quickly (the 4.5 series is already superseded), so always date and version any GLM figure and check the live model list. For an open-weights lens on where GLM and its peers sit, see our open-source LLM roundup.
Running GLM through a gateway
The subscription is deliberately locked to Z.ai's own tools — a gateway is how you get GLM alongside every other model on one key. The GLM Coding Plan is restricted to officially supported products, so you cannot point arbitrary apps at your subscription. But GLM models are also available per token through an OpenAI-compatible gateway, which is the right shape when you want provider-agnostic access, automatic routing and failover, or to run GLM in the same app as Claude and GPT. Same client, one base URL:
from openai import OpenAI
client = OpenAI(
base_url="https://www.datallmlab.com/v1",
api_key="YOUR_DATALLMLAB_KEY",
)
resp = client.chat.completions.create(
model="z-ai/glm-5.2", # swap to any of 300+ models
messages=[{"role": "user", "content": "Refactor this function..."}],
)
print(resp.choices[0].message.content)
Rule of thumb: use the GLM Coding Plan for a single-tool, high-volume coding workflow where the flat price is the whole point; use a gateway when you want GLM to be one of many models behind one key, with routing and failover doing the work.
Run GLM-5.2 next to Claude and GPT on one key
DataLLM Lab gives you GLM, Claude, GPT and 300+ more models behind one OpenAI-compatible endpoint — with automatic failover so a busy provider is never your app's ceiling.
FAQ
What is the GLM Coding Plan?
Z.ai's coding subscription that gives GLM access inside agent and IDE tools, in three tiers — Lite, Pro, Max. It works with Claude Code, Cline, Cursor, OpenCode and others via an Anthropic-compatible endpoint. Docs say it starts at $18/mo for Lite; confirm exact tier prices on z.ai/subscribe.
Does it work with Claude Code?
Yes. Set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic and ANTHROPIC_AUTH_TOKEN to your Z.ai key; the docs map the default Sonnet model to glm-5.2. Cline, Cursor, OpenCode, Goose and others are also officially supported.
Is GLM-4.6 still the coding model?
No — in the July 2026 docs GLM-5.2 is the flagship the tools default to, and GLM-4.6 is now a cheaper mid-tier model. The plan still applies; you can pin 4.6 explicitly if it meets your bar. Model names change fast, so check the live list.
How much does GLM cost per token?
Per Z.ai docs (July 2026, per 1M tokens): GLM-5.2 $1.40 in / $0.26 cached / $4.40 out; GLM-4.6 $0.60 / $0.11 / $2.20; GLM-4.7 $0.60 / $2.20; GLM-4.7-Flash and GLM-4.5-Flash free. Vendor-reported, separate from the subscription.
Plan or pay-per-token — which is cheaper?
For steady high-volume coding the plan usually wins, since one prompt fans out to ~15–20 model calls and you're capped on prompts, not tokens. For occasional or bursty use, per-token avoids a fixed fee. Per-token also works anywhere; the plan is tool-locked.
What are the usage limits?
Approximate, per Z.ai docs: Lite ~80 prompts/5h (~400/week), Pro ~400/5h (~2,000/week), Max ~1,600/5h (~8,000/week). One prompt is one query that invokes the model ~15–20 times. Figures are approximate and subject to change.
Can I use it through a gateway?
The subscription is locked to Z.ai's supported tools and its Anthropic endpoint. But GLM is available per token through an OpenAI-compatible gateway, letting you run it alongside Claude and GPT on one key with routing and failover.
DataLLM Lab