Zhipu GLM

GLM-5.2 API

CN Zhipu GLM | released 2026-07 | knowledge cutoff 2026-04
Try in Playground → Get API key

GLM-5.2 is Zhipu AI’s flagship model, purpose-built for the long-task era. It supports a massive 1M-token context window with 128K max output, native tool use, and strong multilingual reasoning. An excellent choice for long-document analysis, multi-step agents, and coding tasks that span many files.

ReasoningCodeTool UseJSON ModeFlagship

Pricing (official list, per 1M tokens)

Input
$1.14/M
Output
$4.00/M

Specifications

Context window1000K tokens Max output128K tokens Input modalitiesText StreamingYes APIOpenAI-compatible

How to use GLM-5.2

Drop-in OpenAI replacement. Change only the base_url and model.

# Python -pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://meshtok.com/v1",
    api_key="sk-your-MeshTok-key",
)

resp = client.chat.completions.create(
    model="bigmodel/glm-5.2",
    messages=[{"role":"user","content":"Hello!"}],
)
print(resp.choices[0].message.content)
# cURL
curl https://meshtok.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-MeshTok-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"bigmodel/glm-5.2","messages":[{"role":"user","content":"Hello!"}]}'

Related models

Other models you might consider.