New Sign up free, 10 calls on us. Up to $1, no card needed.
This model has been retired from the live catalogue; the information below is archived. The vendor recommends migrating to glm-5.2.

GLM-5.1

Released 2026-04-07

chatCodeReasoningTool callingPrompt caching

GLM-5.1 is Z.AI's flagship foundation model designed for long-horizon tasks, officially described as able to work continuously and autonomously on a single task for up to 8 hours, covering planning, execution, testing, fixing, and delivery.

Input
text $1.4/M
Output
text $4.4/M
Cache read
$0.26/M
Context
200K
vs GPT-4o
~72% cheaper

Price in context

Where the price sits among 60 comparable models

Input$1.4/M
$0.05 · Qwen3 VL Flash GPT-5.4 Pro · $30
Output$4.4/M
$0.275 · DeepSeek V4 Flash GPT-5.4 Pro · $180
Cached read$0.26/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 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. No reasoning_effort control: that is documented as GLM-5.2 only.
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
  • Next-gen agentic-engineering flagship (744B-A40B): works autonomously up to 8 hours in a single run across thousands of tool calls
  • 200K context / 128K max output

per Z.ai official docs ↗

Use GLM-5.1 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.1",
    messages=[{"role": "user", "content": "Summarize this diff"}],
    reasoning_effort="medium",
)
print(resp.choices[0].message.content)

About GLM-5.1

  • Building on GLM-5, it emphasizes an experiment-analyze-optimize loop rather than single-pass generation, enabling autonomous exploration, continuous improvement, and stable delivery in complex engineering environments.
  • Z.AI's framing of the upgrade is about endurance rather than peak ability: where the previous release plateaus early in an agentic loop, GLM-5.1 is documented as sustaining optimization over hundreds of rounds and thousands of tool calls, with better judgment on ambiguous problems.
  • The model offers a 200K context window with up to 128K output tokens, plus thinking modes and function calling.
  • Named workloads run beyond code to general dialogue, creative writing, front-end and artifact generation, and office productivity.
  • Thinking is switched through the same thinking object as the rest of the line and defaults to letting the model decide, with the trace returned in a separate reasoning_content field; note that the reasoning-effort control Z.AI later added is documented as GLM-5.2-only, so this model has no effort dial.
  • MCP tools, streaming, JSON output and automatic prefix caching are all supported, and weights are published under the MIT License.
  • Synthorai exposes GLM-5.1 behind its OpenAI-compatible endpoint for drop-in integration.

FAQ

Is the GLM-5.1 API free to try?

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

What is GLM-5.1 best at?

Works autonomously up to 8 hours; experiment-analyze-optimize loop over single-pass generation; covers planning through testing and delivery. See the About section for the full picture from the vendor's own release notes.

How much does GLM-5.1 cost?

GLM-5.1 costs $1.4 per million input tokens and $4.4 per million output tokens on Synthorai. That is the provider's list price, with no platform markup. Cached input tokens bill at $0.26/M.

Does GLM-5.1 support prompt caching?

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

How do I get access to GLM-5.1?

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

Is GLM-5.1 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 →