models
GLM-5.1
GLM-5.1 — next-generation flagship model for agentic engineering with significantly stronger coding.
GLM-5.1 is a next-generation flagship model for agentic engineering with significantly stronger coding capabilities. It achieves state-of-the-art performance on SWE-Bench Pro and excels at repo generation and real-world terminal tasks. Unlike previous models that plateau quickly, GLM-5.1 sustains optimization over hundreds of rounds and thousands of tool calls.
Quick Reference
| Property | Value |
|---|---|
| Model ID | z-ai/glm-5.1 |
| Context window | 200,000 tokens |
| Max output | 8,192 tokens |
| Streaming | ✓ |
| Function calling | ✓ |
| Structured output | ✓ |
| Batch API | ✓ |
Pricing
| Type | Price |
|---|---|
| Input | $0.12 / 1M tokens / 1M tokens |
| Output | $0.48 / 1M tokens / 1M tokens |
Strengths
- Agentic engineering — State-of-the-art on SWE-Bench Pro
- Code generation — Significantly stronger coding and repo generation
- Chinese language — Outstanding Chinese understanding and generation
- Iterative reasoning — Sustains optimization over hundreds of rounds
Example
from openai import OpenAI
client = OpenAI(
base_url="https://api.atrouter.cn/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="z-ai/glm-5.1",
messages=[
{"role": "user", "content": "请用中文解释量子计算的基本原理"}
]
)
print(response.choices[0].message.content)Related
- GLM-5 — 744B model for systems engineering
- Model Overview — All available models