Models/glm-5.2
Model Code
glm-5.2
Try now

Model overview

Text generationDeep thinking

GLM-5.2 is Zhipu AI's flagship model for long-horizon tasks. It supports 1M-token context, strong logical reasoning, long-document understanding, and code generation, with balanced performance and inference efficiency for intelligent interaction, enterprise applications, and developer assistance.

Company: Zhipu AIProvider: Alibaba Cloud

Model capabilities

Input modalityT
Output modalityT
Model experience
Function calling
Structured output
Web search-
Prefix completion-
Context cache
Batch inference
Fine-tuning-

Model pricing

Input$1.19/1M tokens
Input (cache hit)$0.2985/1M tokens
Output$4.18/1M tokens

Rate limits and context

Maximum input length1M
Maximum input length (thinking mode)1M
Context length1M
Maximum output length128K
Maximum output length (thinking mode)128K
Maximum reasoning length128K
RPM500
TPM2000000

API reference

EndpointPOST /v1/chat/completions
SDKOpenAI-compatible

API code examples

Get API Key
from openai import OpenAI

client = OpenAI(
    api_key="$WLROUTER_API_KEY",
    base_url="https://api.wlrouter.com/v1"
)

response = client.chat.completions.create(
    model="glm-5.2",
    messages=[
        {"role": "user", "content": "Reply with one short sentence."}
    ],
    max_tokens=32
)

print(response.choices[0].message.content)