Skip to main content
GLM-5.4 is Z.ai’s flagship reasoning model for complex coding and long-running agent workflows. Its Loop Transformer reuses layers across reasoning passes. Z.ai lists a 1M-token context window and up to 128K output tokens; the output is text. The primary endpoint listed in the MixRoute Console is POST /v1/chat/completions. Set MIXROUTE_API_KEY before running the examples.

Quick example

Chat Completions parameters

In a non-streaming Chat Completions response, read choices[0].message.content for the final answer. The reasoning_content field, when returned, is separate from the final answer.

Image input

Send text and image_url blocks in the same user message. Replace the example URL with an accessible HTTPS URL, or use a Base64 data URL. This request returns text, not a generated image.

Anthropic-compatible text

For text requests using an Anthropic-compatible client, POST /v1/messages also returned text in MixRoute tests. This is not the primary endpoint listed in the Console. The example below demonstrates text only; do not assume Chat Completions parameters or capabilities carry over.
Read the text blocks in content for the final answer. Give the model enough output tokens to finish thinking and return text.

API reference