NeuralBridge
Sign in Download IDE
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

temperaturedefault: 1
Controls how varied the answer is: higher values make the output more random, lower values more predictable.
top_pdefault: 1
Nucleus sampling: only the most probable tokens whose probabilities add up to P are considered.
max_tokens
Upper limit on the number of tokens the model may generate in its answer.
stop
List of stop strings: generation halts as soon as the model produces any of them.
seed
Pins randomness: repeating a request with the same seed and parameters returns the same result.
response_format
Response format: plain text or strict JSON following a given schema.
streamdefault: false
Deliver the answer as a stream while it is generated instead of one chunk at the end.
tools
tool_choice
reasoning_effortdefault: high · low · high · max
Thinking level: how much effort the model spends reasoning before answering. Higher means deeper analysis, more time and more tokens.

Endpoints

POSThttps://api.neuralbridge.ru/v1/chat/completionsprimary
Chat Completions — The main chat endpoint: takes a message history and returns the model reply. Supports streaming and regular modes. The X-NB-Prompt-Cache header sets prompt caching for a single request: 5m, 1h or off.
POSThttps://api.neuralbridge.ru/v1/responses
Responses — Alternative chat format with state and structured output. The X-NB-Prompt-Cache header sets prompt caching for a single request: 5m, 1h or off.
POSThttps://api.neuralbridge.ru/v1/messages
Messages — Anthropic format: the same chat for clients and SDKs written for Claude. The X-NB-Prompt-Cache header sets prompt caching for a single request: 5m, 1h or off.
POSThttps://api.neuralbridge.ru/v1/converse
Converse — Amazon Bedrock Converse format, for clients written against it.
POSThttps://api.neuralbridge.ru/v1/converse-stream
Converse Stream — Streaming variant of the Bedrock Converse format.
POSThttps://api.neuralbridge.ru/v1/generateContent
Generate Content — Google Gemini format, for clients and SDKs written against it.
POSThttps://api.neuralbridge.ru/v1/streamGenerateContent
Stream Generate Content — Streaming variant of the Gemini format.

Code examples

python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.neuralbridge.ru/v1",
)

response = client.chat.completions.create(
    model="z-ai/glm-5.4-16406",
    messages=[{"role": "user", "content": "Привет! Расскажи о себе."}],
)

print(response.choices[0].message.content)
For OpenAI SDK, specify /v1 in base_url. For Anthropic SDK — without /v1.
Prices
Login / 1M tokens221,55 ₽
Output / 1M tokens696,30 ₽
Cache hit / 1M tokens41,145 ₽
The request cost in rubles — in the response, field usage.cost
Identifier
z-ai/glm-5.4-16406
Get API key