Skip to content

GLM-5.2 API Cost Calculator: Tokens, Cache and Break-Even

Independent research — not an official Z.ai publication.Identity and provider disclosure

Browser-only calculator

Estimate your monthly GLM-5.2 cost

Enter workload averages, not best-case prompt sizes. Every calculation stays in this browser.

Rates checked 2026-07-17
Lowest cash estimateWaiting for inputs
Billed attemptsRequests after the retry assumption
Monthly token volumeInput plus output after retries
Estimated monthly GLM-5.2 API cost by provider
ProviderToken usageFunding feeCash estimateDifference

Coding Plan crossover

The $18 line compares cash spend only. Coding Plan quota applies to supported coding tools, not SaaS or general API traffic.

Self-hosting floor

Uses 8× H200 SXM at $4.31 per GPU-hour for 730 hours. Storage, network, engineering and idle-capacity risk are excluded.

Capacity check

Concurrency does not change token arithmetic. Confirm RPM, TPM, latency and queue behavior with the provider before launch.
Formula and assumptions

attempts = requests × (1 + retry ratio)

cost = uncached input × input rate + cached input × cache rate + output × output rate

OpenRouter's cash estimate adds its published 5.5% pay-as-you-go credit-purchase fee. It does not model BYOK, enterprise contracts, taxes, expired credits, cache-write charges, storage, web search, or other tools.

The calculator runs entirely in your browser. It sends no workload numbers to GLM52.ai and needs no account. Each change updates the URL query string, so you can bookmark or share the same assumptions. JSON and CSV exports include the rate snapshot date and caveats.

  1. What each input means
  2. How monthly API cost is calculated
  3. How provider differences are handled
  4. Coding Plan crossover
  5. Self-hosting break-even
  6. Why concurrency remains separate
  7. A worked example
  8. What to do with the result
  9. Price sources and update policy

Count the successful user or job requests you expect before retries. If one user action launches ten independent model calls, count ten requests. Do not count HTTP streaming chunks.

Include every billed input token: system prompt, instructions, conversation history, retrieved documents, source code, tool results and formatting. Agent logs often reveal input growth that a product estimate misses.

Use a median when most requests look alike. Use separate calculations for short and long jobs when the distribution has a long tail. One average can hide a small group of one-million-token requests that drives most of the bill.

Include visible completion tokens and any provider-billed reasoning tokens. Output is the most expensive row for all three routes in this calculator. A verbose agent can erase the saving from a high cache-hit rate.

This input represents the share of all input tokens billed at the provider’s cache-read price. It does not mean the percentage of requests that repeat. A request can contain a cached prefix and a fresh suffix.

Set this to zero until request logs confirm cached_tokens. Cache keys, prefix identity, minimum length, lifetime, write price and route selection can all change eligibility.

The GLM-5.2 prompt-caching guide shows how to order a stable prefix, find usage.prompt_tokens_details.cached_tokens, and run a small acceptance test before entering a hit rate here.

Enter extra billed attempts as a percentage of successful requests. A 10% ratio turns 10,000 requested jobs into 11,000 billed attempts in this model.

Count timeouts, invalid structured output, tool-call repair, provider fallback and application retries when they reach inference. Some pre-inference 4xx errors cost nothing, but a disconnected or failed attempt can still consume tokens. Use actual billing logs when available.

Concurrency tells you how many requests may run at once. It does not change the token total by itself, so the calculator keeps it out of the cost formula. It appears in the capacity warning because one high-token request can consume a large TPM budget and a burst can hit RPM even when monthly volume is small.

The tool uses four steps:

billed attempts = monthly requests × (1 + retry ratio)
cached input = attempts × average input × cache hit rate
uncached input = attempts × average input − cached input
output = attempts × average output
usage cost =
uncached input / 1,000,000 × input price
+ cached input / 1,000,000 × cached-input price
+ output / 1,000,000 × output price

This is arithmetic, not a forecast model. The quality of the result depends on the quality of the inputs.

The calculator keeps more precision internally than it displays. It rounds visible money to cents and request thresholds to whole requests. JSON export preserves the underlying numeric values.

The July 17, 2026 rate set contains:

Route Input / MTok Cached input / MTok Output / MTok Added funding fee
Z.ai direct $1.40 $0.26 $4.40 0% in this estimate
Novita serverless $1.40 $0.26 $4.40 0% in this estimate
OpenRouter balanced route $0.9478 $0.17602 $2.9788 5.5% PAYG credit-purchase fee

Z.ai and Novita therefore produce the same token-cost total for the same inputs in this version. That does not make them the same product. Read the provider comparison for context limits, feature details, privacy, payment, rate limits and observability.

OpenRouter’s number is a dynamic catalog snapshot. The model ID can route across providers with different precision, limits and performance. Its result adds the current 5.5% pay-as-you-go funding fee to show an estimated cash cost. Existing credits, BYOK, enterprise pricing, taxes and currency conversion can change what you pay.

