You're halfway through a refactor when Claude Code stops and tells you to wait for your limit to reset. Again. Someone on a forum says to point Claude Code at GLM instead: same terminal, same commands, a plan from $18 a month.
That part is true. Z.ai's GLM Coding Plan includes an Anthropic-compatible endpoint, and Claude Code talks to it once you set two environment variables.
What the forum post skips is how fast the plan's credits go. One setting in Z.ai's own sample config decides whether the cheapest plan lasts an afternoon or about 20 model calls. We'll get to it, along with the key mix-up that bills your card instead of your plan.
Prices, limits and setup steps checked against Z.ai's subscription page and docs, Anthropic's Claude Code docs and claude.com/pricing on 4 November 2026. This guide is written from those docs. We didn't run a benchmark or a week of real work on the plan; every usage figure is arithmetic on Z.ai's published formula.
What you'll have at the end
Claude Code, running in your terminal as usual, sending its requests to GLM-5.3 on Z.ai's servers instead of to Anthropic. Your saved Claude login stays on the machine, unused while the GLM settings are active, so you can switch back per project.
The same subscription also works in the other agents Z.ai lists as supported, including Cline, Kilo Code, OpenCode, Cursor and Codex. They all draw from one shared quota. If you're new to Claude Code itself, start with our Claude Code beginner's guide, then come back here.
What the GLM Coding Plan costs
Three tiers, priced in US dollars. Paying for a quarter takes 20% off and a year takes 30% off; the cards then show the discounted monthly rate.
| Plan | Monthly | Quarterly (per month) | Yearly (per month) | Credits per 5 hours | Credits per week |
|---|---|---|---|---|---|
| Lite | $18 | $14.40 | $12.60 | 2,000 | 10,000 |
| Pro | $80 | $64 | $56 | 12,000 | 60,000 |
| Max | $168 | $134.40 | $117.60 | 28,000 | 140,000 |
Every plan gets the same two models, GLM-5.3 and the cheaper GLM-5.3-Flash. Paying more buys volume and a few extras: Pro has "faster generation speeds", Max "dedicated resources during peak times".
Concurrency scales too. Z.ai's usage policy recommends Lite for "a single project at a time" and Max for two or more.
Both limits apply at once. The 5-hour credits refill five hours after you use them, and the weekly credits reset every 7 days from the day you subscribed.
Run out and you wait. Z.ai's FAQ says the plan "will not deduct from your account balance" when the quota is gone.
What does a credit actually buy?
This is the part most write-ups skip, and it decides which tier you need. Z.ai publishes the formula, so you can do the sums yourself.
For GLM-5.3, one model call costs (fresh input tokens × 6.9 + cached input tokens × 1.7 + output tokens × 24) ÷ 10,000 credits. GLM-5.3-Flash uses 2.3, 0.56 and 8, about a third of the cost.
Say Claude Code sends a request carrying 100,000 tokens of context, 95% of it cached from the previous turn, and gets 2,000 tokens back. That's a hypothetical but ordinary mid-session call. It costs 24.4 credits at the standard rate.
Lite's 2,000 credits per 5 hours covers about 82 of those calls. Its 10,000 weekly credits cover about 410.
And a call is not a prompt. Claude Code sends a new request after each batch of tool results. Z.ai's notes on its older plans said one prompt "is estimated to invoke the model 15–20 times".
On that estimate, 82 calls is four or five real tasks per 5-hour window on Lite. Pro's 12,000 credits stretch the same maths to about 490 calls.
The setting that quietly multiplies the bill
Here's the setting promised at the top. Z.ai's sample Claude Code config sets CLAUDE_CODE_AUTO_COMPACT_WINDOW to 1000000.
So the conversation can grow toward a million tokens before Claude Code compacts it. And Anthropic's docs say Claude Code "sends your full conversation with every request".
At 500,000 tokens of context, the same call costs about 103 credits. Lite's 5-hour window then lasts roughly 19 calls, which can be a single prompt.
On Lite, set the window lower. Anthropic accepts values from 100,000 to 1,000,000; at 200000, our example call tops out around 44 credits instead of 100-plus. Running /compact yourself between tasks does the same job.
Peak hours cost double
Z.ai charges off-peak usage at 50% of the standard rate. Peak is Monday to Friday, 14:00 to 18:00 Singapore time (UTC+8).
That's 06:00 to 10:00 UTC, 11:30 to 15:30 in India, and 1 to 5 in the morning on the US East Coast in winter. American developers barely notice it.
In Singapore, India or Europe it lands in the middle of the working day, and anything you run then costs double. Weekends are outside the peak window.
Is it good value anyway? On the pay-as-you-go API, GLM-5.3 costs $1.40 per million input tokens, $0.26 cached and $4.40 output. Our 100,000-token call would cost about 4 cents.
A month of Lite's allowance, spent on those calls, is worth about $72 at API rates if you only work at peak. Never at peak, about $144. So $18 buys 4x to 8x what it would on the Z.ai API for that kind of call.
How to connect Claude Code to GLM
You need a GLM Coding Plan subscription, a Coding Plan API key, and Claude Code installed. Five steps.
- Install Claude Code. Anthropic's recommended route is the native installer:
curl -fsSL https://claude.ai/install.sh | bashon macOS, Linux or WSL. Z.ai's page still shows the npm package with "Node.js 18 or newer", but Anthropic now says the npm package "requires Node.js 22 or later". Follow Anthropic. - Subscribe and create the right key. After subscribing to a GLM Coding Plan, create the key under API Keys → Personal Coding Plan. Not under Standard API Key. More on why in the mistakes section.
- Add the settings. Put an
envblock in a Claude Code settings file (which file matters, see the next section). - Start Claude Code in a new terminal with
claude. If it asks "Do you want to use this API key", answer yes. - Check it took. Run
/status. The model line should nameglm-5.3and the auth line should showANTHROPIC_AUTH_TOKEN, not your claude.ai account.
Here's the block Z.ai publishes for manual setup:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1,
"API_TIMEOUT_MS": "3000000"
}
}
Each line has a job. ANTHROPIC_BASE_URL sends requests to Z.ai, and ANTHROPIC_AUTH_TOKEN carries your key as a bearer token.
The three model variables set what the opus, sonnet and haiku aliases mean. Haiku also runs Claude Code's background work, so pointing it at Flash saves credits. The [1m] suffix asks for GLM's 1M-token context.
The timeout is 3,000,000 ms, 50 minutes, against Claude Code's default of 10 minutes. That's for slow responses through a third-party endpoint. Change the compact window to suit your plan, as covered above.
One oddity on that page. The list at the top says the default maps all three aliases to GLM-5.3-Flash, while the manual block maps opus and sonnet to GLM-5.3. If you use Z.ai's helper (npx @z_ai/coding-helper) or install script, run /status afterwards to see which model you actually got.
Effort works too. Z.ai says GLM defaults to max thinking, and you can change it with /effort in the session.
Keep your Claude subscription for other projects
Z.ai tells you to edit ~/.claude/settings.json. Anthropic's docs describe that file as applying to "you, in every project on this machine". Put the GLM block there and every project you open runs on GLM.
If you want GLM for some work and Claude for the rest, you have two cleaner options from Anthropic's docs:
- Put the
envblock in.claude/settings.local.jsoninside one project. It applies to "you, in this one project only", and Claude Code keeps it out of git when it creates the file itself. - Save the block as a separate file, say
~/glm.json, and launch withclaude --settings ~/glm.json. Values in that file override your normal settings for that session only.
Two precedence rules save some head-scratching. A settings-file env value beats a shell export of the same variable. And while ANTHROPIC_AUTH_TOKEN is set, it takes over immediately from your saved claude.ai login; remove it and Claude Code goes back to your subscription.
What changes when Claude Code isn't talking to Claude
Most of Claude Code works the same, because it's the same program. Your CLAUDE.md files, permissions, hooks, skills and MCP servers load from disk, not from the model. A few things do change.
- Anthropic doesn't support it. Its gateway docs say Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway". If something breaks, Z.ai's support is who you ask.
- Remote Control and voice dictation switch off. Both need your claude.ai identity, and Anthropic's docs say they're unavailable while
ANTHROPIC_AUTH_TOKENis active. - The model is different. How well GLM-5.3 handles Claude Code's tool calls on your codebase is something to check on your own tasks, not take from either company's charts. Our GLM-5.3 vs Opus 5 vs Gemini 3.8 Flash comparison covers what the published benchmarks do and don't say.
- GLM-5.3 doesn't read images. Z.ai's Cline guide calls it "a text-only model"; GLM-5.3-Flash is the multimodal one. For screenshots in Claude Code, Z.ai offers a Vision MCP server on every plan.
That last point is worth a minute. Every plan also includes Z.ai's Web Search, Web Reader and Zread MCP servers, billed at 1.2 credits per call. If MCP is new to you, our plain-English MCP explainer covers how those servers plug into an agent.
Using the plan in Cline, Kilo Code, OpenCode and Cursor
Claude Code uses Z.ai's Anthropic-style endpoint. Most other agents use the OpenAI-style one, and the two are not interchangeable. Z.ai warns that the wrong endpoint means the tool can't use your plan quota.
| Agent | Where you set it | Endpoint |
|---|---|---|
| Claude Code | env block in a settings file | https://api.z.ai/api/anthropic |
| Cline | Provider: OpenAI Compatible, custom model | https://api.z.ai/api/coding/paas/v4 |
| Kilo Code | Provider: Z AI, entrypoint "International Coding Plan" | https://api.z.ai/api/coding/paas/v4/ (shown in the entrypoint option) |
| OpenCode | opencode auth login, pick "Z.AI Coding Plan" | Set by that provider choice (Z.ai's page doesn't list a URL) |
| Cursor | Models → Add Custom Model, OpenAI protocol, override base URL | https://api.z.ai/api/coding/paas/v4 |
| Codex | ~/.codex/config.toml, wire_api = "responses" | https://api.z.ai/api/v1 |
Some of Z.ai's tool pages still use the older model name glm-5.2 in their examples. Its overview says those requests are "automatically routed to GLM-5.3", but typing glm-5.3 avoids the guesswork. In Cursor, Z.ai says the name must be uppercase, like GLM-5.3.
Cursor has two catches of its own, from Cursor's help pages. Your own key works "only with chat models", so Tab completion stays on Cursor's models. And requests with your key still go "through Cursor's servers for final prompt building", so your Z.ai key travels with them.
GLM Coding Plan vs Claude Pro and Max
On sticker price, each GLM tier sits a little below a Claude plan.
| Budget | GLM Coding Plan (monthly) | Claude plan | How Claude describes its limit |
|---|---|---|---|
| Entry | Lite, $18 | Pro, $20 monthly or $17 a month yearly | "More usage than Free, every 5 hours and every week" |
| Daily driver | Pro, $80 | Max, $100 | "5x Pro usage every 5 hours and every week" |
| All day | Max, $168 | Ultra, $200 | "No 5-hour limit" for verified accounts, "10x Pro usage every week" |
You're probably wondering which gives more coding per dollar. Nobody can tell you that from the public pages, and anyone who claims to is guessing.
Z.ai publishes credits, multipliers and a formula. Anthropic publishes multiples of its Pro plan and says "there's no fixed message count". There's no shared unit.
What you can say is that Z.ai's limits are predictable, and its prices undercut Claude's at each step by $2 to $32 a month.
The Claude plans also carry things GLM doesn't: Anthropic's own models and the Claude apps. Max and Ultra add $100 or $200 a month in API credits.
If you need Opus-level reliability on hard problems, our Claude Fable 5.1 vs Opus 5 breakdown explains what the top models cost per token.
There's a middle route. Keep Claude Pro for the hard tasks and add GLM Lite for routine work, switching per project with the settings files above. That's $38 a month, and you're never stuck waiting on one company's reset clock.
Mistakes that burn credits or money
Each of these comes straight from Z.ai's or Anthropic's docs, and each one costs you credits, money or the account.
- Using a Standard API key. Since 16 October 2026, Z.ai manages Standard keys and Coding Plan keys separately. A Standard key in Claude Code "does not consume your Coding Plan quota, even if you have a subscription" and may bill your balance pay-as-you-go. If you see "1113 Insufficient Balance" after subscribing, Z.ai's FAQ points to the tool, the endpoint or the model name; since the key split, check the key type too.
- Using the plan in a tool Z.ai doesn't list. The plan is "strictly limited" to its supported tools. A custom script calling the endpoint is outside the rules, and the usage policy says accounts with "more than three violations may be banned". Sharing one subscription between people is prohibited too.
- Leaving the compact window at 1M on Lite. Covered above: large contexts make each call several times more expensive.
- Working through peak hours without noticing. If you're in Asia or Europe, move long agent runs outside 06:00 to 10:00 UTC on weekdays.
- Expecting a refund or a quick downgrade. Subscriptions are non-refundable. Moving from monthly to yearly on the same tier doesn't replace your current plan; it starts after it ends. Z.ai's FAQ says to cancel 24 hours before renewal, and its usage policy says 3 days. Go with 3 days.
Which plan should you pick?
Use Claude Code a few hours a week and keep hitting Claude Pro's 5-hour limit? Try GLM Lite on one project with .claude/settings.local.json, lower the compact window and watch the credits for a week. You'll know quickly whether GLM-5.3 handles your code.
If you code with an agent most of the day, Lite will run dry. Pro at $80 is the GLM tier sized for that, and it's $20 under Claude Max. Pay monthly first: the plan is non-refundable, and the yearly 30% off only helps if you stay.
And if your work is the kind where a wrong answer costs hours, stay on Claude for that work. A cheaper model that needs three retries isn't cheaper. Our guide on how to choose an LLM has a one-afternoon test you can run on both before you commit.



