Z.ai API Pricing, Models & Rate Limits (2026)
Z.ai (formerly Zhipu AI) trains the GLM family and serves its coding-first flagship, GLM-5.2, directly on open weights at a 1M-token context window — priced well below closed frontier models from the larger US labs.
Also known as: Zhipu AI, GLM.
How much does the Z.ai API cost?
Z.ai API pricing is usage-based and varies by model and token volume. Use the current model table and provider documentation to estimate a workload before committing to production.
For cross-provider quota units and fixed-workload capacity, see the LLM API rate-limit comparison; this page remains the authoritative owner for Z.ai provider facts.
Z.ai product vs API
Z.ai consumer access and API billing are separate surfaces; check the provider documentation for current account terms.
Three decisions unique to Z.ai
Z.ai current-model price mechanics
| Current model | Input | Cached input | Output | Batch | Verified |
|---|
| GLM-5.1 | $0.600/M | Unavailable — no model cache rate | $2.200/M | Unavailable | 2026-06-19 |
|---|
| GLM-5.2 | $1.400/M | Unavailable — no model cache rate | $4.400/M | Unavailable | 2026-06-19 |
|---|
Messages API vs OpenAI compatibility map
| Choice | Decision rule | Evidence |
|---|
| Billing | ChatGPT plan never includes API credits | Separate metered API account |
|---|
| Input/cached/output | Token prices are model rows | Use calculator for workload totals |
|---|
| Limits/auth | Per-model concurrency caps by account tier · Bearer API key | Verify before production |
|---|
Adoption map: what is documented versus unavailable
| Dimension | Recorded value | Decision consequence |
|---|
Try Z.ai side by side →Verified 2026-08-14. dated provider pricing/source →
Price range /M
$2.15–$2.15
Z.ai model pricing
Compare Z.ai models by input, output, and blended token cost below.
| Model | Input /M | Output /M | Blended /M |
|---|
| GLM-5.2 | $1.40 | $4.40 | $2.15 |
Pricing values are registry-backed and were most recently verified on 2026-06-19. Sources: https://z.ai/model-api. Model detail pages preserve each model's own title and verification date.
* Blended comparison assumes 3 input tokens for every output token; it is not the provider's billing unit.
1 legacy Z.ai model
Best for
Build with Z.ai
Z.ai implementation details
Verified 2026-08-14 against source.
Z.ai publishes its current authentication, limits, and data-handling details in the linked documentation.
| OpenAI-compatible | Yes |
| API base URL | https://api.z.ai/api/paas/v4 |
| Auth model | Bearer API key |
| Prompt caching | Not documented |
| Batch discount | Not documented |
| Free tier | Free trial credits for new accounts |
| Free-tier limits | Trial credits are limited to eligible new accounts; amount and expiry vary by account. |
| Free-tier expiry | Not published |
| Rate-limit model | Per-model concurrency caps by account tier |
| Data residency | Not documented |
| Trains on API data | Not documented |
| SLA published | No |
Lifecycle
Z.ai has 1 legacy model still routable. Full dates and successors on the model deprecation tracker.
Switching to and from Z.ai
The closest parity-aware alternative to
GLM-5.2 ($2.15/M) outside Z.ai is
Grok 4.3 ($1.56/M, -27.3%) — a
config migration.
Full Z.ai alternatives comparison →Calling Z.ai through All AI Ask
curl https://allaiask.com/api/v1/chat \
-H "Authorization: Bearer $ALLAIASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.2", "messages": [{"role": "user", "content": "Hello"}]}'FAQ
Is Z.ai OpenAI-compatible?
Yes — Z.ai's API base (https://api.z.ai/api/paas/v4) accepts the OpenAI SDK request/response shape, so existing OpenAI client code works with a base-URL and key swap.
Does Z.ai support prompt caching?
Not documented as of 2026-08-14 — we did not find a published prompt-caching feature for Z.ai. If that changes, this page updates.
Does Z.ai have a free tier?
Yes — Free trial credits for new accounts. Trial credits are limited to eligible new accounts; amount and expiry vary by account.
How much does the Z.ai API cost?
Current Z.ai models range from $2.15 to $2.15 per million blended tokens (3:1 input:output). Full per-model pricing is in the table below.
Where is Z.ai API data hosted?
Not documented as of 2026-08-14 — no published data-residency commitment found for Z.ai.
Batch 48 · zai provider adoption evidence. Surface verification: 2026-08-14. Missing joins are deliberately published as Unavailable.
Z.ai product–endpoint–entitlement map
Frozen Batch 48 zai fixture: General pay-as-you-go, coding plan, resource package, Anthropic-compatible, region, and unsupported pairings. First-party evidence checked 2026-08-14; unresolved joins fail closed. Formula / decision rule: eligible = product ∧ endpoint ∧ protocol ∧ key class ∧ allowance owner ∧ model visibility
| Frozen fixture | Inputs and observation | Formula / boundary | State |
|---|
batch48-zai-m1-r1 general pay-as-you-go · GLM API | product=general API; endpoint=api.z.ai/api/paas/v4; protocol=GLM/OpenAI-shaped; key=API; balance=prepaid; workload=chat The general key and prepaid owner join to the GLM API endpoint. | pass = product ∧ endpoint ∧ key ∧ balance ∧ model Coding subscriptions do not inherit this prepaid balance. | PASS — general API qualified. |
batch48-zai-m1-r2 coding plan · resource package · Anthropic-compatible | product=coding; endpoint=code.z.ai; protocol=agent; key=subscription; allowance=coding; Anthropic endpoint=compatible; model=Unavailable Coding and compatible surfaces have distinct owners; no model visibility is asserted for the subscription key. | surface pass = product-specific key ∧ endpoint-specific entitlement Protocol compatibility does not merge products. | UNAVAILABLE — entitlement/model join missing. |
batch48-zai-m1-r3 alternate official region · unsupported credential-surface pair | region=international; endpoint=api.z.ai; key=mainland; balance=prepaid-CN; error=credential_region_mismatch; correction=regional key The key and endpoint regions disagree; correction is a regional credential, not a retry. | eligible = region(key) = region(endpoint) ∧ balance owner = product Do not copy mainland credentials to the international endpoint. | FAIL CLOSED — regional entitlement mismatch. |
Provenance: Frozen Batch 48 zai fixture: module 1 observation and calculation. First-party evidence checked 2026-08-14; unresolved joins fail closed. Surface verification date: 2026-08-14. Z.ai developer docs (first-party source)
GLM model-mode contract registry
Frozen Batch 48 zai fixture: General chat, always-on/optional thinking, coding agent, vision, long output, and tool fixtures. First-party evidence checked 2026-08-14; unresolved joins fail closed. Formula / decision rule: mode pass = endpoint/model/version ∧ accepted = effective ∧ envelope evidence
| Frozen fixture | Inputs and observation | Formula / boundary | State |
|---|
batch48-zai-m2-r1 general chat · always-on reasoning | endpoint=general; model=GLM-5.2; version=2026-08; mode=always-on; context=1M; output=64K; tools=joined The frozen GLM revision exposes the reasoning mode and joined long-context/tool evidence. | pass = mode ∧ context ∧ output ∧ tool evidence all same revision A GLM alias revision change reopens the contract. | PASS — revision-scoped. |
batch48-zai-m2-r2 optional thinking · coding agent · vision | endpoint=coding; model=GLM-4.7; version=2026-07; thinking=optional; vision=accepted; tools=schema joined; account=coding Optional thinking and vision are accepted on the coding fixture with a coding account. | effective = accepted control ∧ account entitlement ∧ endpoint support General API accounts cannot claim coding-agent access. | PASS WITH GATE — coding account required. |
batch48-zai-m2-r3 long output · tool-heavy | endpoint=general; model=GLM-5.2; output request=48K; tools=8; schema=sha256:2f71; stream=joined; lifecycle=Unavailable All tool IDs and stream events join, but lifecycle evidence for the alias is absent. | promote = output ∧ all tools ∧ stream ∧ lifecycle state Capability cannot transfer across host or GLM revision. | UNAVAILABLE — lifecycle evidence missing. |
Provenance: Frozen Batch 48 zai fixture: module 2 observation and calculation. First-party evidence checked 2026-08-14; unresolved joins fail closed. Surface verification date: 2026-08-14. Z.ai developer docs (first-party source)
Subscription-versus-general-API isolation canary
Frozen Batch 48 zai fixture: Same key, wrong key, exhausted allowances/balance, endpoint swap, concurrency, and workload routing. First-party evidence checked 2026-08-14; unresolved joins fail closed. Formula / decision rule: route = account ∧ product ∧ key hash ∧ endpoint ∧ debit source; absent join → Unavailable
| Frozen fixture | Inputs and observation | Formula / boundary | State |
|---|
batch48-zai-m3-r1 same key · endpoint swap | account=acct-z9; key hash=sha256:11aa; general=accepted; coding=denied; endpoint swap=observed; debit=prepaid The same credential is valid only on its general product; coding endpoint rejects it. | retry = same product ∧ same debit source ∧ idempotent request Endpoint swap cannot be treated as a harmless base-URL change. | FAIL — product boundary observed. |
batch48-zai-m3-r2 exhausted coding allowance · exhausted prepaid balance | coding error=allowance_exhausted; general error=balance_exhausted; request IDs=req-zc/req-zg; retry=not eligible Distinct debit sources produce distinct terminal errors. | retry eligible only for transient error ∧ nonterminal debit state Do not retry exhausted allowance as a rate throttle. | FAIL CLOSED — replenish named account owner. |
batch48-zai-m3-r3 concurrent coding sessions · general workload on coding surface | sessions=3; concurrency=Unavailable; coding key hash=sha256:77bd; workload=general chat; error=surface_mismatch Concurrency is unknown and the workload is misrouted to the coding product. | admit = known cap ∧ workload product = key product Unknown capacity is not an admission grant. | UNAVAILABLE — live coding cap required. |
Provenance: Frozen Batch 48 zai fixture: module 3 observation and calculation. First-party evidence checked 2026-08-14; unresolved joins fail closed. Surface verification date: 2026-08-14. Z.ai developer docs (first-party source)
Try zai through the Batch 48 route →Try Z.ai for free
Run real prompts against every current Z.ai model, and every other provider on this site, in one workspace.
Try It Free