Seedance 2.5 is live — 30-second cinematic video with native audio & real-person referencesfrom $0.071/s

GLM-5.2 — 1M Lossless Context, Open-Weight Coding Flagship

GLM-5.2 is Z.AI's flagship foundation model, built for the era of long-horizon tasks. GLM-5.2 reads a 1M-token context window that Z.AI describes as solid and lossless, writes up to 128K tokens back, thinks by default but lets you switch thinking off, and exposes a reasoning-effort control the rest of the GLM family does not have. On reAPI, GLM-5.2 bills about a third below Z.AI's published per-token rate on both input and output.

GLM-5.2modelglm-5.2

GLM-5.2 playground

Chat models run on the api.reapi.ai gateway, which has its own console and its own key. Open the console to run GLM-5.2 through the OpenAI-compatible Chat Completions surface.

What is the GLM-5.2 API?

GLM-5.2 is Z.AI's flagship foundation model, built for the era of long-horizon tasks and served on reAPI through an OpenAI-compatible /v1/chat/completions endpoint. It reads a 1M-token context window that Z.AI describes as solid and lossless, writes up to 128K tokens back, thinks by default but lets you switch thinking off, and is the only model in the GLM family that takes a reasoning-effort control. Billing is per 1M tokens, with input and output priced separately.

What you can build with this model

Real-world workflows and production use cases you can build and ship with this model.

GLM-5.2 producing an architecture map from an entire repository

Hand it the whole project, not a folder of excerpts

This is the case Z.AI leads with, and the one the context window exists for. GLM-5.2 keeps module boundaries, architectural constraints, API contracts, directory structure and earlier decisions in view for the length of a task, which is what stops the late stages of a long job from feeling like they were done by someone who never read the beginning. Z.AI's framing is worth quoting: the model does not merely read more context, it carries the engineering judgements it formed earlier into later execution. The way to test that on your own codebase is to ask GLM-5.2 for a technical audit — architecture map, module responsibilities, API contracts, data flows, call chains, technical debt — before you ask it to change anything.

Read the API docs
GLM-5.2 working a staged refactor across many files

Long-horizon refactoring that closes the task

Z.AI describes GLM-5.2 as more stable on cross-file, multi-step, long-chain work: it breaks the goal down, identifies dependencies and risks, then implements, verifies and closes in stages. The named fits are module decoupling, API migration, directory restructuring, SDK adaptation and cross-language refactoring — the jobs that fail not because any single edit is hard but because step forty contradicts step three. Bound the task, state what must not change, and ask GLM-5.2 for the execution plan, impact scope, risk boundaries and verification method before it starts editing.

GLM-5.2 running build, lint and tests and reporting the results

Engineering standards that actually hold under a long run

The failure mode of an autonomous coding agent is not bad code, it is scope creep: an extra dependency, a quietly changed API contract, a skipped test, a commit you did not ask for. Z.AI puts consistency on exactly these constraints — code style, architectural boundaries, dependency rules, build process, testing requirements, commit boundaries — among GLM-5.2's improvements, and specifically under long context and many rounds. Feed GLM-5.2 your real lint rules, build commands, test requirements and prohibited actions, then give it a real task and check the report against them.

Pricing

Credit-based — 1 credit = $0.001 USD. Pay only for completed generations.

First test cost
$0.9900 credits

One sample at the cheapest tier (1M tokens).

Testing budget guide
Add credits
$10
≈ 11 tests
$50
≈ 55 tests
$100
≈ 111 tests
ModelCategoryPrice
Token pricingInput
$0.9
1M tokens
Output
$3
1M tokens

Why reAPI

About a third below the published rate

Z.AI publishes a per-million-token rate for GLM-5.2 input and output. On reAPI, GLM-5.2 bills roughly a third below both — no subscription underneath it, no minimum commitment, pay-as-you-go in USD against your gateway balance. The exact numbers are in the pricing table on this page.

