Z.ai/GLM-5.4
-50%vs officialZ.ai GLM-5.4 is a Loop Transformer flagship: 28 layers of the GLM-5 base run twice with shared weights, adding depth without parameters, comparable to 2T–3T parameter models. Built for complex coding and code-driven video, games and 3D, with a 1M-token context and 128K output.
Output
Send a message on the left. The reply appears here.
Availability 24 hours
Hourly success rate of all completed requests to this site.
Pricing
This model is priced by the usage dimensions listed here. Compare all pricing.
Prices are shown in USD. Charges depend on the model and your actual usage.
| Billing item | Our priceCurrent price | fal.ai | Official price | Savings |
|---|---|---|---|---|
| Input | $0.5989/1M tokens | $1.4/1M tokens | $1.4/1M tokens | 57% cheaper than official57% cheaper than fal.ai |
| Cache read | $0.1497/1M tokens | $0.26/1M tokens | $0.26/1M tokens | 42% cheaper than official42% cheaper than fal.ai |
| Output | $2.096/1M tokens | $4.4/1M tokens | $4.4/1M tokens | 52% cheaper than official52% cheaper than fal.ai |
Reference prices checked on 2026-12-02: fal.ai · Official pricing
README
GLM-5.4
glm-5.4 is the newest GLM-5 flagship; unlike GLM-5.3 it loops 28 layers twice with shared weights, trading compute depth for reasoning and fewer output tokens on hard problems. Built for complex coding, with a 1M-token context, 128K output, tool calls and response format controls.
Why Choose This?
- Turn engineering goals into testable work
- GLM-5.4 is aimed at complex coding. Give it requirements, repository structure, and a failing example. Ask for a change plan that identifies the affected module, expected behavior, and a reproducible verification step for each item.
- Use code to work through source material
- Z.ai positions the model for a wider range of code-assisted tasks. Give it sample data and rules, then ask for a transformation and a check for totals, missing values, and malformed inputs.
- Move through longer tasks in stages
- Z.ai's introduction emphasizes complex coding and extended workflows. Break a long job into checkpoints and bring back the actual run result after each one. Use the new evidence to revise the next proposed change.
Parameters
| Parameter | Required | Description |
|---|---|---|
modelstring | Required | Model ID to call. Use glm-5.4. |
messagesarray | Required | Conversation history as a list of role and content messages. |
system_instructionstring | Optional | Instructions that set the assistant behavior. |
temperaturenumber | Optional | Sampling temperature. Lower is more focused, higher is more varied. Default: 0.7. |
top_pnumber | Optional | Nucleus sampling threshold. Default: 1. |
max_tokensinteger | Optional | Maximum number of tokens to generate. |
streamboolean | Optional | Stream the reply as server-sent events. Default: false. |
reasoning_effortenum | Optional | Reasoning Effort Options: low, medium, high. Default: medium. |
response_formatobject | Optional | Format of the returned result, such as a URL or base64 data. |
toolsarray | Optional | Tools |
tool_choicestring | Optional | Tool Choice |
How to Use
- Try it here first — Sign in and run the model in the playground above to check the output before you write code.
- Create an API key — Open Console → API Keys and create a key. The same key works for every model.
- Write your messages — Put the task and its context in the messages array; add a system prompt to set the assistant behavior.
- Set optional parameters — Adjust the optional parameters listed above to control the output.
- Send the request — Call POST /v1/chat/completions with the model ID glm-5.4.
- Read the reply — The reply and its token usage come back in the response and are logged in the console.
Writing Effective Prompts
Clear instructions get better answers. Tell the model who it is, what you need and how the answer should look.
1. Set the role and goal
Open with who the model should act as and what the task is. Put rules that never change in the system prompt.
You are a senior Python reviewer. Review the function below for bugs and readability.
2. Give the context
Paste what the answer depends on: documents, code, data or earlier decisions. Separate each part with a heading or tag.
3. Specify the output
Name the format, length and tone: a table, JSON with given keys, five bullet points, a 200-word summary.
4. Show an example
One or two input and output examples fix the style faster than a long description.
5. Iterate
When an answer misses, add the missing constraint to the prompt instead of starting over.
| Prompt | |
|---|---|
| Weak | Write about our product. |
| Strong | You are a B2B copywriter. Write three 40-word LinkedIn posts announcing our invoicing API for small accounting firms. Tone: confident, plain English, no emojis. End each post with a question. |
Pricing
| Billing item | Price | Official price |
|---|---|---|
| Input | $0.598865 per 1M tokens | |
| Cache read | $0.149717 per 1M tokens | |
| Output | $2.096 per 1M tokens |
That is 50% below the official list price.
Example: a request with 10,000 input tokens and 1,000 output tokens costs about $0.0081.
Prices are shown in USD. Charges depend on the model and your actual usage. Compare all pricing
Best Use Cases
- Reconcile script output with business rulesStart by drafting a mapping table, then ask the model to implement it. Use representative inputs to check row totals, unique keys, and missing-value handling before connecting the result to a production consumer.
- Normalize untidy recordsProvide representative rows, the target fields, and examples of ambiguous records. Ask for a small conversion script and a reconciliation report, then scale the run and check the field counts and exception categories.
- Expand boundary coverage for a componentSupply its contract, current test output, and the proposed diff. Ask which behaviors have coverage for each input class and which examples are missing. Request test sketches that follow the project's naming conventions.
- Design a reviewable internal toolGive the model the API contract, sample requests, and failure rules. Ask for run steps, observable states, and recovery behavior. Validate the format on a small example before considering how the tool should be released.
Pro Tips
- Spell out what counts as passing — Supply at least one successful example, one boundary case, and the allowed edit scope. Ask the model to tie each example to a verification step so another contributor can reproduce the acceptance checks.
- Feed test results into the next pass — After a run, provide the actual output, intended result, and command that reproduces it. Ask whether the change resolved the original issue first, then use the available evidence to determine the next inspection scope.
- Track code changes back to evidence — Use file paths and input record identifiers in the request and ask the model to retain them in its proposal. Keep an owner and a follow-up item for each unresolved assumption so it survives later review cycles.
FAQ
What is GLM-5.4?
glm-5.4 is the newest GLM-5 flagship; unlike GLM-5.3 it loops 28 layers twice with shared weights, trading compute depth for reasoning and fewer output tokens on hard problems. Built for complex coding, with a 1M-token context, 128K output, tool calls and response format controls.
How do I call the GLM-5.4 API?
Send POST /v1/chat/completions with the model ID glm-5.4 and your API key. Ready-to-run samples are in the API section above.
How is billing calculated?
Charges are based on the selected model, its billing method, and your actual usage.
Where do I get an API key?
Create one in Console → API Keys. The same key works for every model on the gateway.
Can I use the output commercially?
Yes. You can use what you generate in commercial projects, subject to the model provider’s terms.
About GLM-5.4 on DreamTo
glm-5.4 is the newest GLM-5 flagship; unlike GLM-5.3 it loops 28 layers twice with shared weights, trading compute depth for reasoning and fewer output tokens on hard problems. Built for complex coding, with a 1M-token context, 128K output, tool calls and response format controls.
