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.
| Input / 1M tokens | $1.40 |
|---|---|
| Output / 1M tokens | $4.40 |
| Cache read / 1M | $0.260 |
| Currency | USD |
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
| Scenario | Input / output tokens | Per request | Per 1,000 requests |
|---|---|---|---|
| Chat reply | 200 / 300 | $0.0016 | $1.60 |
| Summarize a long doc | 30K / 1K | $0.046 | $46.40 |
| Code review | 8K / 2K | $0.020 | $20.00 |
Estimate only — actual token counts depend on the provider's tokenizer.
Compare monthly costs across models in the LLM cost calculator
Use an OpenAI-compatible SDK or send an HTTP request. Get API key
export ORCAROUTER_API_KEY=…https://api.orcarouter.ai/v1import 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){
"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.
| Parameter | What it does |
|---|---|
max_tokens | Upper limit on the number of tokens the model generates. |
temperature | Sampling randomness: lower is more focused, higher is more varied. |
tools | Functions the model may call, described as JSON Schema. |
response_format | Force JSON output, optionally matching a JSON Schema. |
reasoning_effort | How much the model reasons before answering: low, medium or high. |
top_p | Nucleus sampling: only consider tokens within this cumulative probability. |
stop | Sequences where the model stops generating. |
tool_choice | Whether the model must, may or must not call a tool. |
structured_outputs | The model can follow a strict JSON Schema given in response_format. |
reasoning | Configure the model's reasoning: effort, token budget, or off. |
include_reasoning | Return the model's reasoning text along with the answer. |
seed | Ask for repeatable sampling for the same input. |
frequency_penalty | Penalize tokens by how often they have appeared, reducing repetition. |
presence_penalty | Penalize tokens that have appeared at all, encouraging new topics. |
repetition_penalty | Discourage repeating tokens from the input or earlier output. |
top_k | Only consider the k most likely tokens at each step. |
min_p | Drop tokens less likely than this fraction of the top token's probability. |
logit_bias | Raise or lower the likelihood of specific tokens. |
logprobs | Return the log probability of each output token. |
top_logprobs | How many likely alternatives to return for each token (needs logprobs). |
What developers are saying this week
Embed this badge
@misc{orcarouter_glm_5_4,
title = {GLM 5.4 API},
author = {Z.ai},
year = {2026},
howpublished = {OrcaRouter},
url = {https://www.orcarouter.ai/models/z-ai/glm-5.4}
}Z.ai. (2026). GLM 5.4 API. OrcaRouter. https://www.orcarouter.ai/models/z-ai/glm-5.4