The GLM-5.4 API is open: how do you try the model that thinks in two passes?

The API for GLM-5.4, Z.ai's first loop transformer, is open; the pretrained GLM-5 base was converted through continued training, at GLM-5.3 prices.

Paylaş
The GLM-5.4 API is open: how do you try the model that thinks in two passes?

The usual way to make an AI model smarter is to make it bigger: more layers, more parameters, more memory. With its new flagship GLM-5.4, China's Z.ai is trying something else. The model runs part of its layers twice for the same answer. The parameter count stays the same, but the model passes through a deeper path to think. Z.ai calls the design a Loop Transformer and presents GLM-5.4 as its first large model built on it.

The model opened on November 23 to Z.ai's GLM Coding Plan subscription, the ZCode app and chat.z.ai. On December 2 the API followed: GLM-5.4 can now be called through api.z.ai and partner platforms. Per Z.ai's pricing page, the price stays the same as GLM-5.3. GlobalFeed covered the model's first release on November 23; with the API open, it is now available to anyone building it into their own app.

Why it matters: deeper without growing

In a standard transformer, each layer runs once per step. In a loop transformer, a group of layers sharing the same weights runs several passes in a row, each refining the internal representation from the last. Think of the same editor reading a draft twice: no one new joins the team, but the second read builds on the notes from the first.

Z.ai's reasoning: knowledge-heavy tasks benefit from more parameters, while reasoning-heavy tasks benefit from more computation. For work that needs very long chains of thought, such as large software projects, cybersecurity, 3D modeling or physical control, adding parameters alone is not enough. Z.ai says GLM-5.4 reaches intelligence comparable to 2 to 3 trillion parameter models this way; it has not yet published a detailed benchmark table for that claim.

How the model was trained

The idea is not new. Z.ai's post cites the 2018 Universal Transformer, which first tried weight-shared depth, and later work on looped language models. The core problem, per the post: looped models trained from scratch fall behind ordinary models trained with the same pretraining compute. So Z.ai did not start from scratch. It took the already pretrained GLM-5 base and converted it into a looped design through continued training, which the company says raises the ceiling at relatively low compute cost. In GLM-5.4, 28 layers of the base run two passes; Z.ai describes the model's scale as "750B".

The post says the team scaled loop depth and model size in parallel over the past three months, validating the design on 1B, 4B, 30B and 750B bases. Three problems came up along the way, each with its own fix.

1. Gated progressive updates. When the middle layers of an existing model are put into a loop, writing each pass's output directly over the previous one did not work: internal signal sizes grew from pass to pass, and later layers received data at scales they were not used to. Z.ai added separate, per-token "gates" for each pass that decide how much of the new update is written to the main stream. After training, a division of labor emerged: the first pass builds global context and writes cautiously with small gate values, while the second pass refines the result and opens the gates for a full update. The gates also adjust step size to token difficulty, with the first pass acting more boldly on hard tokens.

2. Hybrid cache. Keeping a full, separate memory cache for every pass would multiply memory by the loop count. In Z.ai's design, the second pass reuses the sparse cache selected in the first pass and keeps its own new information only in a short sliding window. An extra pass therefore adds only one window's worth of cache. The company says that even at a 1-million-token context, the extra deployment cost over GLM-5.3 stays under control.

3. Reusing attention indices. The base model uses sparse attention, where each token looks only at the important places in a long text, chosen by a separate indexer. The second pass reuses the indices from the first pass, adding no indexing overhead. Z.ai writes that recomputing them every pass gives nearly identical results. For speed, kernel fusion cuts reads and writes to intermediate memory.

Z.ai did not disclose the amount of continued-training data, the step count or details of its reinforcement learning stages. The only published numbers come from a 30-billion-parameter test model with the same architecture as the large one. With the same parameter count and only about 10 percent more total training compute, the chart on Z.ai's blog shows the looped version rising from 19.17 to 30.42 on AIME25, from 47.58 to 56.26 on GPQA-Diamond, from 40.33 to 47.67 on the long-context test AA-LCR and from 71.65 to 75.05 on MMLU-Pro. Another finding: on most tests the model writes 10 to 14 percent shorter answers, which Z.ai reads as part of the thinking moving from written steps into the hidden depth of the loop. These figures belong to the 30B test model; GLM-5.4's own benchmark table has not been published yet.

What it can do

GLM-5.4 reads text, images, video and files, with a 1-million-token context window and up to 128K tokens per answer. Z.ai says it sees coding as the base for wider work and calls this "generalized coding". Its examples include a music video produced through code, a six-axis robot arm designed in FreeCAD, a full game with character movement, physics and a combat system, and an interactive 3D scene built with GLSL shaders. By Z.ai's measurement, speed is 200 tokens per second under light load and 70 to 80 at peak hours.

Z.ai also states a limit openly: the model can sometimes enter very long "marathon thinking" loops. The company says this long thinking and self-correction still improves accuracy.

How to try it

The API model name is glm-5.4. Per Z.ai's pricing table, it costs 1.40 dollars per million input tokens, 0.26 dollars for cached reads and 4.40 dollars for output, the same as GLM-5.3. The documentation recommends keeping thinking mode on and setting reasoning_effort to "max". On the Coding Plan, GLM-5.4 uses fewer credits and the weekly quota rises 1.5 times. The model works with coding agents such as Claude Code, Codex, Cline and OpenCode, and the setup page walks through the Claude Code settings.

The model files have not been released yet. Z.ai says it plans to open them after completing the necessary safety work, without giving a date. The files of the previous version, GLM-5.3, appeared on Hugging Face about a week after its launch. The company closes its post saying its next, significantly larger model will be ready soon.

Sources: Z.ai blog, GLM-5.4 docs, Pricing, Coding Plan setup