Skip to main content
GLM-5.2 is Zhipu AI’s flagship model for the long-task era, available through AnyFast via an OpenAI-compatible interface. It pairs a genuinely usable 1M-token context window with open-source SOTA coding performance — strong enough to take a project from requirements all the way to deployable, multi-platform artifacts in a single long-running task.

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 effortreasoning_effort tunes 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. When thinking.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.