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

GLM-5.1 Released 2026-04-07

Z.ai chat code reasoning tools long-context
Input$1.4/M
Output$4.4/M
Cache read$0.26/M
Context200K
vs GPT-4o~72% cheaper

Provider list prices: no platform markup, pay-as-you-go. These are official list prices. Logged-in customers may see effective prices including workspace discounts on /console/pricing. Effective input at a 70% cache-hit rate:$0.602/M. Automatic prompt caching: repeated prompt prefixes bill at the cache-hit rate shown in the pricing table, no code changes required.

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

Works autonomously up to 8 hours
Experiment-analyze-optimize loop over single-pass generation
Covers planning through testing and delivery

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.

  • 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.
  • The model offers a 200K context window with up to 128K output tokens, plus thinking modes and function calling.
  • Synthorai exposes GLM-5.1 behind its OpenAI-compatible endpoint for drop-in integration.

Specs & limits

Max output (vendor spec)131,072
Modalitiestext → text
Parameters744B total · 40B active (MoE)
Featurestools · structured_output · streaming · reasoning · caching
LicenseMIT ↗
NotableNext-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.
Prompt cachingautomatic

per Z.ai official docs ↗

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, plus experiment-analyze-optimize loop over single-pass generation and 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

Get your free API key Compare your cost →