Skip to content
Dashboard

GLM 5.2

GLM 5.2 is Z.ai's flagship open-weight model for long-horizon coding and agentic engineering, released June 16, 2026. A 1.0M tokens context window carries project-level engineering state, and selectable reasoning effort tunes depth per request.

ReasoningTool UseImplicit Caching
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'zai/glm-5.2',
prompt: 'Why is the sky blue?'
})

Frequently Asked Questions

  • What's new in GLM 5.2 compared to GLM-5.1?

    GLM 5.2 extends the context window to 1.0M tokens, up from 200K on GLM-5.1, and posts higher scores on coding benchmarks like Terminal-Bench 2.1 and SWE-bench Pro. GLM 5.2 also carries project-level engineering context across a single task and runs long-running tasks more reliably.

  • What is the context window for GLM 5.2?

    1.0M tokens.

  • Is GLM 5.2 open source?

    The weights are published under the MIT License. Through AI Gateway you call hosted providers with the zai/glm-5.2 identifier, so you get the model without managing weights or GPUs yourself.

  • Does GLM 5.2 support reasoning controls?

    Yes. You can enable or disable thinking per request and set a reasoning effort level up to max. Lower effort answers faster; higher effort spends more tokens on hard problems.

  • How does GLM 5.2 differ from GLM 5.2 Fast?

    glm-5.2-fast serves the same underlying weights on inference infrastructure tuned for higher throughput, at different per-token rates. Compare live throughput, latency, and pricing on each model's page and pick per workload.

  • What is the pricing for GLM 5.2?

    Check the pricing panel on this page for today's numbers. AI Gateway tracks rates across every provider that serves GLM 5.2.

  • Does GLM 5.2 support Zero Data Retention?

    Yes, Zero Data Retention is available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.

  • How do I access GLM 5.2 through AI Gateway?

    Use the zai/glm-5.2 model identifier with your AI Gateway API key via the AI SDK, the Chat Completions API, the Responses API, the Messages API, or other API formats. No separate Z.ai account is needed. BYOK is also supported.