GLM-5.4 is out: how to use it in Claude Code, what it costs, and what Z.ai hasn't published
Z.ai's GLM-5.4, a 750B Loop Transformer model, is open to developers only through the GLM Coding Plan for now (plus Z.ai Chat and ZCode): no public API, no open weights yet. It uses two-thirds of GLM-5.3's credits per token, and Claude Code can use it with a few settings.
Z.ai released GLM-5.4 on November 23, 2026. It is the company's first flagship built on a Loop Transformer: a 750B model that runs 28 layers of the GLM-5 base twice per forward pass, which Z.ai says puts it at the level of 2T-3T parameter models. For now, developers can use it only through the GLM Coding Plan; it is also in Z.ai Chat and Z.ai's ZCode editor. The model API opens "upon completion of the security assessment", and the weights will be open-sourced later, with no date for either.
That shapes the three things people are searching for. Pricing: there is no per-token API price yet, only Coding Plan credits, and GLM-5.4 uses two-thirds of GLM-5.3's credits per token. Benchmarks: Z.ai has not published a benchmark table for GLM-5.4 itself, only an ablation on a 30B model. Hugging Face: there are no GLM-5.4 weights to download yet.
Quick facts
- Released: November 23, 2026, by Z.ai.
- Architecture: Loop Transformer, 750B scale; 28 layers of the GLM-5 base looped for two iterations.
- Context: 1M tokens; maximum output 128K tokens.
- Input: video, image, text and file. Output: text.
- Speed: up to 200 tokens/s off-peak and 70-80 tokens/s at peak load, according to Z.ai.
- Access: all GLM Coding Plan tiers (Lite, Pro, Max), plus Z.ai Chat and ZCode. Model API and open weights: announced, not dated.
- Known issue, in Z.ai's own words: it tends to get caught in overly long "marathon thinking" loops.
How to use GLM-5.4 in Claude Code
You need an active GLM Coding Plan and a Z.ai API key created under the plan, then three changes in ~/.claude/settings.json: point Claude Code at Z.ai's Anthropic-compatible endpoint, map the model slots to glm-5.4[1m], and raise the auto-compact window to 1M. Z.ai's guide says to add or update only these keys, not replace the whole file.
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "<your Z.ai API key>",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.4[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.4[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.4[1m]",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"API_TIMEOUT_MS": "3000000"
}
}The [1m] suffix turns on the 1M context. If Claude Code says a model with that suffix does not exist, Z.ai's fix is to upgrade Claude Code. Open a new terminal, run claude, then type /status: the settings source should be your ~/.claude/settings.json and the model should read glm-5.4 or glm-5.4[1m]. Z.ai's longer Claude Code guide keeps the cheaper glm-5.3-flash[1m] in the Haiku slot, which costs fewer credits on Haiku-slot calls (Flash is 2.3 / 0.56 / 8).
Thinking depth follows Claude Code's /effort command. Z.ai maps low and minimal to low, medium and high to high, and xhigh, max and ultra to max; the default is max, and turning thinking off still runs lightweight thinking at low. Z.ai recommends max for coding. Given the marathon-thinking warning, dropping to high for simple edits is the obvious lever to try.
Other tools use different endpoints: Codex uses https://api.z.ai/api/v1, and other OpenAI-compatible tools use https://api.z.ai/api/coding/paas/v4 with the custom model name glm-5.4.
What GLM-5.4 costs on the Coding Plan
The plan starts at 18 US dollars a month. Each tier has a five-hour limit and a weekly limit, counted in credits. A request costs (input tokens x input multiplier + cached input tokens x cached multiplier + output tokens x output multiplier) / 10,000. Off-peak usage is charged at 50%; peak hours are Monday to Friday, 14:00-18:00 Singapore time (06:00-10:00 UTC).
| Model | Input | Cached input | Output | Credits per 1M input / cached / output |
|---|---|---|---|---|
| GLM-5.4 | 4.6 | 1.1 | 16 | 460 / 110 / 1,600 |
| GLM-5.3 | 6.9 | 1.7 | 24 | 690 / 170 / 2,400 |
| Plan | Credits per 5 hours | Credits per week |
|---|---|---|
| Lite | 2,000 | 10,000 |
| Pro | 12,000 | 60,000 |
| Max | 28,000 | 140,000 |
The newer model is cheaper per token: its input and output multipliers are exactly two-thirds of GLM-5.3's, which matches Z.ai's statement that weekly-quota users get 1.5x as much GLM-5.4 as GLM-5.3. To make that concrete, we priced one typical agent turn: 200,000 tokens of context, 95% of it served from cache, and 5,000 output tokens. On GLM-5.4 that is 33.5 credits; on GLM-5.3, 51.2.
On Lite, that works out to about 59 such turns per five-hour window at the peak rate and about 119 off-peak, and about 298 per week at the peak rate. Pro's weekly allowance covers about 1,790 at the peak rate. Long thinking burns output tokens at 16 credits per 10,000, so a model that over-thinks will reach these limits sooner than the arithmetic suggests. These figures are our arithmetic from Z.ai's published multipliers, not measured usage.
Benchmarks: what Z.ai did and did not publish
The launch post has no benchmark table for GLM-5.4. The only numbers come from a controlled test on a 30B model with the same architecture as the 750B base: same parameter count, about 10% more training compute, with and without the loop. The looped version scored higher on all five tests, with the biggest gains on math, science and long-context tasks, and wrote 2-15% fewer tokens (10-14% on most tests).

