Z.ai
GLM 5.4
chat
Z.ai GLM-5.4 flagship model: text, image and video input, a 1,048,576-token context, mandatory reasoning with low, high and max levels, tools and JSON schema output.
Specifications
Context window
1.0M
Max tokens in response
131 072
Vendor
Z.ai
Release
2026-12-02
Login
text, images, video
Output
text
Capabilities
visiontoolsreasoningstreaming
Description
What it does
- Text, images and video in, text out. An image is an image_url part, a video is a video_url part (an https link or data:video/mp4;base64,…; MP4, MOV, WebM).
- Reasoning is mandatory and cannot be turned off. Depth is set by reasoning_effort: low, high (default) or max. At max the model thinks about four times longer than at high. The value none is rejected with a 400 error.
- Tool calling: tool_choice is auto, none, required or a specific function; several calls in one response.
- Output that follows a JSON schema (response_format json_schema).
- Stop sequences (stop) and seed.
- Streaming: text, reasoning and tool calls arrive as they are generated; token usage comes in the last chunk.
Video
{"model": "z-ai/glm-5.4-16406", "messages": [{"role": "user", "content": [{"type": "video_url", "video_url": {"url": "https://example.com/clip.mp4"}}, {"type": "text", "text": "What happens in this video?"}]}]}Video counts as input tokens: about 300 tokens per second of a 640×360 clip. Base64 video up to 20 MB; for larger files pass a link.
Limits
- Context: 1,048,576 tokens; response: up to 131,072 tokens (including reasoning).
- If max_tokens is not set, the platform uses the largest value your request allows.
Sampling parameters
temperature (0–2) and top_p (0–1). The model author recommends temperature 1 and top_p 0.95.
Pricing
- Reasoning tokens are billed as output tokens.
- A repeated request prefix may be cached, and cached input tokens cost less. Rates are on this page.
Good for
Coding and agentic tasks with long context, reading screenshots, diagrams and video, reasoning tasks.
Parameters
Endpoints
Code examples
For OpenAI SDK, specify
/v1 in base_url. For Anthropic SDK — without /v1.