News
GLM-5.4 API Explained: Specs, Win Rates, Loop Transformer Architecture, and Release Progress
GLM-5.4 is Z.ai's first Loop Transformer flagship model, supporting video, image, text, and file input with a 1M context. This article covers the specs, official win rates, architecture highlights, and API release progress, plus code for integrating GLM-5.3 today.
On this page
GLM-5.4 is the new flagship model released by Zhipu Z.ai in November 2026, and the first Z.ai flagship model built on the Loop Transformer architecture. It runs the 28 layers of the GLM-5 base twice, deepening reasoning without adding parameters, and the official claim is that its intelligence approaches that of 2T–3T parameter models. Input expands from text alone to video, images, text, and files, with a 1M context and 128K maximum output.
GLM-5.4 is already available to all GLM Coding Plan users, and the pay-as-you-go Model API will open after safety evaluation is complete. If you want to bring Zhipu's latest generation of capabilities into your product now, you can start with the same series' GLM-5.3; the code below is ready to run.

GLM-5.4 specs at a glance
Comparison with the previous generation GLM-5.3 (sources: Z.ai official documentation GLM-5.4, GLM-5.3).
| Item | GLM-5.4 | GLM-5.3 |
|---|---|---|
| Input | Video, image, text, file | Text |
| Output | Text | Text |
| Context length | 1M | 1M |
| Maximum output | 128K tokens | 128K tokens |
| Architecture | Loop Transformer: the 28 layers of the GLM-5 base run twice | Same base as GLM-5.2; improvements come from post-training |
| Scale | Based on a 750B-scale base; intelligence approaching 2T–3T parameter models | — |
| Thinking mode | Supported | Always on, with low / high / max levels |
| Streaming, function calling, context caching, structured output | Supported | Supported |
| Generation speed | Up to 200 tokens/s off-peak, 70–80 tokens/s at peak | — |
The biggest change is on the input side: GLM-5.3 handles only text, while GLM-5.4 can read video, images, and files directly. Context and maximum output remain 1M and 128K, so how you work with long documents and large codebases does not need to change.
Win rates: wins more than half against GLM-5.3
Z.ai published head-to-head win rates for GLM-5.4 against three models:
| Opponent | GLM-5.4 wins | Ties | Losses |
|---|---|---|---|
| GLM-5.3 | 51.1% | 25.7% | 23.1% |
| Kimi K3.1 Pro | 41.8% | 26.9% | 31.3% |
| DeepSeek-V4.1-Flash-1017 | 36.6% | 30.2% | 33.2% |

Against the previous generation GLM-5.3, GLM-5.4's win rate is more than double its loss rate. Against Kimi K3.1 Pro and DeepSeek-V4.1-Flash-1017, the win rates are also higher than the loss rates.
How the Loop Transformer works
In an ordinary Transformer, each layer runs only once per forward pass. A Loop Transformer lets a group of layers with shared weights run multiple times, with each pass continuing to refine the previous result. The network gets deeper while the parameter count stays the same.

GLM-5.4 was not trained from scratch; it continues training on the pretrained GLM-5 base and is restructured into a loop. There are three key changes:
- Gated progressive updates: each loop pass has its own per-token gate that writes updates back into the residual stream in proportion. The first pass builds global context and writes more conservatively; the second pass refines the output on that basis. On difficult tokens, the first pass writes more updates so that later refinement has more to work with.
- Hybrid KV cache: the second pass reuses the sparse KV selected in the first pass and keeps only one extra sliding-window KV. An extra loop pass adds only one window of cache, so at a 1M context the extra deployment cost of GLM-5.4 over GLM-5.3 is limited.
- Sparse attention index reuse: the second pass reuses the attention indices from the first pass directly, with no additional index overhead.
Z.ai ran a same-parameter-count comparison on a 30B model with the same architecture as the 750B base: using only about 10% more training compute, the loop version improved on all 5 benchmarks in the table, and output was shorter on most of them.

