Z.AI model guide

GLM-5.1

GLM-5.1 is Z.AI’s flagship open-weight model for long-horizon coding agents and autonomous engineering work. The official model card lists 754B parameters, while Z.AI docs list a 200K-token context window, 128K maximum output, tool use, structured output, and context caching.

754B
model size on Hugging Face
200K
context window
$4.40
per 1M output tokens
Capabilities

What GLM-5.1 is built to do

The official positioning is long-horizon autonomous work: planning, executing, testing, revising, and delivering over extended tool-driven sessions.

Long-horizon execution

Z.AI says GLM-5.1 can work autonomously on a single task for up to 8 hours, keeping goal alignment through planning, execution, testing, fixing, and delivery.

Agentic coding

The model is optimized for workflows such as Claude Code and OpenClaw, where repository edits, tool calls, terminal feedback, and repeated iteration matter more than one-shot answers.

Production integration

GLM-5.1 supports streaming responses, function calling, structured JSON-style output, context caching, and MCP-style tool/data integrations for agent systems.

Official scenarios

Three GLM-5.1 long-horizon scenarios

The official GLM-5.1 blog demonstrates the same core behavior across three feedback settings: a numeric vector-search target, a systems benchmark with speedup measurements, and an open-ended browser desktop build.

GLM-5.1 approximate nearest neighbor search optimization final annotated chart at 655 iterations and 21.5k QPS

Scenario 1: Optimizing a Vector Database Over 600 Iterations

In VectorDBBench, GLM-5.1 optimizes a Rust approximate-nearest-neighbor database on SIFT-1M, ranking submissions by QPS while maintaining Recall >= 95%. With an outer optimization loop, it keeps improving beyond 600 iterations and 6,000+ tool calls, reaching 21.5k QPS, about 6x the best single 50-turn result cited by Z.AI.

655
iterations
21.5k
QPS
6,000+
tool calls
KernelBench Level 3 agentic ML workload optimization chart comparing GLM-5.1, GLM-5, Claude Opus 4.6, and Claude Opus 4.5

Scenario 2: Optimizing Machine Learning Workload Over 1,000+ Turns

On KernelBench Level 3, the task is to turn reference PyTorch implementations into faster correct GPU kernels across 50 full-model problems. Z.AI reports GLM-5.1 reaching 3.6x geometric-mean speedup, ahead of GLM-5 at 2.6x and above torch.compile max-autotune at 1.49x, while Claude Opus 4.6 reaches 4.2x.

3.6x
GLM-5.1 speedup
2.6x
GLM-5 speedup
1.49x
torch.compile max-autotune

Scenario 3: Building a Linux Desktop Over 8 Hours

For the open-ended web-app scenario, Z.AI asks GLM-5.1 to build a Linux-style desktop environment with no starter code or mockups. A self-review loop runs for 8 hours, letting the model identify missing features, rough styling, and broken interactions, then refine the browser desktop into a coherent app with file browser, terminal, editor, monitor, calculator, and games.

8h
self-review loop
Qualitative
open-ended task
Browser
desktop app
GLM-5.1 price

Official GLM-5.1 API pricing

Z.AI prices GLM-5.1 per 1M tokens. Cached input is cheaper, and cached input storage is listed as limited-time free in the official pricing table.

Input
$1.40 / 1M tokens
Cached input
$0.26 / 1M tokens
Cached input storage
Limited-time free
Output
$4.40 / 1M tokens

Prices are taken from Z.AI’s pricing page checked on June 23, 2026. MyClaw plan pricing and provider pass-through costs can differ by product packaging.

GLM-5.1 benchmarks

GLM-5.1 benchmarks vs GLM-5, Opus 4.6, and Kimi K2.5

The table below uses the benchmark values published on the GLM-5.1 model card, keeping all comparison numbers from the same source and evaluation table.

GLM-5.1 benchmarksGLM-5.1GLM-5Claude Opus 4.6Kimi K2.5
SWE-Bench Pro58.455.157.353.8
NL2Repo42.735.949.832.0
Terminal-Bench 2.0 (Terminus-2)63.556.265.450.8
CyberGym68.748.366.641.3
BrowseComp w/ Context Manage79.375.984.074.9
MCP-Atlas Public Set71.869.273.863.8

Use these as selection signals, not universal truth: benchmark prompts, tool harnesses, model versions, and self-reported settings can change. Opus values marked with an asterisk in the source table should be treated as reported under that table’s stated conditions.

Model comparison

GLM-5.1 vs GLM-5, Opus 4.6, and Kimi K2.5

A practical comparison for choosing GLM-5.1 in agentic coding and long-running engineering workflows.

Model comparisonGLM-5.1GLM-5Claude Opus 4.6Kimi K2.5
Best fitOpen-weight Z.AI flagship for long-horizon coding agents, tool-heavy engineering tasks, and cost-conscious frontier workflows.Earlier Z.AI foundation model with the same documented 200K context and 128K output class, but weaker GLM-5.1 benchmark scores on coding and agents.Strong closed model in the same Z.AI comparison table, especially ahead on NL2Repo, BrowseComp with context management, and MCP-Atlas.Competitive agentic model in the table, but GLM-5.1 leads Kimi K2.5 on the listed SWE-Bench Pro, NL2Repo, Terminal-Bench, CyberGym, and MCP-Atlas rows.
Context window200K tokens in Z.AI docs.200K tokens in Z.AI docs.Not specified in the GLM-5.1 official source table; verify current Anthropic docs for deployment limits.Not specified in the GLM-5.1 official source table; verify current Moonshot/Kimi docs for deployment limits.
Model size and access754B parameters on Hugging Face, MIT license, API access through Z.AI.Z.AI docs list GLM-5 as 744B total parameters with 40B activated parameters.Closed Anthropic model; parameter count is not published in the GLM-5.1 source table.Parameter count and license are outside the GLM-5.1 official comparison table; verify current Moonshot model materials.
Price posture$1.40 input and $4.40 output per 1M tokens on Z.AI’s official pricing page.$1.00 input and $3.20 output per 1M tokens on Z.AI’s official pricing page.Use Anthropic’s current pricing page before production; not priced in Z.AI’s GLM-5.1 benchmark table.Use Moonshot/Kimi’s current pricing page before production; not priced in Z.AI’s GLM-5.1 benchmark table.
Use cases

Where GLM-5.1 fits inside MyClaw

Choose GLM-5.1 when a hosted agent needs to keep working over many files, tools, iterations, and checks without losing the original goal.

Repository implementation

Use GLM-5.1 for codebase reading, implementation planning, file edits, tests, and terminal-driven debugging in a hosted MyClaw workspace.

Benchmark and optimization loops

The official GLM-5.1 blog shows a 655-iteration ANN search run and a 3.6x KernelBench Level 3 speedup, grounding the model’s long-horizon optimization claim in concrete tool-loop examples.

Document and office production

Z.AI lists improved PowerPoint, Word, PDF, and Excel task handling, useful when an agent needs to turn research into polished deliverables.

Structured automation

Function calling, structured output, context caching, and MCP support make GLM-5.1 useful for workflows that need reliable tool orchestration.

GLM-5.1 FAQs

Run GLM-5.1 in a hosted MyClaw agent

Use MyClaw when you want GLM-5.1 inside a managed workspace with files, tools, browser-ready execution, and agent workflows already wired together.

Run GLM-5.1 in MyClaw