All models

GLM-5.1 on VM0. Long-context agents

Z.AI's flagship. Up to a 1M-token context window. Strong for whole-codebase or whole-knowledge-base agents at well below Sonnet pricing.

1M tokens · Text / Code · Prompt cache

GLM-5.1 is the long-context specialist in the lineup, with up to 1M tokens of input. Reach for it when the prompt is genuinely huge: a whole repository at once, several hundred documents in a single research run. Independent leaderboards consistently rank it in the top tier of open-weight models for long-context work.

Vendor list price is $1.40 / $4.40 per 1M tokens, well under half of Sonnet 4.6 at the vendor level, and the API is Anthropic-compatible so Claude-style agents drop in without a rewrite. Reach for Sonnet or Opus when English reasoning depth matters more than context size, and for Haiku when latency dominates.

What is GLM-5.1?

Early 2026; full GA on VM0 April 2026 · Z.AI / Zhipu AI's flagship general-purpose model.

GLM-5.1 is the flagship of Zhipu AI's GLM series, distributed via Z.AI. It's a reasoning model with strong general capability and an unusually large context window. Up to 1M tokens, several times larger than the Anthropic and Moonshot defaults at the same price tier.

On VM0, GLM-5.1 is exposed two ways: through VM0 Managed (routed via OpenRouter with the upstream id z-ai/glm-5.1), and via a direct Z.AI API key (where it's the default model). Either path uses Z.AI's Anthropic-compatible interface, so existing VM0 agents drop in unchanged.

GLM-5.1 became broadly available on VM0 in April 2026 when its feature flag was retired (PR #10497). It's the cost-efficient long-context option in the lineup, sitting at ×0.4 credits. Less than half of Sonnet 4.6.

What's notable about GLM-5.1

Headline architecture and capability features.

GLM-5.1 exposes an up-to-1M-token context window (the largest in the Built-in lineup) through an Anthropic-compatible API surface, so Claude-style agents drop in unchanged. The upstream supports prompt caching at api.z.ai.

Specs at a glance

FamilyGLM-5 series
ModalitiesText, code
LanguagesMultilingual
Context windowUp to 1M tokens
Prompt cachingSupported (Anthropic-compatible)
Available on VM0April 2026

GLM-5.1 benchmarks

Independent reviews place GLM-5.1 in the top tier of open-weight models for long-context tasks. Numbers shift weekly on third-party leaderboards. We deliberately don't pin exact percentages here.

Code Arenathird-party leaderboard
Top-3 (open weights)
Long-context recallvendor-reported
Strong across 1M-token window

GLM-5.1 pricing

Provider list price, per 1M tokens.

Input$1.40
Output$4.40
Cache read$0.26
Cache write$1.40

How GLM-5.1 behaves in practice

Observed behaviour from production agent runs.

Long-context recall

GLM-5.1's 1M-token window is genuinely usable. It maintains coherence well past the 200K boundary that limits the Anthropic family on the older 200K models. Useful for whole-repo or whole-doc-corpus agents.

Reasoning

Solid general reasoning. Below Sonnet 4.6 on the hardest English-language multi-tool routing, but the gap is small relative to the cost difference.

Tool use

Reliable across the common VM0 tool surface (Slack, GitHub, Notion, Linear). Some edge cases in deeply nested tool calls are handled less crisply than Claude Sonnet 4.6.

Best agent tasks for GLM-5.1

The whole-repo refactor that fits in one prompt

Drop a 500K-token mid-sized codebase into a single GLM-5.1 call and ask for a cross-file rename, an architectural review, or a security pass. Models with smaller windows force you to chunk the repo and stitch results together, which is where bugs creep in. GLM-5.1 keeps every file in working memory and references the right paths in its output.

The research run over hundreds of documents

Wikis, RFCs, contracts, last year's support tickets — load the whole pile at once and ask for cross-document patterns. The cost-per-run stays manageable because of the low vendor price, which is what makes this kind of "read everything, summarise once" workflow actually affordable in production rather than a one-off science project.

The thinking job that needs more than ten minutes

Some agent steps genuinely take five to thirty minutes — deep research, multi-document analysis, long planning passes. VM0 sets a 50-minute API timeout for the Z.AI provider so those long thinking steps don't get cut off mid-thought, which makes GLM-5.1 the safe pick over models routed through providers with shorter default timeouts.

When to skip GLM-5.1

Skip GLM-5.1 on the hardest English-language reasoning where Sonnet 4.6 or Opus 4.7 still leads, and on latency-critical chat replies where Haiku 4.5 is much faster.

GLM-5.1 vs other models

GLM-5.1 vs Kimi K2.6

Both are long-context options at similar credit cost (×0.4 vs ×0.3). Kimi has stronger long-context recall in our internal evaluation; GLM-5.1 wins on raw context size (1M vs 256K). Pick Kimi for very long transcripts; pick GLM-5.1 when you need to stuff a whole codebase into one prompt.

GLM-5.1 vs Claude Sonnet 4.6

Sonnet 4.6 (×1) leads on tool-routing accuracy and English-language reasoning. GLM-5.1 (×0.4) leads on context window and is the right pick when cost or context size dominates the decision.

GLM-5.1 vs DeepSeek V4 Pro

DeepSeek V4 Pro (×0.3) is cheaper and benchmarks higher on Code Arena per third-party reviews. GLM-5.1 still wins on context size. Pick DeepSeek for cost-sensitive standard-context work; pick GLM-5.1 when context size is the constraint.

Bottom line: should you use GLM-5.1?

Pick GLM-5.1 when context size is the constraint. For everything else, DeepSeek V4 Pro is cheaper and Sonnet 4.6 routes tools more reliably.

Frequently asked questions

How big is GLM-5.1's context window on VM0?

Up to 1 million tokens. The largest in our Built-in lineup. Enough to fit a mid-sized repository or several hundred documents in a single prompt.

Which provider should I use for GLM-5.1?

VM0 Managed is the simplest path. If you want vendor-direct billing, connect a Z.AI API key.

Is GLM-5.1 open weights?

Z.AI publishes open-weight variants of the GLM series. The version exposed on VM0 routes to the Z.AI hosted API for production reliability.

Does GLM-5.1 support image input?

GLM-5.1 on VM0 is exposed for text and code. For multimodal (image/video) input, choose Claude Sonnet 4.6 or Kimi K2.6.

Alternatives

Using GLM-5.1 on VM0

Two ways to access GLM-5.1 on VM0

VM0 supports GLM-5.1 as a Built-in model billed in VM0 credits, and through bring-your-own with a Z.AI API key. The Built-in path uses VM0 Managed routing and the credit multiplier explained below; the bring-your-own path bills you directly with the upstream vendor and skips the VM0 credit conversion entirely.

VM0's recommendation

VM0 positions GLM-5.1 as a cost-saving option rather than a core agent model. Use it to optimise unit cost on non-core work, such as bulk classification, pre-filters, latency-critical short replies, or pinned legacy agents, while keeping Claude Opus 4.7, Claude Opus 4.6, or Claude Sonnet 4.6 on the steps that decide the run.

Credits and the ×0.4 multiplier

Every Built-in model on VM0 is priced as a multiple of Claude Sonnet 4.6, which sits at the ×1 credit baseline. GLM-5.1 bills at ×0.4 credits. The multiplier is what shows up on your VM0 invoice; the vendor list price in the pricing table above is what the upstream provider charges before VM0 converts it into credits.

GLM-5.1 bills at ×0.4, which means a step here costs only 0.4× the credits of an equivalent step on Sonnet 4.6 (the ×1 baseline). That puts it well below the credit baseline and makes it the natural pick for high-volume background work where cost-per-step matters more than peak reasoning quality.

Available on VM0 since April 2026.