GLM 5.2 API
Model ID: glm-5.2 · Developer: Zhipu AI · Available on 7API: yes, as of 2026-11-20
Call GLM 5.2 with any OpenAI- or Anthropic-compatible client. Use base URL https://7api.st/v1 (OpenAI) or https://7api.st (Anthropic) and send "model": "glm-5.2".
Specifications
| Model ID | glm-5.2 |
| Context window | 1,000,000 tokens |
| Max output | 65,536 tokens |
| Input | Text |
| Tool calling | Yes |
| Streaming | Yes |
| Reasoning effort | Model default |
| API formats | Chat Completions, Responses, Anthropic Messages |
Pricing
| USD per 1M tokens | |
|---|---|
| Input | $0.06 |
| Output | $0.06 |
| Cached input | $0.017 |
For example, an agent turn with 150,000 cached input tokens, 2,000 new input tokens and 800 output tokens costs about $0.0027 on GLM 5.2. Billing is pay per token from a prepaid balance. See Pricing and billing.
Example
from openai import OpenAI
client = OpenAI(base_url="https://7api.st/v1", api_key="YOUR_7API_KEY")
r = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Write a haiku about caching."}],
)
print(r.choices[0].message.content)In Claude Code: /model claude-glm-5.2. Setup guides: Claude Code, OpenCode, Codex, Cursor.
Related models
- GLM 5.3: $0.05/M, $0.01/M cached, 1M context
- GLM 5.3 Uncensored: $0.05/M, $0.01/M cached, 1M context
- GLM 5.3 Flash: $0.025/M, $0.0025/M cached, 1M context
- GLM 5.3 Flash Uncensored: $0.025/M, $0.0025/M cached, 1M context
- GLM 5.3 Abliterated: $0.80/M, $0.25/M cached, 1M context
