← All providers

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.

Verified 2026-08-14 source

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 modelInputCached inputOutputBatchVerified
GLM-5.1$0.600/MUnavailable — no model cache rate$2.200/MUnavailable2026-06-19
GLM-5.2$1.400/MUnavailable — no model cache rate$4.400/MUnavailable2026-06-19

Messages API vs OpenAI compatibility map

ChoiceDecision ruleEvidence
BillingChatGPT plan never includes API creditsSeparate metered API account
Input/cached/outputToken prices are model rowsUse calculator for workload totals
Limits/authPer-model concurrency caps by account tier · Bearer API keyVerify before production

Adoption map: what is documented versus unavailable

DimensionRecorded valueDecision consequence
Try Z.ai side by side →

Verified 2026-08-14. dated provider pricing/source

Current models
1
Legacy models
1
Price range /M
$2.15–$2.15
Max context
1M
Median tok/s
Next retirement

Z.ai model pricing

Compare Z.ai models by input, output, and blended token cost below.

ModelInput /MOutput /MBlended /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
GLM-5.1$1.00/M blended

Best for

Muse Spark 1.3 Contributor is our pick for CodingMuse Spark 1.3 Contributor is our pick for Structured Data ExtractionMuse Spark 1.3 Contributor is our pick for Writing & ContentGLM-5.2 is our pick for Math & ReasoningMuse Spark 1.3 Contributor is our pick for Agents & Tool Use

Related Z.ai pages

Z.ai alternatives →All LLM API pricing →Z.ai speed benchmarks →

Build with Z.ai

Z.ai rate limits →

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-compatibleYes
API base URLhttps://api.z.ai/api/paas/v4
Auth modelBearer API key
Prompt cachingNot documented
Batch discountNot documented
Free tierFree trial credits for new accounts
Free-tier limitsTrial credits are limited to eligible new accounts; amount and expiry vary by account.
Free-tier expiryNot published
Rate-limit modelPer-model concurrency caps by account tier
Data residencyNot documented
Trains on API dataNot documented
SLA publishedNo
DocsOfficial pricingFree-tier terms

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 fixtureInputs and observationFormula / boundaryState
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 fixtureInputs and observationFormula / boundaryState
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 fixtureInputs and observationFormula / boundaryState
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