Coding Plan crossover
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.
| Provider | Token usage | Funding fee | Cash estimate | Difference |
|---|
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.
On this page
Section titled “On this page”- What each input means
- How monthly API cost is calculated
- How provider differences are handled
- Coding Plan crossover
- Self-hosting break-even
- Why concurrency remains separate
- A worked example
- What to do with the result
- Price sources and update policy
What each input means
Section titled “What each input means”Monthly requests
Section titled “Monthly requests”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.
Average input tokens
Section titled “Average input tokens”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.
Average output tokens
Section titled “Average output tokens”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.
Cache hit rate
Section titled “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.
Retry ratio
Section titled “Retry ratio”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.
Peak concurrency
Section titled “Peak concurrency”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.
How monthly API cost is calculated
Section titled “How monthly API cost is calculated”The tool uses four steps:
billed attempts = monthly requests × (1 + retry ratio)
cached input = attempts × average input × cache hit rateuncached input = attempts × average input − cached inputoutput = 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 priceThis 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.
How provider differences are handled
Section titled “How provider differences are handled”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.
Coding Plan crossover
Section titled “Coding Plan crossover”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.
Self-hosting break-even
Section titled “Self-hosting break-even”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 monthThe 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.
Why concurrency remains separate
Section titled “Why concurrency remains separate”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.
A worked example
Section titled “A worked example”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.40cache read: 84 × $0.26 = $21.84output: 21 × $4.40 = $92.40total $290.64OpenRouter’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.
What to do with the result
Section titled “What to do with the result”If you use Claude Code or OpenCode
Section titled “If you use Claude Code or OpenCode”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.
If you run a website or SaaS
Section titled “If you run a website or SaaS”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.
If private data drives the choice
Section titled “If private data drives the choice”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.
Price sources and update policy
Section titled “Price sources and update policy”Rates were checked on July 17, 2026 against:
- Z.ai’s official API pricing;
- Novita’s GLM-5.2 model page;
- OpenRouter’s public model catalog and pricing page;
- Z.ai Coding Plan overview;
- RunPod GPU pricing;
- official vLLM GLM-5.2 recipe.
Every exported result includes the rate snapshot date. Recalculate after a price change; a shared URL preserves inputs, not an old rate table.
Affiliate disclosure
Section titled “Affiliate disclosure”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.
