LiteLLMLiteLLM/ MODELS

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.

Prices from LiteLLM's price fileChecked

GLM 5.1 vs GLM 5.2 side by side

Headline prices in US dollars per 1M tokens: each model's own lab where it sells it, otherwise its cheapest provider. Source: LiteLLM model price file, as of November 12, 2026.
GLM 5.1GLM 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 window200,000 tokens1,000,000 tokens
Max output128,000 tokens128,000 tokens
Image input–Yes
Tool callingYesYes
Structured output (JSON)YesYes
Prompt cachingYesYes
ReasoningYesYes
Providers on LiteLLM1427
Price shown is fromZ.aiZ.ai
Added to LiteLLMMay 2026June 2026

Cheapest provider for each

Benchmark scores

From the Epoch AI Benchmarking Hub (CC BY 4.0), data as of August 29, 2026. Some results were run by Epoch and others collected by Epoch from each benchmark's own leaderboard, linked in the first column. Each model's best reported reasoning setting is shown in brackets. Higher is better. Only benchmarks with a score for both models are shown.
BenchmarkGLM 5.1GLM 5.2
Coding and agents
APEX-Agents40.9%45.2%
Reasoning and knowledge
GPQA Diamond89.9%91.9% (max)
SimpleQA Verified34.0%34.2% (max)
Math
FrontierMath (tiers 1-3)36.8%59.2% (max)
OTIS Mock AIME 2024-202593.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.

Python SDK
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.