OpenAI-compatible drop-in

GLM-5.2 is served from a standard `/v1/chat/completions` endpoint. If your code already speaks that shape, adopting GLM-5.2 is a base URL, a key and a model string — the same SDKs work once the base URL points at the gateway. No SDK swap, no vendor-specific client.

One key across GLM, Claude, GPT and Gemini

The same api.reapi.ai key that calls GLM-5.2 calls the Claude, GPT and Gemini families too. Sending the cheap bulk of an agent's turns to GLM-5.2 and escalating only the hard ones to a closed frontier model is a model string, not a second integration, a second invoice and a second set of credentials.

GLM-5.2 vs Kimi K3

These two are the open-weight answer to the same question: a million-token context aimed at long-horizon coding, with the weights published rather than held. GLM-5.2 is the cheaper of the pair on reAPI by a wide margin, and the more forgiving to integrate — thinking is optional, sampling parameters still do something, and prior reasoning is dropped from the history unless you ask to keep it. Kimi K3 answers with modality and a stricter contract. Pick on shape, then on price.

Capability
GLM-5.2 on reAPI
Kimi K3
Weights and positioning
Open — Z.AI reports it as the strongest open-source model on coding and long-horizon benchmarks
Open — the first of the three-trillion-parameter class
Context and output limits
1M-token context described as lossless; 128K maximum output
1M-token context; output defaults lower but can be raised to the whole window
Thinking
On by default and can be disabled; when on, the model decides per request whether to think
Always on and cannot be disabled
Effort control
Accepts seven values that collapse to three real behaviours, defaulting to the deepest
Three genuine rungs, also defaulting to the deepest
Sampling parameters
Temperature and top_p both tunable, with temperature capped at 1.0
Both fixed — sending them returns an error
Input modalities
Text only — vision is a separate model in the lineup
Text, images and video

Comparison reflects behavior documented by each vendor at the time of writing. Rates are described as relationships rather than amounts; the live numbers for GLM-5.2 are in the pricing table above.

Ship GLM-5.2 in three steps

  1. step 01

    Create an account and key on api.reapi.ai

    Sign up at api.reapi.ai, open the console and generate an API key. That one key reaches GLM-5.2 and every other model on the gateway, billed from a single balance.

    Open
  2. step 02

    Point your client at the gateway

    Set your base URL to api.reapi.ai and your key to the one you just created. Any client that already speaks OpenAI Chat Completions works unchanged — no SDK swap is needed to reach GLM-5.2.

    Open
  3. step 03

    Send `glm-5.2` as the model

    Set the model field to `glm-5.2` — with the dot — and post your messages. Turn on streaming for long outputs, and remember that GLM-5.2 thinks by default at the deepest effort setting, so pick an effort level before you measure cost.

    Open
docs/api/glm-5-2

API reference

Drop-in code and the full parameter table.

curl https://api.reapi.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2",
    "group": "default",
    "messages": [
      { "role": "user", "content": "Hello" }
    ],
    "reasoning_effort": "max",
    "stream": true
  }'

Parameter validation failed

Rejected synchronously with the failing field named. Check enum values, ranges, and URL fields — nothing is charged.

Authentication or balance issue

401 means a missing or invalid Bearer key; 402 means the reserve exceeds your balance. Manage keys and credits in the console.

Content or material rejected

Reference material and outputs pass automated moderation. Rejected tasks fail with a clear error and a full refund.

Task failed or timed out

A task that reaches a failed state is never charged — the reserve refunds automatically. Keep the task id and retry when ready.

Frequently asked questions

Common questions about this model.

GLM-5.2 is billed pay-as-you-go in USD per token against your api.reapi.ai balance, with separate input and output rates and no subscription. Both land about a third below Z.AI's published per-token rate. Current numbers are in the pricing table on this page.

start building

Ready to ship?

Try it in the playground or grab an API key to integrate now.