Skip to content

GLM 5.4

Model ID

glm-5-4

Publisher

zai-org

Context

1M (US 2)

GLM 5.4 is exposed through POST /v1/chat/completions using the standard OpenAI-compatible chat payload. It supports function / tool calling (tools, tool_choice, assistant tool_calls) and works with structured outputs via response_format where applicable.

Specification Value
API ID glm-5-4
Context length 1M tokens in US 2. See Context length by region.
Capability Supported
Chat completions (/v1/chat/completions) Yes
Tool / function calling Yes
Structured output (response_format) Yes
Responses API (/v1/responses) Yes
Anthropic Messages API (/v1/messages) No
Image input (image_url) Yes
Video input (file) Yes
Reasoning Yes
Prompt caching Yes

Prompt caching is enabled for GLM 5.4. Input tokens served from the cache are billed at about 19% of the input price (currently $0.25 per 1M tokens, versus $1.30 per 1M for non-cached input). See Pricing for details.

Property Value
Reasoning supported Yes
Toggleable Yes
How to toggle reasoning.effort set to "none"
Reasoning effort levels low, medium, high, max
How to set effort reasoning.effort parameter

Reasoning is on by default. Set reasoning.effort to "none" to turn it off, or to "low", "medium", "high" or "max" to control how deeply the model reasons. Turning reasoning off through chat_template_kwargs (enable_thinking: false) has no effect on this model: use reasoning.effort.

For a full example, see Reasoning Example.

Use glm-5-4 as the model field in chat completion requests. For tool usage patterns and examples, see Tool Calling and Structured Output.