GLM 5.2 (Alibaba) API

Alibaba · serves glm-5.2

Pricing

Input / 1M$2.31
Output / 1M$7.26
Blended / 1M$9.57
Cached input / 1M$0.46
Context window1,048,576 tokens
Max output131,072 tokens
LicenseOpen weights · MIT permissive
Knowledge cutoffJanuary 2026 · source
Intelligence index52.6 Artificial Analysis Intelligence Index · source

textfunction-calling

Price verified 2026-09-03 (1 day ago) · sourcesources disagree

Sources

Sources disagree by 39% on this price. The figure above is the primary source; cross-check before relying on it.

SourceInput / 1MOutput / 1MVerified
OpenRouter$2.31$7.262026-09-03
LiteLLM$1.40$4.402026-09-03
models.dev$1.40$4.402026-09-04

Independent sources disagree — treat with caution.

Cheaper providers for glm-5.2

ProviderBlended / 1MEndpoint
OpenRouter$0view →
Baidu$1.479view →
Novita AI$1.711view →

Compare all 22 providers serving glm-5.2 →

Call it

Served via OpenRouter, pinned to Alibaba — the provider these prices are resolved from. Set OPENROUTER_API_KEY. Provider page.

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.2",
    "messages": [{"role": "user", "content": "Hello"}],
    "provider": {"only": ["Alibaba"], "allow_fallbacks": false}
  }'
from openai import OpenAI  # pip install openai

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="...",  # OPENROUTER_API_KEY
)
resp = client.chat.completions.create(
    model="z-ai/glm-5.2",
    messages=[{"role": "user", "content": "Hello"}],
    extra_body={"provider": {"only": ["Alibaba"], "allow_fallbacks": false}},
)
print(resp.choices[0].message.content)

Price unchanged since 2026-09-03 — 1 point on record.

Use this data

Raw JSON for this page: glm-5.2.json. Free to reuse under CC BY 4.0 with attribution to apipriceindex.com.