GLM 5.2: Z.ai's 1M-context model, what changed from GLM 5.1, and a call on a private API
The Morse teamPublished Facts checked 3 min read
GLM 5.2 is Z.ai's open-weight flagship from mid-2026 and the first GLM with what Z.ai calls a "solid 1M-token context." It's built for long coding and agent work, with selectable thinking effort and an MIT license. Morse serves it on a private, OpenAI-compatible API as z-ai/glm-5.2, at $1.40 per million input tokens and $4.40 per million output tokens, and nothing you send goes to Z.ai.
Facts here come from Z.ai's GLM-5.2 card and Morse's model page, both read December 3, 2026. Scores are Z.ai's.
What's new in GLM 5.2?
Z.ai frames 5.2 as "a substantial leap in long-horizon task capability over its predecessor GLM-5.1." Three changes stand out on the card:
- A usable million-token window. Earlier GLM 5 models ran at about 200K. 5.2 is the first to deliver long-horizon work over 1M tokens.
- IndexShare. One indexer is reused across every four sparse attention layers, which Z.ai says cuts per-token compute by 2.9 times at a 1M context.
- Faster decoding and effort levels. An improved multi-token prediction layer raises speculative-decoding acceptance by up to 20%, and thinking comes in several effort levels so you can trade depth for latency.
Hugging Face lists the weights at 753 billion parameters, released under MIT.
How much better is it than GLM 5.1?
On Z.ai's own table, by a lot on the long tasks it was built for:
| Benchmark | GLM 5.2 | GLM 5.1 |
|---|---|---|
| Terminal Bench 2.1 (Terminus-2) | 81.0 | 63.5 |
| SWE-bench Pro | 62.1 | 58.4 |
| DeepSWE | 46.2 | 18.0 |
| FrontierSWE (dominance) | 74.4 | 30.5 |
| SWE-Marathon | 13.0 | 1.0 |
| MCP-Atlas (public) | 76.8 | 71.8 |
| HLE, with tools | 54.7 | 52.3 |
| AIME 2026 | 99.2 | 95.3 |
Source: GLM-5.2 model card, read December 3, 2026.
The jumps are biggest on multi-hour engineering tests: DeepSWE more than doubles, and FrontierSWE goes from 30.5 to 74.4. Short-answer tests move less, since 5.1 was already strong there. If your work is mostly short questions, the gain over 5.1 is small; if it's agents that run for hours, it's the reason to switch.
How do you call GLM 5.2?
Point any OpenAI client at https://inference.trymorse.ai/v1, pass your Morse key, and name z-ai/glm-5.2. On Morse, reasoning_effort takes "none", "high", or "xhigh". The Python below hands it one SSH log line and a firewall tool:
import json
import os
from openai import OpenAI
client = OpenAI(
base_url="https://inference.trymorse.ai/v1",
api_key=os.environ["MORSE_API_KEY"],
)
tools = [
{
"type": "function",
"function": {
"name": "block_ip",
"description": "Add an IP address to the firewall's block list",
"parameters": {
"type": "object",
"properties": {
"ip": {"type": "string"},
"minutes": {"type": "integer"},
},
"required": ["ip", "minutes"],
},
},
}
]
log = "Dec 3 03:12:44 web-2 sshd[811]: Failed password for root from 198.51.100.23 port 40122 ssh2 (x240 in 5m)"
reply = client.chat.completions.create(
model="z-ai/glm-5.2",
reasoning_effort="none",
tools=tools,
messages=[
{"role": "system", "content": "You triage server logs. Block clear brute-force sources for 60 minutes."},
{"role": "user", "content": log},
],
)
for call in reply.choices[0].message.tool_calls or []:
print(call.function.name, json.loads(call.function.arguments))
On December 3, 2026, with reasoning off, GLM 5.2 called block_ip for 198.51.100.23 for 60 minutes in about 2.3 seconds. Morse's model page measured it on December 1 at 0.38 s to the first token and 87 tokens per second, the median of 5 streamed replies, the fastest of the large GLM models on Morse. It also accepts the parallel_tool_calls setting that Codex sends, so Morse's Codex guide and Claude Code guide work with this id.
How do you use a million-token window well?
Put the large, stable material first, a codebase, a contract with its exhibits, or a long incident timeline, and your question last. Repeated requests over the same prefix then bill the cached part at $0.26 per million cached input tokens instead of the full input price. Keep reasoning_effort low for lookups across the document, and raise it when the model has to reason over many distant parts at once. Z.ai's evaluations for long engineering tasks allowed up to 128K tokens of output, so give big jobs room in max_tokens.
GLM 5.2, 5.1, or 5.3?
| GLM 5.2 | GLM 5.1 | GLM 5.3 | |
|---|---|---|---|
| Model id | z-ai/glm-5.2 | z-ai/glm-5.1 | z-ai/glm-5.3 |
| Context | 1M tokens | 200K tokens | 1M tokens |
| Reasoning effort | "none", "high", or "xhigh" | "none" or "high" | "low", "high", or "max" |
| Price | $1.40 per million input tokens and $4.40 per million output tokens | $1.40 per million input tokens and $4.40 per million output tokens | $1.40 per million input tokens and $4.40 per million output tokens |
Read from Morse's catalog when this page was built.
Pick 5.2 when a job needs the full million-token window at the GLM 5 price. GLM 5.3 shares 5.2's base model with more post-training on coding and security; GLM 5.1 stays for work tuned on it.
Is there an uncensored GLM?
Two, built on the 5.3 generation. GLM 5.3 Uncensored runs only on attested hardware, and GLM 5.3 Flash Uncensored is the faster of the two; both are abliterated. Both serve Morse's four uncensored use cases: cybersecurity, agent security, AI and ML research, and training data.
Where do your prompts go?
It runs under zero-data-retention terms, and the provider sees Morse as the customer, not you. With the weights published, Morse runs GLM 5.2 on its own providers rather than Z.ai's; the privacy page lists each tier.
Cost
GLM 5.2 bills at $1.40 per million input tokens and $4.40 per million output tokens against prepaid credits, with repeated input at $0.26 per million cached input tokens, which matters for long-context agents that resend their history. Make a key to try the call above.
Common questions
What is GLM 5.2's context length?
Z.ai's card calls it a solid 1M-token context, the first in the GLM line. On Morse it's 1M tokens, with up to 1,048,575 tokens in one reply.
What changed from GLM 5.1 to GLM 5.2?
Long tasks. Z.ai describes a substantial leap in long-horizon capability over GLM 5.1, a new IndexShare attention trick that cuts per-token compute 2.9 times at 1M context, and selectable thinking effort.
Is GLM 5.2 open source?
Yes. Z.ai releases it under the MIT license.
How does GLM 5.2 relate to GLM 5.3?
GLM 5.3 uses the same base model as GLM 5.2, and Z.ai says every gain in 5.3 comes from post-training.