Back to Models
z-ai logoZ.ai
glm-5

GLM 5

GLM-5 is Z.ai’s flagship open-source foundation model engineered for complex systems design and long-horizon agent workflows. Built for expert developers, it delivers production-grade performance on large-scale programming tasks, rivaling leading closed-source models. With advanced agentic planning, deep backend reasoning, and iterative self-correction, GLM-5 moves beyond code generation to full-system construction and autonomous execution.

2/11/2026
204,800 tokens
#38 Text (Chinese)
Input: $1.06/M
Output: $3.38/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

131,072

Reasoning Configuration

Default
Thinking on
Turning thinking off
Possible (reasoning.enabled: false)

How to control thinking, and what it costs

Data policy

Prompt retention
Unknown — we could not confirm
Training
Unknown — not declared

"Unknown" does not mean "safe". It means we could not confirm it.

Whether a provider trains on prompts is a declared value from our terms with them. Retention is determined from the upstream listing for every host this model can reach. Neither is guessed.

Measured performance

Time to first response (p50)2.2s

    Measured through FastMetal's own gateway over the last 30 days (659 first-response samples).

    Time to first response is measured to the first streamed chunk; throughput counts all output tokens, including reasoning tokens. These are observations, not a performance guarantee.

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

    How GLM 5 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 "strawberry". Here is the step-by-step reasoning: 1. Write out the word: **s-t-r-a-w-b-e-r-r-y** 2. Go through each letter one by one to identify the 'r's: * s (no) * t (no) * **r** (yes, this is the 1st one) * a (no) * w (no) * b (no) * e (no) * **r** (yes, this is the 2nd one) * **r** (yes, this is the 3rd one) * y (no) 3. Count the total findings: 1 + 1 + 1 = 3.
    11.0s response877 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…

    This error occurs because the `users` prop passed to your `UserList` component is `undefined` at the moment the component tries to render. JavaScript tries to run `undefined.map(...)`, which isn't allowed because `undefined` is not an array. Here are three ways to fix this, depending on your specific situation. ### Option 1: Set a Default Value (Recommended) You can provide a default value for the `users` prop in the function definition. If `users` is undefined, it will default to an empty array `[]`. This is the safest approach because `.map()` works perfectly on an empty array (it just renders nothing). ```javascript function UserList({ users = [] }) { // Default to empty array retur…
    18.0s response1617 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 with suggestions categorized by readability, performance, and best practices, followed by a refactored version of the code. ### 1. Best Practices * **Avoid Bare `except` Clauses:** Using `except:` catches *everything*, including system-exiting exceptions like `KeyboardInterrupt` or `SystemExit`. This makes your script hard to stop (Ctrl+C won't work immediately). You should catch specific exceptions like `requests.RequestException`. * **Move Imports to the Top:** Python convention dictates importing modules at the top of the file, not inside functions. This improves readability and ensures the import logic is checked immediately when the script…
    30.7s response2995 output tokens

    Compare these answers side by side with other models →

    Frequently asked questions

    How much does the GLM 5 API cost?
    On FastMetal, GLM 5 is billed per token: $1.06 per 1M input tokens and $3.38 per 1M output tokens on a US-dollar account, before tax. Usage is drawn from a prepaid balance; there is no subscription or monthly fee.
    Can I call GLM 5 with the OpenAI SDK?
    Yes. Point base_url at https://api.fastmetal.ai/v1 and pass "glm-5" as the model; existing OpenAI-style code works unchanged, including streaming, tool calls and structured output.
    What is the context window of GLM 5?
    204,800 tokens, shared between the prompt and the response.
    How does GLM 5 rank?
    #74 on the public arena's Japanese board (ELO 1,417). Ranks move as the leaderboard is updated.
    What do I need to try GLM 5?
    Create an account and add credit; the model is then available both in the browser chat and over the API. There is no contract or minimum spend.

    Try GLM 5 right now

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

    Leaderboard

    Text
    russianELO: 1,447
    #83
    CodingELO: 1,498
    #85
    MathELO: 1,443
    #90
    Creative WritingELO: 1,448
    #42
    Instruction FollowingELO: 1,446
    #71
    Hard PromptsELO: 1,478
    #67
    Multi-TurnELO: 1,472
    #58
    OverallELO: 1,457
    #65
    JapaneseELO: 1,417
    #74
    ChineseELO: 1,516
    #38
    KoreanELO: 1,426
    #46
    EnglishELO: 1,472
    #57
    frenchELO: 1,475
    #72
    germanELO: 1,454
    #65
    spanishELO: 1,459
    #57
    Code
    OverallELO: 1,435
    #86

    Rankings: LMArena leaderboard dataset (lmarena-ai/leaderboard-dataset), CC BY 4.0, snapshot 2026-10-22; category names mapped and ratings rounded by FastMetal.