LiteLLMLiteLLM/ MODELS

Claude Haiku 4.5 vs GLM 5.4

As of December 2, 2026, GLM 5.4 costs 40% more per input token than Claude Haiku 4.5 ($1.40 vs $1.00 per 1M) and has a 1M-token context window versus 200K.

Prices from LiteLLM's price fileChecked

Claude Haiku 4.5 vs GLM 5.4 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 December 2, 2026.
Claude Haiku 4.5GLM 5.4
Input, per 1M tokens$1.00$1.40
Output, per 1M tokens$5.00$4.40
Cache read, per 1M tokens$0.10$0.26
Cache write, per 1M tokens$1.25–
Context window200,000 tokens1,048,576 tokens
Max output64,000 tokens262,144 tokens
Image inputYesYes
Tool callingYesYes
Structured output (JSON)YesYes
Prompt cachingYesYes
ReasoningYesYes
Providers on LiteLLM152
Price shown is fromAnthropicNebius AI Studio
Added to LiteLLMOctober 2025December 2, 2026

Cheapest provider for each

When to pick which

Pick Claude Haiku 4.5 for

  • Costs 29% less per input token: $1.00 vs $1.40 per 1M.
  • Available from 15 providers through LiteLLM, vs 2.

Pick GLM 5.4 for

  • Costs 12% less per output token: $4.40 vs $5.00 per 1M.
  • Larger context window: 1,048,576 vs 200,000 tokens.

From differences in the data above only; where the data is equal, no reason is given.

Call Claude Haiku 4.5 or GLM 5.4 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!"}]

# Claude Haiku 4.5
response = completion(model="claude-haiku-4-5", messages=messages)

# GLM 5.4
response = completion(model="nebius/zai-org/GLM-5.4", messages=messages)

# Claude Haiku 4.5, falling back to GLM 5.4 if the call fails
response = completion(model="claude-haiku-4-5", messages=messages, fallbacks=["nebius/zai-org/GLM-5.4"])

FAQ

Which is cheaper, Claude Haiku 4.5 or GLM 5.4?

Claude Haiku 4.5 is cheaper at 3 input tokens per output token: $2.00 per 1M tokens blended ($1.00 input, $5.00 output), versus $2.15 ($1.40 and $4.40) for GLM 5.4, as of December 2, 2026.

Which has the larger context window, Claude Haiku 4.5 or GLM 5.4?

GLM 5.4 has the larger context window: 1,048,576 tokens, versus 200,000 for Claude Haiku 4.5.

Can I switch from Claude Haiku 4.5 to GLM 5.4 without changing my code?

Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "claude-haiku-4-5" to "nebius/zai-org/GLM-5.4", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.