Z.ai: GLM 5.2

glm-5.2

GLM 5.2 costs $0.246 per million input tokens and $0.772 per million output tokens, supports 1.05M context, and is available through the OpenAI-compatible API.

GLM-5.2 is Z.AI's flagship model for long-horizon autonomous coding and engineering workflows. It is built to plan, execute, iterate, and optimize complex development tasks over extended runs. This variant keeps thinking disabled for faster direct responses.

Modalities

Text → Text

Input / output price

$0.246 / $0.772 per 1M

Context

1.05M · max output 131K

Capabilities

ReasoningTool callingLong contextOpen weights

Pricing

Billed per token actually used and deducted from your credits.

ItemUSD per 1M tokens
Input$0.246
Output$0.772
Cached input$0.0456

Calculator

Drag the sliders to estimate what this model will cost.

Per request
$0.00135
Per day
$0.6774
Per month (30 days)
$20.32

GLM 5.2: input $0.2457/M · output $0.7722/M · cached input $0.0456/M

Request with these settings
curl https://api.geniusrelaygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.2", "max_tokens": 800,
       "messages": [{"role": "user", "content": "…"}]}'

Code samples

OpenAI-compatible. Set the base URL to https://api.geniusrelaygpt.com/v1 and the model to glm-5.2.

curl https://api.geniusrelaygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2",
    "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Use it in a client: Cursor · Cline · SillyTavern · Codex

Parameters

Common OpenAI parameters can be passed as-is.

temperaturetop_pmax_tokensstreamstoppresence_penaltyfrequency_penaltyseed

FAQ

How is GLM 5.2 billed?
Input is $0.246 and output is $0.772 per million tokens; cached input is $0.0456. The charge for every request is listed in Usage Logs in the console.
How long is the context window?
1.05M tokens. In a long conversation every turn is billed for the full input, so keep the history under control.
Does it support streaming?
Yes. Add "stream": true to the request to receive server-sent events in the OpenAI format.
GLM 5.2 API pricing · GeniusRelay