The largest gains are in mathematics (AIME25 up 11.3 points), scientific reasoning (GPQA-Diamond up 8.7 points), and long context (AA-LCR up 7.3 points). Average output length on GPQA-Diamond, MMLU-Pro, and IFBench dropped 11.7%–14.9%, with some reasoning moving from explicit thinking tokens into the depth provided by the loop.
Z.ai also points out a known issue: GLM-5.4 sometimes enters excessively long thinking loops ("marathon thinking"). For latency-sensitive scenarios, it is worth measuring the time on real tasks after integration.
Generalized Coding: tasks beyond code
Z.ai positions GLM-5.4 as the starting point for "Generalized Coding": using a coding approach to complete tasks outside software development. The official blog gives three demos:
- Video: write code to generate and edit a music video with its own narration, "Hello World".
- Engineering: complete engineering-grade CAD modeling in FreeCAD and build a 6-axis robotic arm.
- 3D: use only mathematical geometry and custom GLSL shaders to generate an interactive 3D macro birdwatching scene from scratch.
Z.ai attributes this generalization to simultaneous improvements in coding and vision capabilities.
Release progress
| Channel | Status (2026-11-24) | Who it is for |
|---|---|---|
| GLM Coding Plan | Available. In weekly-quota plans, GLM-5.4's quota is 1.5 times that of GLM-5.3 | Individuals and teams writing code in coding tools |
| Z.ai Model API | Opens after safety evaluation is complete | Developers integrating the model into their own products |
Pricing, release date, and the model name for the pay-as-you-go API are still awaiting official announcement; the pricing page does not yet list GLM-5.4. Z.ai has also not detailed the evaluation tasks behind the win-rate chart. We will update this article once that information is published.
Use Zhipu's latest capabilities now: start with GLM-5.3
If you want to bring Zhipu's flagship capabilities into your product now, GLM-5.3 is the most direct choice: also 1M context and 128K output, focused on complex software engineering and long-chain agent tasks. Use it to set up your call path first; switching to a new model later only requires changing the model name.
HiAPI's text models use the OpenAI-compatible Chat Completions interface. The request below is one we actually ran on 2026-11-24:
curl https://api.hiapi.ai/v1/chat/completions \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [
{"role": "user", "content": "Write a Python function that checks whether a string is a valid IPv4 address. Return only the code."}
],
"reasoning_effort": "low"
}'
This request took about 6.9 seconds, with 33 input tokens and 92 output tokens. The returned code was:
def is_valid_ipv4(address: str) -> bool:
parts = address.split(".")
if len(parts) != 4:
return False
for part in parts:
if not part.isdigit():
return False
if len(part) > 1 and part[0] == "0":
return False
if int(part) > 255:
return False
return True
With the OpenAI Python SDK, point base_url at HiAPI and put the model name in your configuration:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.hiapi.ai/v1",
api_key=os.environ["HIAPI_API_KEY"],
)
# Keep the model name in config so you can switch models without code changes
MODEL = os.environ.get("GLM_MODEL", "glm-5.3")
resp = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user", "content": "Summarize the main risks in this diff: `- timeout=30` `+ timeout=None`"}],
reasoning_effort="high",
)
print(resp.choices[0].message.content)
print(resp.usage)
Three usage tips:
- Choose the thinking level based on the task. GLM-5.3's thinking is always on;
reasoning_effortacceptslow,high, andmax, withmaxas the default. We ran each once: thelowrequest above used 0 thinking tokens and took about 6.9 seconds; the Python example usinghighto analyze a two-line diff used 1,230 thinking tokens, produced 1,557 output tokens in total, and took about 45.5 seconds. The prompts differ, but the effect of the level on latency and tokens is clear. For simple tasks,lowis enough. - Put the model name in configuration. When switching models, change it in one place without touching code.
- Use GLM-5.3 for text tasks. For now, video and image inputs go to other multimodal models.
For more parameters and usage, see the GLM-5.3 model page and the GLM-5.3 API guide.
FAQ
When will the GLM-5.4 API be available?
Z.ai's Model API will open after safety evaluation is complete. GLM Coding Plan users can already use GLM-5.4.
What is the difference between GLM-5.4 and GLM-5.3?
GLM-5.4 uses the Loop Transformer architecture, running the same set of 28 layers twice; GLM-5.3 keeps the GLM-5.2 base, with improvements coming from post-training. GLM-5.4 supports video, image, text, and file input, while GLM-5.3 supports only text. Both have a 1M context and 128K maximum output. In the official win-rate comparison, GLM-5.4 wins 51.1% and loses 23.1% against GLM-5.3.
How many parameters does GLM-5.4 have?
GLM-5.4 is based on the 750B-scale GLM-5 base and deepens the network through loops without adding parameters; Z.ai says its intelligence approaches that of 2T–3T parameter models.
How fast is GLM-5.4?
Official figures are up to 200 tokens/s off-peak and 70–80 tokens/s at peak.
Sources
Related articles
View all articles →-
News
Same Model, Different Coding Agent: Up to 5.4x Cost Difference per Task — Interpreting Artificial Analysis Harness Comparisons
Artificial Analysis ran GPT-6 Luna and GLM-5.3-Flash through the same coding benchmark in 13 agent harnesses, including Claude Code, Codex and OpenCode. This article summarizes the scores, cost per task, step counts and token data, and uses two minimal harnesses to measure how tokens get amplified.
-
News
AI Black Friday 2026: $650 API Credit for $500 + Free DeepSeek
Three offers, Black Friday prices for four models, and how to top up for the most credit
4 min read -
News
Is Lovable Just a Middleman? The Same Question Applies to API Gateways
A post with 1,166 likes asks why anyone still pays for Lovable or Bolt when Claude Code exists. The answer also decides how you should think about API aggregation layers.
6