The setup takes two minutes. The part worth reading is the quota, because "80 prompts per 5 hours" does not mean what you think, and that gap is why people hit limits on day one and conclude the plan is broken.
Z.ai ships an Anthropic-compatible endpoint, so Claude Code works against GLM with no proxy and no extra software. That part is genuinely easy.
Setup
Edit ~/.claude/settings.json and set two values in the env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "your-z-ai-key"
}
}
That is the whole configuration. Use settings.json rather than shell exports, because exports die with the terminal and you will be retyping them after every reboot. We covered why, and the two permanent alternatives, in the OpenCode Go setup post; the mechanism is identical here.
Plan tiers
| Tier | Price | Prompts per 5h | Per week |
|---|---|---|---|
| Lite | around $18/mo | ~80 | ~400 |
| Pro | around $72/mo | ~400 | ~2,000 |
| Max | around $160/mo | ~1,600 | ~8,000 |
Tier pricing is quoted inconsistently across sources, with the entry tier reported anywhere from $10 to $18 depending on the page and billing period, so confirm the current figure at source before subscribing. Quarterly and annual billing carry discounts.
The quota math
Here is the part that catches people.
One prompt is defined as one user query. But a single prompt may invoke the model 15 to 20 times behind the scenes, because an agentic run reads files, calls tools, evaluates output and iterates. You type one thing; the plan counts one prompt; the model runs twenty times.
That is fine, since the quota is denominated in prompts rather than calls. What is not obvious is the multiplier on top.
GLM-5.2 and GLM-5-Turbo consume 3x quota during peak hours (14:00 to 18:00 UTC+8) and 2x off-peak. So Lite's 80 prompts per 5 hours becomes roughly 27 during peak. A limited-time promotion has been reducing off-peak consumption to 1x, but promotions end, and building a workflow on one is how you get surprised.
If you are in Europe, peak hours land in your morning. Worth knowing before you plan a working day around it.
Is the model good enough
Reasonably, and the honest answer has shape rather than a verdict.
On the hardest agentic benchmarks Claude Opus 4.8 leads: 69.2% versus 62.1% on SWE-bench Pro, and 85.0% versus 81.0% on Terminal-Bench 2.1. That is a real gap on genuinely hard multi-file work.
On other measures the gap nearly disappears. FrontierSWE puts them within 0.7 points, MCP Atlas within 0.8, and on both of those GLM is marginally ahead. Token pricing is roughly one sixth of a closed frontier model.
The reading that follows from the numbers: GLM is not a downgrade for most work, and it is a downgrade for the hardest work. Which describes your week is the actual question.
Note also that GLM-5.3 landed on 14 August 2026 and shipped a quota redesign, so any figures written before that date describe a different plan.
Who this is for
Take it if you are cost-sensitive, work mostly on ordinary application code, and can schedule heavy sessions outside peak hours. At roughly $18 against $100 to $200 for a Max-tier Claude subscription, the arithmetic is not close.
Skip it if your work is the hard multi-file kind where the benchmark gap is real, if you cannot tolerate quota uncertainty mid-task, or if you need a single tool that never makes you think about which hours you are working in.
A note on support boundaries. Anthropic's own documentation states it does not support routing Claude Code to non-Claude models through any gateway. This setup works, but it is outside the supported path, and when a Claude Code release changes something, nobody owes you a fix. For the full map of options and where each one breaks, see how to run Claude Code on a cheaper model.
FAQ
How do I use GLM with Claude Code?
Set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic and ANTHROPIC_AUTH_TOKEN to your Z.ai key, both inside the env block of ~/.claude/settings.json. No proxy or extra software is required, because Z.ai exposes an Anthropic-compatible endpoint. Use the settings file rather than shell exports so the configuration survives reboots.
How much does the GLM Coding Plan cost?
The entry Lite tier is commonly listed at around $18 per month, with Pro near $72 and Max near $160. Published figures vary noticeably between sources and billing periods, so confirm the current price at Z.ai directly. Quarterly and annual billing carry discounts.
What are the GLM Coding Plan rate limits?
Lite allows roughly 80 prompts per 5-hour window and 400 per week, Pro roughly 400 and 2,000, and Max roughly 1,600 and 8,000. Crucially, GLM-5.2 and GLM-5-Turbo consume 3x quota during peak hours of 14:00 to 18:00 UTC+8 and 2x off-peak, so effective limits are much lower than the headline numbers.
Why do I hit GLM rate limits so quickly?
Usually because of the peak-hour multiplier rather than the prompt count. During peak hours each prompt consumes 3x quota, which turns Lite's 80 prompts into roughly 27. A single prompt also triggers 15 to 20 model invocations behind the scenes during agentic work, so long autonomous runs consume quota faster than short exchanges.
Is GLM good enough to replace Claude for coding?
For most application work, yes. Claude Opus 4.8 leads on the hardest agentic benchmarks at 69.2% versus 62.1% on SWE-bench Pro, but on FrontierSWE and MCP Atlas the two are within one point of each other, with GLM marginally ahead. At roughly one sixth of the token cost, the trade favours GLM unless your work is consistently at the difficult end.