The calculator does not include cache writes, cache storage, web search, MCP services, storage, network egress or support plans. The Z.ai pricing page currently lists cache storage as a limited-time free item; the word “limited-time” prevents us from treating zero as a permanent price.

The crossover answers a narrow question: At this token mix, how many successful requests make the lowest metered API estimate reach $18?

The result does not say that the GLM Coding Plan will serve those requests. The plan:

  • applies to supported interactive coding tools such as Claude Code and OpenCode;
  • uses a dedicated coding endpoint;
  • has rolling five-hour and weekly quotas;
  • can apply different model consumption factors;
  • cannot replace general API traffic from a website, SaaS backend or arbitrary SDK.

Use the crossover only when your workload is interactive coding and your tool appears in the current supported list. For an application backend, compare API providers instead.

The self-host estimate starts with a transparent hardware floor:

8 H200 SXM GPUs × $4.31 per GPU-hour × 730 hours
= $25,170.40 per month

The RunPod pricing page listed the H200 SXM cluster price used above on July 17. The official vLLM recipe uses 8×H200 for the GLM-5.2 FP8 checkpoint with a 131,072-token context limit. It uses 8×B200 for the full one-million-token recipe.

The calculator compares the lowest API cash estimate with that GPU-only monthly floor. It then shows the request volume that creates equal spend at your token mix.

That is a rough cash crossover, not a complete break-even analysis. It excludes:

  • persistent storage for roughly 756 GB of FP8 weights plus images and logs;
  • network, snapshots, cold starts and failed capacity reservations;
  • orchestration, monitoring, security, patching and on-call time;
  • idle GPUs and utilization variance;
  • measured tokens per second at your context and batch size;
  • redundancy, maintenance windows and disaster recovery.

Self-hosting only wins when the server can deliver the required throughput and quality. Rent the exact target node, replay production-shaped jobs, and measure cost per accepted result before committing.

Monthly tokens determine token billing. Concurrency determines whether the route can deliver them on time.

Consider two workloads with the same 30 million tokens:

  • a nightly batch can queue requests and tolerate a long wall-clock time;
  • an interactive SaaS may need 50 simultaneous responses with a low time to first token.

Their token bills can match while their infrastructure needs differ. The calculator shows average monthly RPM only as context. It does not infer burst RPM, TPM, latency or GPU throughput from concurrency because that would require request duration and provider measurements.

Before launch, run a staged load test at 1, 2, 5, 10 and target concurrency. Record queue time, time to first token, output speed, full latency, 429s, 5xx responses and task success. Stop the test when cost or error thresholds fail.

The default inputs represent:

  • 10,000 successful requests per month;
  • 20,000 input tokens per request;
  • 2,000 output tokens per request;
  • 40% of input tokens billed as cache reads;
  • 5% additional attempts;
  • peak concurrency of 10.

The retry assumption creates 10,500 billed attempts. They consume 210 million input tokens and 21 million output tokens. Of the input, 84 million tokens use the cached-input rate and 126 million use the fresh-input rate.

At Z.ai or Novita list rates, the estimate is:

fresh input: 126 × $1.40 = $176.40
cache read: 84 × $0.26 = $21.84
output: 21 × $4.40 = $92.40
total $290.64

OpenRouter’s snapshot produces a lower token-usage total, then the calculator adds its PAYG funding fee. Change the cache rate to zero and watch the difference. Then raise retries to the rate seen in your logs. Those two controls often matter more than a small headline-price gap.

Read the Coding Plan vs API vs self-hosting decision guide. A subscription usually creates a cleaner budget for supported interactive coding, but quota behavior and peak-hour limits still matter.

Use the provider comparison and test two routes. Implement a monthly budget, a per-request token ceiling and a retry ceiling before real traffic arrives.

If the API estimate approaches the GPU floor

Section titled “If the API estimate approaches the GPU floor”

Do not buy hardware from the calculator. Follow the local deployment guide, rent a supported node, and benchmark accepted output per dollar. A dedicated endpoint or committed API contract may beat both public list pricing and raw self-hosting.

Treat cost as the second filter. Review the processor chain, data region, DPA, retention, logs, support access and incident terms. Self-host only when your own network and operations satisfy the same requirements.

Rates were checked on July 17, 2026 against:

Every exported result includes the rate snapshot date. Recalculate after a price change; a shared URL preserves inputs, not an old rate table.

This calculator contains affiliate links to Z.ai, Novita, and RunPod for three distinct result paths: supported coding tools, hosted API access, and GPU testing. GLM52.ai may receive compensation after qualifying purchases or usage. The calculator does not rank providers by commission, and the relationships do not change its formulas or decision thresholds. Provider terms control all rates, credits, capacity, discounts, and eligibility.