GLM 5.2 vs GLM 5.3
As of October 21, 2026, GLM 5.2 and GLM 5.3 cost the same: $1.40 per 1M input tokens and $4.40 per 1M output tokens, and both have a 1M-token context window.
GLM 5.2 vs GLM 5.3 side by side
| GLM 5.2 | GLM 5.3 | |
|---|---|---|
| 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 | 1,000,000 tokens | 1,000,000 tokens |
| Max output | 128,000 tokens | 128,000 tokens |
| Image input | Yes | Yes |
| Tool calling | Yes | Yes |
| Structured output (JSON) | Yes | Yes |
| Prompt caching | Yes | Yes |
| Reasoning | Yes | Yes |
| Providers on LiteLLM | 20 | 17 |
| Price shown is from | Z.ai | Z.ai |
| Added to LiteLLM | June 2026 | August 27, 2026 |
Cheapest provider for each
Benchmark scores
| Benchmark | GLM 5.2 | GLM 5.3 |
|---|---|---|
| Coding and agents | ||
| FrontierCode | 24.5% (none) | 40.1% (max) |
| APEX-Agents | 45.2% | 56.6% |
| Reasoning and knowledge | ||
| GPQA Diamond | 91.9% (max) | 90.9% (max) |
| SimpleQA Verified | 34.2% (max) | 41.0% (max) |
| Math | ||
| FrontierMath (tiers 1-3) | 59.2% (max) | 68.8% (max) |
| FrontierMath (tier 4) | 29.3% (max) | 29.3% (max) |
| OTIS Mock AIME 2024-2025 | 86.4% (max) | 91.1% (max) |
Call GLM 5.2 or GLM 5.3 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.
Python SDK
from litellm import completion
messages = [{"role": "user", "content": "Hello!"}]
# GLM 5.2
response = completion(model="zai/glm-5.2", messages=messages)
# GLM 5.3
response = completion(model="zai/glm-5.3", messages=messages)
# GLM 5.2, falling back to GLM 5.3 if the call fails
response = completion(model="zai/glm-5.2", messages=messages, fallbacks=["zai/glm-5.3"])FAQ
Which is cheaper, GLM 5.2 or GLM 5.3?
They cost the same: $1.40 per 1M input tokens and $4.40 per 1M output tokens, as of October 21, 2026.
Which has the larger context window, GLM 5.2 or GLM 5.3?
Both have a 1,000,000-token context window.
Can I switch from GLM 5.2 to GLM 5.3 without changing my code?
Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "zai/glm-5.2" to "zai/glm-5.3", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.
