Skip to content
OpenKey

GLM 5.2

Z.aiReleased Jun 16, 2026

GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...

Try in playground
Context window
1.0M tokens
Max output
33K tokens
Input
text
Output
text
Tokenizer
Other
Released
Jun 16, 2026
Reasoning
optional

Pricing

Per 1M tokens. The provider price and our flat 3% fee are separate columns — what you pay is their sum.

Per 1M tokensProvider+ 3% feeYou pay
Input$0.930$0.028$0.958
Output$3.00$0.090$3.09
Cache read$0.180$0.0054$0.185

Benchmarks

Artificial Analysis

Intelligence index
51.1
Coding index
68.8
Agentic index
43.1

Design Arena

CategoryEloWin rateRank
androidnativeagents124055.3%#8
Full-stackagents129864%#3
htmlslidesagents120652.7%#8
Mobile appsagents124354%#5
python-pptxslidesagents122150.1%#5
Web appsagents128357.5%#3
3Dmodels137664.3%#1
Codemodels136062%#1
Data vizmodels132759.9%#4
Game devmodels135761.2%#2
UI componentsmodels133458.8%#5
Websitesmodels135761.7%#1

Head-to-head preference voting. How we filter and rank

Supported parameters

  • frequency_penalty
  • include_reasoning
  • logit_bias
  • logprobs
  • max_tokens
  • min_p
  • parallel_tool_calls
  • presence_penalty
  • reasoning
  • reasoning_effort
  • repetition_penalty
  • response_format
  • seed
  • stop
  • structured_outputs
  • temperature
  • tool_choice
  • tools
  • top_k
  • top_logprobs
  • top_p

Call it

OpenAI-compatible: point your SDK at api.openkey.ai/v1 and use model z-ai/glm-5.2.

Code sample language
curl https://api.openkey.ai/v1/chat/completions \
  -H "Authorization: Bearer $OPENKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.2",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.openkey.ai/v1",
    api_key=os.environ["OPENKEY_API_KEY"],
)

completion = client.chat.completions.create(
    model="z-ai/glm-5.2",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.openkey.ai/v1",
  apiKey: process.env.OPENKEY_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "z-ai/glm-5.2",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);

Questions

How much does GLM 5.2 cost via API?
Through OpenKey, GLM 5.2 costs $0.958 per 1M input tokens and $3.09 per 1M output tokens. That is the provider price ($0.930 / $3.00) plus a flat 3% fee — nothing else.
What is GLM 5.2's context window?
GLM 5.2 accepts up to 1.0M tokens of context and returns up to 33K tokens per request.
Is GLM 5.2 OpenAI-compatible?
Yes. Send requests to OpenKey's /v1/chat/completions endpoint with model "z-ai/glm-5.2" using any OpenAI SDK — only the base URL and API key change.
What inputs does GLM 5.2 support?
GLM 5.2 accepts text input and produces text output.

More from Z.ai

All Z.ai models →