Speed
Output tokens / second
Custom pricing for production workloads
Z.AI's most powerful language model yet. GLM-5.1 doesn't just generate answers, it plans, executes, iterates, and delivers. Built for long-horizon autonomous tasks with a 200K context window and 128K token output capacity.
It aligns with the very best global models like Claude Opus 4.6 while excelling where it matters most: long-horizon planning, iterative optimization, and end-to-end delivery.
zhipu/glm-5.1https://api.aimlapi.com/v1GLM-5.1 is the latest flagship model from Z.AI (formerly Zhipu AI), the Chinese AI lab behind the GLM family of large language models. It marks a meaningful shift in how modern AI models are evaluated, not just on single-turn intelligence, but on how long they can work autonomously on a complex, multi-stage goal.
Where most language models are optimized for fast, isolated interactions, GLM-5.1 is purpose-built for tasks that require sustained effort: multi-hour engineering workflows, iterative optimization loops, and production-grade deliverables that span dozens of dependent steps. The model can plan, execute, encounter errors, course-correct, and finish without needing a human to hold its hand at each checkpoint.
In terms of raw capability, GLM-5.1 is benchmarked against the world's best. On overall performance, it aligns closely with Claude Opus 4.6, making it one of the few models genuinely competitive at the frontier level. On coding specifically, particularly on real-world software engineering tasks, it surpasses all other models on SWE-Bench Pro with a score of 58.4.
| Model Name | GLM-5.1 | Developer | Z.AI (Zhipu AI) |
| Model Family | GLM-5 Series | Positioning | Flagship Foundation |
| Input Modality | Text | Output Modality | Text |
| Context Length | 200,000 tokens | Max Output Tokens | 128,000 tokens |
GLM-5.1's SWE-Bench Pro score of 58.4 is a new state-of-the-art result, outperforming GPT-5.4, Claude Opus 4.6, and Gemini 3.1 Pro. This benchmark tests real GitHub issue resolution on production codebases, arguably the most demanding proxy for real-world software engineering ability available today.
GLM-5.1 ranks among the world's top-tier models in both overall ability and coding performance. Overall performance aligns with Claude Opus 4.6, while coding performance on SWE-Bench Pro surpasses every other model in the world, setting a new state-of-the-art. Across 12 representative benchmarks spanning reasoning, coding, agents, tool use, and browsing, the model demonstrates a broad, balanced capability profile, not a narrow spike.
GLM-5.1 shows especially strong improvements on long-horizon tasks, with major gains in sustained execution, closed-loop optimization, and engineering delivery under complex objectives. Under standardized evaluation, it is one of the few models capable of 8-hour autonomous execution and the first Chinese model to reach that level. This isn't just about a longer context window. It's about the model staying on-task across hundreds of decisions without losing the plot.
GLM-5.1's most significant breakthrough is its ability to form a genuine "experiment → analyze → optimize" loop in long-horizon tasks, rather than stopping at one-shot generation. The model can proactively run benchmarks, identify bottlenecks, adjust strategy, and iterate. In practice: it built a complete Linux desktop system from scratch in 8 hours, autonomously ran 655 optimization iterations on a vector database, and achieved a 3.6× geometric mean speedup on KernelBench Level 3, dramatically exceeding what torch.compile max-autotune achieves.
Six high-value use cases where GLM-5.1's combination of sustained execution, reasoning depth, and creative output genuinely outperforms lighter-weight alternatives.
GLM-5.1 is documented as suited to complex coding and long-running agentic work, including tasks that require sustained planning, execution, and iterative optimization.
It is also documented as suited to open-ended question answering, complex instruction following, and multi-turn conversation, where stronger instruction adherence and long-context understanding are useful.
It is further documented as suited to document production tasks such as PPT, Word, PDF, and Excel creation, especially for long documents, reports, textbooks, and papers that require structured output and layout design.
A fourth documented use case is real engineering work with multi-stage dependencies, where the model is described as appropriate for complex programming problems and long-horizon development tasks.
See how GLM-5.1 compares in generation speed and latency. Data retrieved Nov 3, 2026.
Output tokens / second
Compare 9 models available on AI/ML API across 5 independent benchmarks.
Expert-written questions across academic subjects.
Graduate-level science questions written to resist web search.
Agentic tasks completed in a command-line environment.
Reasoning across long documents of about 100k tokens.
Python coding tasks drawn from scientific research.
| Usage | Price | Unit |
|---|---|---|
| Input | $1.4 | 1M tokens |
| Output | $4.4 | 1M tokens |
| Cached input | $0.26 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $1.4 | $4.4 | |
| $0.15 | $0.5 | |
| $0.37 | $1.25 | |
| $1.4 | $4.4 | |
| $3.5 | $11 |
Give your agent the model details, code and documentation.
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "zhipu/glm-5.1",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "zhipu/glm-5.1",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "zhipu/glm-5.1",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());GLM-5.1 has a 200,000 tokens context window and can return up to 128,000 tokens.
GLM-5.1 takes text as input and returns text.
Use zhipu/glm-5.1 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
GLM-5.1 became available on April 8, 2026.
GLM-5.1 costs $1.4 input and $4.4 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Yes, GLM-5.1 can stream responses as they are generated.
GLM-5.1 was built by Zhipu AI.