Back to Models
z-ai logo
z-ai/glm-5-1

GLM 5.1

GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks. Unlike previous models built around minute-level interactions, GLM-5.1 can work independently and continuously on...

4/7/2026
204,800 tokens
Input: ¥250.18/M
Output: ¥786.28/M
Specifications

Modalities

Input
text
Output
text

Supported Parameters

frequency_penalty
include_reasoning
logit_bias
logprobs
max_tokens
min_p
presence_penalty
reasoning
repetition_penalty
response_format
seed
stop
structured_outputs
temperature
tool_choice
tools
top_k
top_logprobs
top_p

Max Output Tokens

128,000
Code Examples
curl https://api.fastmetal.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5.1",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

How GLM 5.1 actually answers

Real responses to our standard prompts, recorded on FastMetal.

Count the number of 'r's in 'strawberry'

Count the number of 'r's in 'strawberry'. Explain your reasoning step by step.

There are **3** 'r's in the word "strawberry". Here is the step-by-step reasoning: 1. Let's break down the word "strawberry" letter by letter: s - t - r - a - w - b - e - r - r - y 2. Now, let's check each letter one by one to see if it is an 'r': - **s**: not an 'r' - **t**: not an 'r' - **r**: this is the 1st 'r' - **a**: not an 'r' - **w**: not an 'r' - **b**: not an 'r' - **e**: not an 'r' - **r**: this is the 2nd 'r' - **r**: this is the 3rd 'r' - **y**: not an 'r' 3. Counting them up, there are three 'r's in total (in the 3rd, 8th, and 9th positions).
7.3s response565 output tokens
Debug This Error

I'm getting the following error in my Node.js application: TypeError: Cannot read properties of undefined (reading 'map') at UserList (/app/components/UserList.js:12:25) at renderWithHooks (/app/node_modules/rea…

### What is causing the error? The error `TypeError: Cannot read properties of undefined (reading 'map')` means you are trying to call the `.map()` method on a variable that is `undefined`. In your code, the variable is `users`. When the `UserList` component renders, the `users` prop is `undefined`, so `undefined.map()` throws an error. ### Why is `users` undefined? This usually happens for one of two reasons: 1. **You forgot to pass the prop:** The parent component rendering `<UserList />` is not passing the `users` attribute (e.g., `<UserList />` instead of `<UserList users={myUsers} />`). 2. **Async Data Fetching:** You are fetching the users from an API. On the initial render, befor…
45.0s response1680 output tokens
Code Review

Please review the following Python function and suggest improvements for readability, performance, and best practices: def get_data(url, retries=3): import requests import time for i in range(retries):…

Here is a review of your function, broken down by areas for improvement, followed by a refactored version of the code. ### Key Areas for Improvement 1. **Imports Inside the Function:** Placing `import` statements inside a function is generally discouraged in Python. It slows down the function execution every time it is called, and it violates PEP 8 (the Python style guide). Imports should always be at the top of the module. 2. **Bare `except` Clause:** Using a bare `except:` catches *everything*, including `KeyboardInterrupt` and `SystemExit`, which makes it hard to terminate a hanging program. You should catch specific exceptions (like `requests.exceptions.RequestException`). 3. *…
70.3s response2854 output tokens

Compare these answers side by side with other models →

Try GLM 5.1 right now

GLM 5.1 is available on FastMetal through one API key. Start in the browser, or call it from the OpenAI SDK.