GLM-5.2
Long-horizon coding and agentic engineering, at a lower price.
GLM-5.2 is Z.ai's flagship for long-horizon coding and agentic engineering, with a million-token context — the cheaper sibling of GLM-5.3 for work that runs long.
- Agentic coding
- Long context
- Balanced cost
Model details
- Context window
- 1M tokens
- Max output
- 128K tokens
- Input
- Text
- Output
- Text
- Capabilities
- Reasoning, Tool calling, Streaming, JSON output
- Interfaces
- OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses
Pricing
Prices use the units shown below. No gateway fees. Usage, size and model options may affect the total.
| Metric | Price |
|---|---|
| / 1M input tokens | $1.4 |
| / 1M output tokens | $4.4 |
| / 1M cached input tokens | $0.26 |
| / web search | $0.01 |
Why teams pick it
- Flagship coding and agentic engineering
- 1M-token context for whole-repo work
- Reasoning and tool calling included
Call GLM-5.2
GLM-5.2 answers on any of the APIs below — pick the one your code already speaks and just swap in your Cloakray key.
/v1/chat/completionsOpenAI-style Chat Completions · openai SDK or plain HTTP
curl https://api.cloakray.com/v1/chat/completions \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'/v1/messagesAnthropic-style Messages · @anthropic-ai/sdk SDK or plain HTTP
curl https://api.cloakray.com/v1/messages \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'/v1/responsesOpenAI-style Responses · openai SDK or plain HTTP
curl https://api.cloakray.com/v1/responses \
-H "Authorization: Bearer ckr_..." \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"input": "Hello"
}'Conversation compaction is also available at POST /v1/responses/compact.
More from Z.ai
GLM-5.3A coding-first flagship with a million-token context.$0.77 in · $2.42 outCogView-4CogView-4 for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.$0.01 / requestGLM-4 32B (0414-128k)GLM-4 32B (0414-128k) for OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.$0.1 in · $0.1 out