models
GLM-5.2
GLM-5.2 — next-gen flagship model with 1M context and advanced reasoning.
GLM-5.2 is a sparse MoE foundation model developed by Zhipu AI, featuring a stable 1M-token lossless context window and optimized IndexShare sparse attention. Equipped with dual-depth reasoning modes, it achieves state-of-the-art open-source performance in coding, autonomous agent workflows and long-document comprehension.
Quick Reference
| Property | Value |
|---|---|
| Model ID | z-ai/glm-5.2 |
| Context window | 1,000,000 tokens |
| Streaming | ✓ |
| Function calling | ✓ |
| Structured output | ✓ |
| Batch API | ✓ |
Pricing
| Model | Input ($/M) | Output ($/M) |
|---|---|---|
| GLM-5.2 | $1.14 | $4.00 |
Strengths
- 1M context window — Lossless long-context processing
- Dual-depth reasoning — Optimized for complex multi-step reasoning
- Agentic workflows — State-of-the-art autonomous agent capabilities
- Open source — Released under MIT license
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.2",
messages=[
{"role": "user", "content": "Analyze this research paper and summarize key findings: ..."}
]
)
print(response.choices[0].message.content)Related
- GLM-5.1 — Agentic engineering flagship
- Model Overview — All available models