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

GLM 5.2

GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...

6/16/2026
1,048,576 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
parallel_tool_calls
presence_penalty
reasoning
reasoning_effort
repetition_penalty
response_format
seed
stop
structured_outputs
temperature
tool_choice
tools
top_k
top_logprobs
top_p

Max Output Tokens

131,072
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.2",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

How GLM 5.2 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.

To count the number of 'r's in the word 'strawberry', let's look at the word letter by letter: 1. **s** - no 'r' 2. **t** - no 'r' 3. **r** - this is the 1st 'r' 4. **a** - no 'r' 5. **w** - no 'r' 6. **b** - no 'r' 7. **e** - no 'r' 8. **r** - this is the 2nd 'r' 9. **r** - this is the 3rd 'r' 10. **y** - no 'r' Total count: 3 There are **3** 'r's in the word 'strawberry'.
2.6s response439 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…

The error `TypeError: Cannot read properties of undefined (reading 'map')` happens because the `users` prop being passed to your `UserList` component is currently `undefined`. When JavaScript tries to call `.map()` on `undefined`, it throws this error. Here are the best ways to fix this: ### Fix 1: Provide a default value (Recommended) You can provide a default empty array `[]` when destructuring the props. This ensures that even if `users` is not passed down, the `.map()` function will still have an array to iterate over (resulting in an empty list rather than a crash). ```jsx function UserList({ users = [] }) { return ( <ul> {users.map(user => <li key={user.id}>{user.name}</…
8.3s response1006 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 Python function, broken down by readability, performance, and best practices, followed by a refactored version of the code. ### 1. Best Practices * **Move imports to the top:** Importing modules inside a function is generally discouraged. While Python caches imports, putting `import requests` and `import time` at the top of your file is the standard convention and improves readability. * **Avoid bare `except:` blocks:** Using a bare `except:` catches everything, including `KeyboardInterrupt` and `SystemExit`. This makes it hard to interrupt your program if it gets stuck in a loop. You should catch specific exceptions, such as `requests.exceptions.RequestException` (…
10.9s response2061 output tokens

Compare these answers side by side with other models →

Try GLM 5.2 right now

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