PL Log inOpen Studio
Preview version. Model catalog, prices, calculator and docs are live. Generation goes live at launch.

Chat & code Z.ai · 2026-06

GLM-5.2

Z.ai's open-weight model that plans first, then builds and checks multi-file work over a 1M-token context

Input$1.22per 1M tokens
Output$4.05per 1M tokens

Example: 1,000 replies$3.44each one 1,500 tokens in, 400 out

This model has no separate cache rate: cached tokens cost the same as input. A failed request is $0.

Set it against other chat models →

GLM-5.2 is a lower-cost pick for coding agents that need to stay on track across a long job. Z.ai released it in June 2026 as an open-weight mixture-of-experts model with roughly 753 billion parameters. Its docs describe a work style that suits multi-file projects: break the goal down, spot dependencies and risks, then build and verify step by step.

Z.ai says the model stays stable across its full 1M-token context during long tasks.

What you can use it for

  • Software changes that span a whole project, not one file
  • Agent jobs where a written plan should come before any action
  • Long documents where other models lose the thread halfway
  • A cheaper engine for coding agents that burn through tokens
  • Teams that prefer open weights for future self-hosting

Settings and limits

  • Context window: 1,000,000 tokens; output up to 131,072 tokens.
  • Z.ai reworked the attention design to lower compute per token at 1M context, but every token you send is still billed.
  • Pass only the files the task needs instead of the whole repository.
  • Ask for the plan explicitly in the prompt so you can review it before the model starts editing.

Example request

python
from openai import OpenAI

client = OpenAI(
    base_url="https://kadraris.com/v1",
    api_key="sk-kd-...",
)
resp = client.chat.completions.create(
    model="glm-5.2",
    messages=[{"role": "user",
               "content": "Plan, then implement, a CSV "
                          "export across these 4 files."}],
)
print(resp.choices[0].message.content)

Paste the relevant files after the instruction and name the ones that must not change.

Questions

How much does GLM-5.2 cost?

$1.22 / $4.05 per 1M tokens on Kadraris, well under the flagship closed models. That gap adds up on long agent runs where token counts climb fast. A failed call costs $0.

Should I use GLM 5.3 instead?

glm-5.3 is Z.ai's newer flagship with a larger context and much longer outputs. Keep GLM-5.2 if your prompts already work well on it, and compare both on one real task before switching.

GLM-5.2 in your code

from openai import OpenAI

client = OpenAI(base_url="https://kadraris.com/v1", api_key="sk-kd-...")
resp = client.chat.completions.create(
    model="glm-5.2",
    messages=[{"role": "user", "content": "Suggest three opening shots for a short film about a cafe."}],
)
print(resp.choices[0].message.content)