All insights

Pricing and plans

GLM API Pricing: Token Costs and Workload Examples

Compare Z.AI’s listed GLM-4.6 and GLM-5.2 input, output, and cached-input prices in USD per million tokens, with reproducible cost examples.

Illustration for GLM API Pricing: Token Costs and Workload Examples

Z.AI’s pricing page lists GLM-4.6 at $0.60 per million input tokens and $2.20 per million output tokens, and GLM-5.2 at $1.40 per million input tokens and $4.40 per million output tokens. For both models, the page lists cached input at a lower rate: $0.11/M tokens for GLM-4.6 and $0.26/M for GLM-5.2. These are Z.AI’s listed API rates in USD; don’t apply one model’s rate to another. (Z.AI pricing)

GLM API prices at a glance

Listed rates, USD per 1 million tokens on Z.AI’s pricing page: (Z.AI pricing)

Model Input Cached input Output
GLM-4.6 $0.60 $0.11 $2.20
GLM-5.2 $1.40 $0.26 $4.40

The same page lists cached-input storage as limited-time free. It doesn’t specify an end date for that offer, so treat the storage charge as subject to change and confirm the live pricing before budgeting. The rates above are per-token-category prices, not a subscription fee. (Z.AI pricing)

How input, output, and cached tokens are billed

Input tokens are the tokens sent to the model; output tokens are the tokens it generates. Z.AI describes context caching as automatic recognition of repeated context, with examples including system prompts and conversation history. The Chat Completion documentation shows cached-token counts in the response under usage.prompt_tokens_details.cached_tokens. (Z.AI context caching; Chat Completion response)

Repeated context does not guarantee that every token will be cached. Use the cached-token count reported in the response when estimating actual cache billing. (Chat Completion response)

GLM API cost examples

Use this formula for a basic estimate:

Input tokens ÷ 1,000,000 × input rate + output tokens ÷ 1,000,000 × output rate

For a workload with 1 million input tokens and 200,000 output tokens, using the listed rates:

Model and input assumption Calculation Estimated cost
GLM-4.6, ordinary input 1 × $0.60 + 0.2 × $2.20 $1.04
GLM-4.6, all input cached 1 × $0.11 + 0.2 × $2.20 $0.55
GLM-5.2, ordinary input 1 × $1.40 + 0.2 × $4.40 $2.28
GLM-5.2, all input cached 1 × $0.26 + 0.2 × $4.40 $1.14

These are arithmetic estimates based on Z.AI’s listed per-million rates—not measured bills. The cached examples assume all 1 million input tokens qualify for the cached-input rate; use the cached-token count in the API response to estimate actual cache billing. (Z.AI pricing; Chat Completion response)

For example, if only 600,000 of the GLM-5.2 input tokens are cached, the input portion would be 0.6 × $0.26 + 0.4 × $1.40 = $0.716. Add the same output cost, 0.2 × $4.40 = $0.88, for an estimated total of $1.596, or about $1.60. This example assumes the remaining 400,000 input tokens are billed at the ordinary rate.

Choosing the right GLM rate

Check the exact model ID your application calls, then use that model’s row: GLM-4.6 and GLM-5.2 have different listed rates. If you use another provider or API channel, check its pricing separately rather than assuming Z.AI’s rates apply. For more context, see the GLM API pillar guide.

Sources

Z.AI Developer Documentation: Pricing

Z.AI Developer Documentation: Context Caching

Z.AI Developer Documentation: Chat Completion

GLM API pillar guide

Contact us