GLM-5.2 API
Z.ai's GLM-5.2 for coding agents with a 1M-token context
About this model
GLM-5.2 is a text-only model from Z.ai, released in mid-June 2026. Z.ai’s launch materials highlight a 1-million-token context window, up to 131,072 output tokens and two reasoning-effort levels, and it targets coding agents.
It precedes the GLM-5.3 generation and follows GLM-5.1, whose context window is about 200,000 tokens. Choose GLM-5.2 for very long text inputs when you do not need image input.
In this catalog it is text-only with a context window of up to 1,000,000 tokens.
Use cases
- Coding agents
- Long-context analysis
- Complex reasoning
Input and output
- Input
- Text
- Output
- Text
Developer
Z.ai (Zhipu AI)
Official site of Z.ai (Zhipu AI)- Developer
- Z-AI
- Type
- Conversation
- Context
- 1,000,000 tokens
GLM-5.2 request example
Use https://gatelum.com/v1 as the base URL and pass z-ai/glm-5.2 in the model field. You create the key in your account after signing up.
curl --silent --show-error --fail-with-body \
--header 'Authorization: Bearer glt_YOUR_KEY' \
'https://gatelum.com/v1/chat/completions' \
--header "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"model": "z-ai/glm-5.2",
"messages": [
{
"role": "user",
"content": "Hi! Tell me about yourself in two sentences."
}
]
}
JSONClaude Code and Anthropic-protocol clients
For clients using the Anthropic protocol, point the address at ANTHROPIC_BASE_URL=https://gatelum.com with no /v1. The model ID does not change.
export ANTHROPIC_BASE_URL=https://gatelum.com
export ANTHROPIC_AUTH_TOKEN=glt_YOUR_KEY
export ANTHROPIC_MODEL=z-ai/glm-5.2
claudeWhere to use GLM-5.2
Guides with step-by-step instructions for the tools that support this model: