New Sign up free, 10 calls on us. Up to $1, no card needed.

GLM-5

Released 2026-02-12

chatCodeReasoningTool callingPrompt caching

GLM-5 is Z.AI's new-generation foundation model built for agentic engineering, targeting complex system engineering and long-horizon agent tasks.

Input
text $1/M
Output
text $3.2/M
Cache read
$0.2/M
Context
200K
vs GPT-4o
~80% cheaper

Benchmarks

Above averageNo peer higher15 / 522 / 52
GLM-5 other models measured peer average no peer scored higher
SWE-Bench Pro
55.1%
Cybergym
43.2%
SkillsBench Avg@5
no peer scored higher 47.2%
GPQA Diamond
86%
BrowseComp
62%

Vendor-published: Alibaba (Qwen) Anthropic ByteDance DeepSeek Google MiniMax Moonshot OpenAI Tencent Z.ai

Price in context

Where the price sits among 60 comparable models

Input$1/M
$0.05 · Qwen3 VL Flash GPT-5.4 Pro · $30
Output$3.2/M
$0.275 · DeepSeek V4 Flash GPT-5.4 Pro · $180
Cached read$0.2/M
$0.0028 · DeepSeek V4 Flash GPT-5.4 Pro · $15

The bar shows how this model’s price compares with every other model of the same kind on Synthorai. The cheapest and the most expensive are named at each end. These are base rates; batch, region and cache-write discounts are on the pricing page.

Specs & limits

Tokens

Context window (vendor spec) 200,000
Max output (vendor spec) 131,072

Prompt caching

How it caches automatic

Thinking

Vendor control thinking.type
Accepted values enabled · disabled
Default enabled, and on GLM-5 the model automatically determines whether to think applied when the request sets nothing
Can be turned off Yes
Thinking behaviour Trace returns in reasoning_content; prior turns' traces are cleared by default (clear_thinking true), and interleaved thinking blocks should be preserved and returned together with tool results.
Parameter reasoning_effort
Values minimal · low · medium · high the gateway's parameter surface - the vendor mapping above applies

Model

Modalities text → text
Parameters 744B total · 40B active MoE
License MIT
  • Flagship for agentic engineering: 744B-param MoE (40B active), pre-trained on 28.5T tokens with DeepSeek Sparse Attention
  • 200K context / 128K max output

per Z.ai official docs ↗

One prompt, measured through the gateway

PROMPT Explain to a CFO, in exactly three sentences, why our LLM bill doubled after we enabled reasoning. CHECK exactly 3 sentences

GLM-5 passed · 3 sentences

Enabling reasoning forces the model to perform multiple hidden steps to "think" through a problem, drastically increasing the volume of data processed per query compared to a standard response. Because our billing is directly tied to this processing volume, the additional computational work required for higher accuracy has proportionally doubled our consumption. Essentially, the spike reflects a trade-off where we are paying a higher variable cost to secure significantly better analytical outcomes.

out 1393 tok (+1308 thinking) latency 36.0 s

Instruction following (exactly three sentences - countable), audience shaping (CFO register), and the hidden-thinking billing gap the token meters below expose.

PROMPT This function is supposed to return the longest run of consecutive equal items, but callers report it is off by one on single-element inputs and misses runs that end at the last index. Fix it and explain the bug in one paragraph. CHECK fix passes tests

GLM-5 passed · 8/8 cases

Here is the fixed code: ```python def longest_run(xs): if not xs: return 0 best = 1 cur = 1 for i in range(1, len(xs)): if xs[i] == xs[i - 1]: cur += 1 best = max(best, cur) else: cur = 1 return best ``` **Explanation:** The bug stems from initializing `best` and `cur` to zero, which causes the function to count the number of *transitions* between adjacent elements rather than the total number of items in the run, resulting in a return value that is always one less than the actual length (reporting 0 for a single element and 1 for a pair). By initializing the counters to 1 and resetting `cur` to 1 when a streak breaks, the logic correctly counts the items themselves; adding an explicit check for an empty list ensures the function handles the zero-element edge case correctly.

out 2907 tok (+2694 thinking) latency 73.7 s

Whether the fix is actually correct (runnable), explanation density, and token efficiency on a bounded task.

PROMPT Extract a JSON object with fields {company, quarter, revenue_usd_m, growth_pct, guidance} from this text. Use null for anything not stated; add no other fields. CHECK valid JSON, schema exact

GLM-5 passed · 5/5 fields, guidance "withheld pending the Q4 close"