That shows the loop helps at 30B. It does not tell you how GLM-5.4 compares with GLM-5.3, Claude or GPT on coding work, and the "2T-3T parameter" comparison is Z.ai's own claim, not yet independently reproduced. Several Hacker News commenters questioned the lack of benchmarks in the launch post.
How the loop works, briefly
A normal Transformer runs each layer once per token. GLM-5.4 runs a block of weight-shared layers twice, refining the first pass. Instead of training a looped model from scratch, Z.ai converted its pre-trained GLM-5 base through continued training. Three changes keep it cheap enough to serve: per-token gates that control how much each pass writes back, a KV cache where the second pass reuses the first pass's cache plus a sliding window of its own, and reuse of the first pass's sparse-attention indices. Z.ai says the extra loop costs one sliding window of KV cache rather than a full context cache.
Try it with your AI. Paste this into Claude Code (or any coding agent) to set up GLM-5.4 safely and check it is actually being used.
Help me switch this Claude Code install to Z.ai's GLM-5.4 on my GLM Coding Plan. First,
run claude --version and tell me the version; if it is old, tell me to run claude update
and stop. Then show me my current ~/.claude/settings.json with any API keys masked.
Propose, but do not write yet, a change that only adds or updates these env keys:
ANTHROPIC_BASE_URL = https://api.z.ai/api/anthropic, ANTHROPIC_DEFAULT_OPUS_MODEL and
ANTHROPIC_DEFAULT_SONNET_MODEL = glm-5.4[1m], ANTHROPIC_DEFAULT_HAIKU_MODEL = ask me
whether to use glm-5.4[1m] or glm-5.3-flash[1m], CLAUDE_CODE_AUTO_COMPACT_WINDOW =
1000000, API_TIMEOUT_MS = 3000000. Keep every other field, and never delete or recreate
the file. Before saving, copy it to settings.json.bak. Do not write my API key into any
file yourself; tell me where I paste it (ANTHROPIC_AUTH_TOKEN). Show me the diff and
wait for my confirmation before saving. Afterwards, tell me to paste my key, open a new
terminal, run claude and /status, and check that the model shows glm-5.4.Known limits
- No public API yet: GLM-5.4 is not on Z.ai's regular API (the blog lists it as coming soon), and Simon Willison noted on Hacker News that it was not on OpenRouter either; he switched to the Coding Plan to reach it.
- No weights yet: Z.ai says it will open-source them after safety hardening, with no date.
- Marathon thinking: Z.ai says the model tends to run overly long reasoning loops. One Hacker News commenter said they keep Chinese coding-plan models for background tasks for this reason.
- Speed depends on the hour: 70-80 tokens/s at peak against up to 200 off-peak, by Z.ai's figures.
- Using Claude Code with a third-party endpoint sends your code and prompts to Z.ai, not Anthropic; check that this is allowed for the repository you work in.
FAQ
How much does GLM-5.4 cost? There is no per-token API price yet. On the GLM Coding Plan (from 18 US dollars a month) it costs 4.6 credits per 10,000 input tokens, 1.1 per 10,000 cached tokens and 16 per 10,000 output tokens, two-thirds of GLM-5.3's rate, and half that off-peak.
Is GLM-5.4 on Hugging Face? Not yet. Z.ai says the weights will be released after safety hardening and has not given a date.
Where are the GLM-5.4 benchmarks? Z.ai has only published a 30B-model ablation of the loop architecture. The launch post has no benchmark table for GLM-5.4 itself; the model guide shows a win-rate chart without a published method.
Can I use GLM-5.4 in Claude Code? Yes, with a GLM Coding Plan key: set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic and the model slots to glm-5.4[1m], then confirm with /status.
What context length does GLM-5.4 support? 1M tokens, with up to 128K output tokens. In Claude Code, use the [1m] suffix on the model name and set CLAUDE_CODE_AUTO_COMPACT_WINDOW to 1000000.
Is GLM-5.4 on OpenRouter or the regular Z.ai API? Not yet. The launch post lists the API as coming soon, and Simon Willison reported on Hacker News that he had to switch to the Coding Plan to reach it.
How fast is GLM-5.4? Z.ai quotes up to 200 tokens/s off-peak and 70-80 tokens/s at peak load. Peak hours are Monday to Friday, 14:00-18:00 Singapore time, when credits are also charged at the full rate.
How many tokens does the Lite plan give on GLM-5.4? Z.ai estimates 72-146 million tokens a week at a 95% cache hit rate; the low end assumes all peak-hour use, the high end all off-peak.
Related on claudefox
- Hugging Face Inference Providers now route through OpenRouter: what changes for your code, keys and Claude Code
- OpenRouter says MiniMax prompts may have been read: what the Dragos canary study found
- OpenRouter pulls 125 endpoints from ZDR as Together AI, Novita and Phala disclose prompt leaks
- New BIS rule targets remote access to AI chips and adds license requirements for Singapore, Malaysia and three more countries
Source: Z.ai blog: GLM-5.4, Toward Generalized Coding with Our First Loop Transformer (November 23, 2026), Z.ai docs: GLM-5.4 model guide, Z.ai docs: GLM Coding Plan overview (credits and multipliers), Z.ai docs: Switching to the latest model, Z.ai docs: Claude Code with the GLM Coding Plan, Hacker News discussion of the GLM-5.4 launch
This story first appeared in the claudefox daily briefing for November 24, 2026.