GLM-5.2

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

PropertyValue
Model IDz-ai/glm-5.2
Context window1,000,000 tokens
Streaming
Function calling
Structured output
Batch API

Pricing

ModelInput ($/M)Output ($/M)
GLM-5.2--

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://openapi.linkwo.ai/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)