GLM 5.4

z-ai/glm-5.4
NewFlagshipFeaturedZDR
VisionToolsJSONReasoning
by Z.ai · 2026-12-02

GLM-5.4 is Z.ai (Zhipu AI)'s first flagship model with native vision, built on Z.ai's first Loop Transformer architecture with enhanced reasoning and generalized coding. It accepts text, image and video input and returns text, serves a ~1.05M-token context window, and is tuned for repo-scale coding, long-horizon agentic workflows and complex reasoning. Thinking is always on (passing thinking disabled fails the request) and reasoning depth is set by reasoning_effort (low / high / max, default max). It supports native tool calling, structured JSON output, full sampling controls (temperature, top_p, top_k, min_p, penalties), and speaks the OpenAI-compatible chat-completions format.

Max output128K
Inputtext + image + video
Outputtext
p50 TTFT2.06 s
Data retentionZero Data Retention available. With ZDR on, requests go only to providers with a zero-retention agreement.
Context window1Mtokens
INPUT$1.40/ 1M tokens
OUTPUT$4.40/ 1M tokens
p50 TTFT2.06 s7d
p95 TTFT2.06 s7d

Pricing

Pricing
Input / 1M tokens$1.40
Output / 1M tokens$4.40
Cache read / 1M$0.260
CurrencyUSD

Cost calculator

Tokens / month2MM
Input share80%%
Estimated / month $4.00 · With prompt caching $3.09

1.6M input × $1.4/M + 400K output × $4.4/M

Prompt caching assumes half of the input tokens are read from cache at $0.26/M.

Estimate based on list price

Per-request examples
ScenarioInput / output tokensPer requestPer 1,000 requests
Chat reply200 / 300$0.0016$1.60
Summarize a long doc30K / 1K$0.046$46.40
Code review8K / 2K$0.020$20.00

Token & cost estimator

Input tokens: 20Cost per request: $0.002228

Estimate only — actual token counts depend on the provider's tokenizer.

Compare monthly costs across models in the LLM cost calculator

Code samples

Use an OpenAI-compatible SDK or send an HTTP request. Get API key

API key
export ORCAROUTER_API_KEY=…
Base URL
https://api.orcarouter.ai/v1
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.orcarouter.ai/v1",
    api_key=os.environ["ORCAROUTER_API_KEY"],
)

response = client.chat.completions.create(
    model="z-ai/glm-5.4",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Example response

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "created": 1763280000,
  "model": "z-ai/glm-5.4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 10,
    "total_tokens": 19
  }
}
  • choices[0].message.content — the model's answer.
  • finish_reason — "stop" means the answer is complete; "length" means it was cut off at max_tokens.
  • usage — the input and output tokens this call is billed for.

An HTTP 200 with finish_reason "stop" means the call succeeded.

Supported parameters

ParameterWhat it does
max_tokensUpper limit on the number of tokens the model generates.
temperatureSampling randomness: lower is more focused, higher is more varied.
toolsFunctions the model may call, described as JSON Schema.
response_formatForce JSON output, optionally matching a JSON Schema.
reasoning_effortHow much the model reasons before answering: low, medium or high.

Full API reference

Use cases and examples

  • Long context — 1M-token context window: whole codebases, long reports or chat histories in one request.
  • Multimodal input — Takes text + image + video in one request.
  • Agents and tool use — Calls the functions you define, for agents and tool workflows.
  • Structured extraction — Returns JSON that follows your schema, for pulling fields out of text.
  • Reasoning — Works through a problem before answering: math, science and multi-step tasks.

Performance

p50 TTFTTime to first token for a typical request: half of requests got their first token faster than this.
2.06 s
#63 fastest of 150 models
Output speedHow many tokens per second the model streams once it starts answering.
Collecting…
p95 TTFTTime to first token for a slow request: 95% of requests got their first token faster than this.
2.06 s
Error rateShare of requests to this model on OrcaRouter that ended in an error over the window.
0%

Benchmarks

Source: Design Arena

Community buzz

What developers are saying this week

Hacker News2 mentions · 7ddown 2 vs the previous week

Compare models

GLM 5.4GLM 5.1GLM 5.2GLM 5.3
Input $/M$1.40$1.40$1.40$1.26
Output $/M$4.40$4.40$4.40$3.96
Context1.0M200K1.0M1.0M
Quality9/109/109/109/10
Compare side-by-sideCompare side-by-sideCompare side-by-sideCompare side-by-side

FAQ

How much does Z.ai: GLM 5.4 cost on OrcaRouter?
Z.ai: GLM 5.4 is priced at $1.40 per 1M input tokens and $4.40 per 1M output tokens via OrcaRouter. Pricing is pulled live from the routing layer.
What is Z.ai: GLM 5.4's context window?
Z.ai: GLM 5.4 supports a context window of 1M tokens. Use long-context features (RAG, summarisation) up to that limit.
How do I call Z.ai: GLM 5.4 via the OpenAI SDK?
Set OpenAI base_url to https://api.orcarouter.ai/v1, supply your OrcaRouter API key, and pass model="z-ai/glm-5.4" in the chat.completions.create call.
Does OrcaRouter rate-limit Z.ai: GLM 5.4?
Per-model rate limits follow your OrcaRouter plan. Free tiers ship with conservative caps; paid tiers lift them. Check /pricing for current quotas.

Embed this badge

Z.ai: GLM 5.4•$1.40/M in•2061ms p50•via OrcaRouter
HTML <a href="https://www.orcarouter.ai/models/z-ai/glm-5.4" target="_blank"> <img src="https://www.orcarouter.ai/embed/z-ai/glm-5.4.svg" alt="Z.ai: GLM 5.4 on OrcaRouter" /> </a>
Markdown [![Z.ai: GLM 5.4](https://www.orcarouter.ai/embed/z-ai/glm-5.4.svg)](https://www.orcarouter.ai/models/z-ai/glm-5.4)

Model card as data

GET /api/public/models/z-ai/glm-5.4Open
Machine-readable:/llms.txt/llms-full.txt