Key capabilities
- OpenAI-compatible — Works as a drop-in replacement with the OpenAI SDK
- 1M context window — Solid, lossless 1M-token context that stays stable on long-horizon tasks, not just nominal length
- 128K max output — Generates up to 128K tokens in a single response
- Thinking mode — Chain-of-thought reasoning (forced thinking when enabled on GLM-5.2)
- Adjustable reasoning effort —
reasoning_efforttunes how hard the model thinks - Open-source SOTA coding — Top-ranked open model on long-horizon coding benchmarks, comparable to the strongest closed models
- Function calling, structured output & MCP — Robust tool use, JSON output, and MCP tool/data-source integration
- Streaming — Real-time token streaming via SSE
Output specifications
Quick example
Thinking mode
GLM-5.2 supports a chain-of-thought thinking mode. Whenthinking.type is enabled (the default), GLM-5.2 always thinks before answering. Set it to disabled to skip reasoning for lightweight tasks.
Python
reasoning_effort controls how hard the model reasons (effective only when thinking is enabled). GLM-5.2 accepts max, xhigh, high, medium, low, minimal, and none; for compatibility, none/minimal make the model skip thinking, low/medium map to high, and xhigh maps to max. Default: max.
Parameters
API Reference
View the interactive API playground for GLM-5.2.