```json { "company": "Meridian Robotics", "quarter": "September quarter", "revenue_usd_m": 412, "growth_pct": 11, "guidance": "withheld pending the Q4 close" } ```

out 3620 tok (+3561 thinking) latency 91.8 s

Schema obedience (no invented fields), hallucination pressure (guidance is explicitly withheld), and structured-output path differences.

PROMPT Write a 120-word product announcement for an API gateway feature that caches prompts across providers. Forbidden words: "seamless", "unlock", "game-changer", "revolutionize", "empower". Exactly one sentence must be a question. CHECK 120 words, 0 banned words

GLM-5 passed · 119 words, 0 banned, 1 question

We are thrilled to introduce Global Prompt Caching, a powerful new capability within our API gateway designed to optimize your AI operations. By intelligently storing prompt responses across every supported provider, this feature drastically reduces latency and cuts operational costs. Instead of processing identical requests repeatedly, our system serves cached results instantly, ensuring consistent performance even during high-traffic periods. Why pay full price for repeated inference on the same inputs? This update gives developers fine-grained control over cache lifetimes and hit rates, allowing for predictable budgeting and faster application response times. You can activate this functionality directly in your dashboard settings today. Start maximizing your efficiency now and deliver a snappier experience to your end-users without unnecessary API expenditure.

out 715 tok (+571 thinking) latency 18.9 s

Constraint obedience (word budget, banned-word list, the single question), style fingerprint, and length control.

Use GLM-5 in 30 seconds

OpenAI-compatible: swap the base_url, keep your SDK. POST /v1/chat/completions

from openai import OpenAI

client = OpenAI(
    base_url="https://synthorai.io/v1",
    api_key="sk-syn-...",
)

resp = client.chat.completions.create(
    model="glm-5",
    messages=[{"role": "user", "content": "Summarize this diff"}],
    reasoning_effort="medium",
)
print(resp.choices[0].message.content)

About GLM-5

  • Versus its predecessor, Z.AI scaled parameters from 355B (32B activated) to 744B (40B activated) and pre-training data from 23T to 28.5T tokens, adding sparse attention and the Slime asynchronous reinforcement-learning framework.
  • It offers a 200K context window, up to 128K output tokens, thinking modes, function calling, context caching, and open weights, with Z.AI describing open-source state-of-the-art coding and agent performance.
  • Beyond code, the model page names document-heavy work its own team targets: extracting structured data from contracts and financial documents, professional translation, customer-service quality inspection, and role-play or storyboard writing that has to stay in character.
  • Thinking is set through a thinking object whose enabled default, for this generation, means the model decides for itself whether to reason before answering rather than being forced to; the trace returns in a separate reasoning_content field, streamed ahead of the answer, and prior turns' traces are stripped by default.
  • Tool calling accepts up to 128 functions with incremental streaming of tool arguments, external MCP tools plug in directly, JSON object output is supported, and caching of repeated prefixes is automatic.
  • Weights are published under the MIT License.
  • Synthorai serves GLM-5 through its OpenAI-compatible endpoint, so existing SDKs work unchanged.

FAQ

Is the GLM-5 API free to try?

Yes: new accounts get 10 trial calls and up to $1 in free credit, no card required. At $1/M input tokens, that credit alone covers roughly 125 requests of ~8K tokens against GLM-5.

What is GLM-5 best at?

Scaled to 744B parameters, 40B activated; sparse attention plus asynchronous reinforcement learning; open weights with 200K context window. See the About section for the full picture from the vendor's own release notes.

How much does GLM-5 cost?

GLM-5 costs $1 per million input tokens and $3.2 per million output tokens on Synthorai. That is the provider's list price, with no platform markup. Cached input tokens bill at $0.2/M.

Does GLM-5 support prompt caching?

Yes, automatically: Z.ai-served prompts cache with no code changes. Cached input tokens bill at $0.2/M vs $1/M uncached. Prompt caching guide →

How do I get access to GLM-5?

Point your existing OpenAI SDK at base_url="https://synthorai.io/v1", set model="glm-5", and you're done. One API key covers every model on the gateway.

Is GLM-5 open source?

Yes: the weights are published under the MIT license. Or skip the GPUs: the hosted version here is pay-as-you-go with no infrastructure to run. Running open-weight models →

Related models

Compare

Every value on this page is transcribed from the vendor's own documentation, linked above, and carries the date it was checked. Prices are compared across the catalogue; specification values that vendors define differently are shown with the difference stated rather than charted. Nothing here is measured by us, and nothing is scored.

Get your API key Compare your cost →