GLM 5.1 vs GLM 5.2
As of November 12, 2026, GLM 5.1 and GLM 5.2 cost the same: $1.40 per 1M input tokens and $4.40 per 1M output tokens. GLM 5.2 has the larger context window: 1M tokens versus 200K.
GLM 5.1 vs GLM 5.2 side by side
| GLM 5.1 | GLM 5.2 | |
|---|---|---|
| Input, per 1M tokens | $1.40 | $1.40 |
| Output, per 1M tokens | $4.40 | $4.40 |
| Cache read, per 1M tokens | $0.26 | $0.26 |
| Cache write, per 1M tokens | $0 | $0 |
| Context window | 200,000 tokens | 1,000,000 tokens |
| Max output | 128,000 tokens | 128,000 tokens |
| Image input | – | Yes |
| Tool calling | Yes | Yes |
| Structured output (JSON) | Yes | Yes |
| Prompt caching | Yes | Yes |
| Reasoning | Yes | Yes |
| Providers on LiteLLM | 14 | 27 |
| Price shown is from | Z.ai | Z.ai |
| Added to LiteLLM | May 2026 | June 2026 |
Cheapest provider for each
- GLM 5.1: EmpirioLabs AI at $0.825 input and $3.301 output per 1M tokens (
empiriolabs/glm-5-1) - GLM 5.2: CLF AI Gateway at $0.56 input and $1.76 output per 1M tokens (
clf_ai_gateway/glm-5.2)
Benchmark scores
| Benchmark | GLM 5.1 | GLM 5.2 |
|---|---|---|
| Coding and agents | ||
| APEX-Agents | 40.9% | 45.2% |
| Reasoning and knowledge | ||
| GPQA Diamond | 89.9% | 91.9% (max) |
| SimpleQA Verified | 34.0% | 34.2% (max) |
| Math | ||
| FrontierMath (tiers 1-3) | 36.8% | 59.2% (max) |
| OTIS Mock AIME 2024-2025 | 93.3% | 86.4% (max) |
When to pick which
Pick GLM 5.2 for
- Larger context window: 1,000,000 vs 200,000 tokens.
From differences in the data above only; where the data is equal, no reason is given.
Call GLM 5.1 or GLM 5.2 with LiteLLM
Both use the OpenAI format through LiteLLM, so switching is a model name change. Set each provider's API key in the environment first.
from litellm import completion
messages = [{"role": "user", "content": "Hello!"}]
# GLM 5.1
response = completion(model="zai/glm-5.1", messages=messages)
# GLM 5.2
response = completion(model="zai/glm-5.2", messages=messages)
# GLM 5.1, falling back to GLM 5.2 if the call fails
response = completion(model="zai/glm-5.1", messages=messages, fallbacks=["zai/glm-5.2"])FAQ
Which is cheaper, GLM 5.1 or GLM 5.2?
They cost the same: $1.40 per 1M input tokens and $4.40 per 1M output tokens, as of November 12, 2026.
Which has the larger context window, GLM 5.1 or GLM 5.2?
GLM 5.2 has the larger context window: 1,000,000 tokens, versus 200,000 for GLM 5.1.
Can I switch from GLM 5.1 to GLM 5.2 without changing my code?
Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "zai/glm-5.1" to "zai/glm-5.2", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.