To calculate GLM API costs, multiply your monthly input tokens by the model's input rate and your output tokens by the output rate, then add them: for GLM-4.6 that is $0.43 per million in plus $1.74 per million out (measured via OpenRouter). The formula is simple arithmetic; the part most buyers get wrong is estimating the token volumes that feed it, so this guide grounds every number in costs we actually billed.
A GLM bill has exactly two moving parts: input tokens and output tokens, each priced per million. The formula is:
monthly cost = (input_tokens / 1,000,000 × input_rate)
+ (output_tokens / 1,000,000 × output_rate)
The word "blended" matters because input and output carry very different rates. On GLM-4.6, output costs roughly four times input. So a workload that reads long documents and writes short answers behaves nothing like one that takes a short prompt and generates a long essay, even at identical total token counts. Estimate the two streams separately, never as a single lumped number.
Here are the per-million rates we use as the calculator's inputs. The GLM rows are the live OpenRouter-routed values we verified on 2026-06-26; we lead with these because they are what you actually pay when you reach GLM through OpenRouter rather than a native key.
| Model | Input ($/1M) | Output ($/1M) | Source |
|---|---|---|---|
| GLM-4.6 | $0.43 | $1.74 | measured via OpenRouter |
| GLM-4.5-Air | $0.13 | $0.85 | measured via OpenRouter |
| GLM-4.7-Flash | $0.06 | $0.40 | measured via OpenRouter |
| GLM-5-Turbo | $1.20 | $4.00 | measured via OpenRouter |
| DeepSeek V4-Flash | $0.14 | $0.28 | official api.deepseek.com |
According to Z.ai pricing, the official GLM-4.6 rate is higher than the routed figure above, at $0.60 input and $2.20 output per million, and GLM-4.5-Air is $0.20 input and $1.10 output. The routed path undercutting the vendor's own list price is a recurring pattern worth budgeting around, but treat the official figures as pending native-key re-verification. Whichever path you choose, the formula does not change; only the two rates you plug in do.
Say you run a customer-support assistant on GLM-4.6: 800 input tokens and 400 output tokens per call, one million calls a month. Input is 800M tokens, output is 400M tokens.
Input cost is 800 × $0.43 = $344. Output cost is 400 × $1.74 = $696. The monthly total lands at $1,040, and notice that output alone is two-thirds of it despite being half the token volume. That asymmetry is the single most useful thing the blended formula tells you: on GLM-4.6, trimming output length saves more than trimming input.
Swap the same workload onto GLM-4.5-Air and the math shifts hard. Input becomes 800 × $0.13 = $104, output 400 × $0.85 = $340, for $444 total. The lighter tier is roughly 57% cheaper here, which is why picking the model is a budgeting decision before it is a quality one.
Formulas estimate; billed receipts confirm. When we called these endpoints through OpenRouter on 2026-06-26, the per-call costs the platform actually charged were these:
| Model (via OpenRouter) | In / Out tokens | Billed cost | Latency |
|---|---|---|---|
| GLM-4.6 (general) | 32 / 200 | $0.00036376 | 8.58s |
| GLM-4.6 (coding) | 30 / 165 | $0.0002972 | 3.78s |
| GLM-4.5-Air (general) | 32 / 200 | $0.00017374 | 8.07s |
| GLM-4.7-Flash (general) | 31 / 200 | $0.000103875 | 26.24s |
| GLM-5-Turbo (general) | 31 / 200 | $0.0008372 | 7.66s |
Two cautions came straight out of running these calls, and both affect a budget you build from the formula. First, every general-purpose call hit a 200-token output cap, so treat that completion length as a test ceiling, not a natural answer size; a real reply that runs long will bill more output than our receipts show. Second, GLM-4.7-Flash, the cheapest tier, was the slowest call in the entire set at 26.24 seconds, far behind GLM-4.6's 8.58 seconds. The "flash" label describes price position, not latency. If you size capacity off a flash tier expecting speed, your budget assumptions about concurrency and timeouts will be wrong.
We re-checked the GLM-4.6 receipt against the rate card to be sure the arithmetic holds: 32 input tokens at $0.43/M is $0.0000138, 200 output at $1.74/M is $0.000348, summing to $0.00036, which matches the $0.00036376 billed within rounding. The formula reproduces the receipt, which is exactly the confidence a budget needs.
A GLM API cost calculator is a budgeting tool that turns token volumes into a dollar figure using each model's per-million rates. Run the same support-chat workload (800 in / 400 out, 1M calls) through DeepSeek V4-Flash and the numbers are strikingly lower: 800 × $0.14 = $112 input, 400 × $0.28 = $112 output, $224 total against GLM-4.6's $1,040.
That gap is real but the comparison is not apples to apples, and the asymmetry is the part most buyers miss. According to DeepSeek API Docs, DeepSeek's $0.14/$0.28 is a native first-party rate from its own endpoint, while our GLM figures are OpenRouter-routed. You are comparing a vendor-direct price to a routed price, so weigh routing reliability and native features alongside the headline dollars. For a deeper DeepSeek breakdown, see our DeepSeek API pricing hub.
One genuinely free option exists on the GLM side. According to Z.ai pricing, GLM-4.7-Flash and GLM-4.5-Flash carry a free tier on the Z.ai international platform at zero cost in and out, which OpenRouter does not match (it charges $0.06/$0.40 for 4.7-flash). If your prototype tolerates the latency variance we measured, that free tier can zero out a development budget entirely. Verify it against the native platform before relying on it for production.
How do I calculate GLM API costs? Multiply input tokens (in millions) by the input rate and output tokens by the output rate, then add. For GLM-4.6 that is input × $0.43 + output × $1.74 per million, measured via OpenRouter. Estimate input and output volumes separately because output costs about four times input.
What does GLM-4.6 cost per million tokens? $0.43 input and $1.74 output per million when measured via OpenRouter. Z.ai's official list price is higher at $0.60/$2.20 and is pending native-key re-verification. We billed $0.00036376 for a 32-in/200-out test call, matching the formula.
Is GLM cheaper than DeepSeek? No, not on a like workload. A 800-in/400-out support call at 1M/month is about $1,040 on GLM-4.6 (via OpenRouter) versus $224 on DeepSeek V4-Flash (official $0.14/$0.28). DeepSeek's native rate undercuts the routed GLM price substantially.
Is there a free way to use GLM? Yes. According to Z.ai, GLM-4.7-Flash and GLM-4.5-Flash have a free tier on the Z.ai international platform. In our tests the flash tier was the slowest call at 26.24 seconds, so budget for latency variance rather than speed.
Why do my billed costs differ from my formula estimate? Usually because output ran longer than estimated. Our test calls hit a 200-token output cap, so real answers that run long bill more output. Always size output volume generously since on GLM-4.6 output is the dominant cost.
This is part of the GLM API pricing hub, which collects the full rate card and our first-hand test methodology.
Author: Kevin Fan, Customer Success Manager at China LLM Directory, specializing in Chinese LLM ecosystem pricing and AI infrastructure cost modeling. Last verified: 2026-06-26.
<!-- METADATA { "title": "How to Calculate GLM API Costs (2026 Guide)", "slug": "glm-api-cost-calculator", "meta_description": "Calculate GLM API costs with a blended formula: GLM-4.6 at $0.43/$1.74 and GLM-4.5-Air at $0.13/$0.85 via OpenRouter. First-hand billed costs verified 2026-06.", "focus_keyword": "glm api cost calculator", "secondary_keywords": ["glm api cost", "calculate glm api pricing", "glm-4.6 cost per million tokens", "glm api budget", "glm-4.5-air cost"], "tags": ["GLM", "Zhipu", "API Pricing", "Cost Calculator"], "category": "Pricing", "cluster_id": "glm-api-pricing", "cluster_role": "micro", "hub_slug": "glm-api-pricing", "evidence_file": "clients/china-llm-aggregator/articles/glm-api-pricing-evidence.json", "needs_native_reverify": true, "verified_until": "2026-09-24", "author_name": "Kevin Fan", "author_title": "Customer Success Manager", "author_linkedin": "", "author_expertise": ["Chinese LLM ecosystem", "AI infrastructure pricing", "model benchmarking", "cross-border AI compliance"], "faq_pairs": [ {"q": "How do I calculate GLM API costs?", "a": "Multiply input tokens (in millions) by the input rate and output tokens by the output rate, then add. For GLM-4.6 that is input x $0.43 + output x $1.74 per million, measured via OpenRouter. Estimate input and output volumes separately because output costs about four times input."}, {"q": "What does GLM-4.6 cost per million tokens?", "a": "$0.43 input and $1.74 output per million when measured via OpenRouter. Z.ai's official list price is higher at $0.60/$2.20 and is pending native-key re-verification. We billed $0.00036376 for a 32-in/200-out test call, matching the formula."}, {"q": "Is GLM cheaper than DeepSeek?", "a": "No, not on a like workload. An 800-in/400-out support call at 1M/month is about $1,040 on GLM-4.6 (via OpenRouter) versus $224 on DeepSeek V4-Flash (official $0.14/$0.28). DeepSeek's native rate undercuts the routed GLM price substantially."}, {"q": "Is there a free way to use GLM?", "a": "Yes. According to Z.ai, GLM-4.7-Flash and GLM-4.5-Flash have a free tier on the Z.ai international platform. In our tests the flash tier was the slowest call at 26.24 seconds, so budget for latency variance rather than speed."}, {"q": "Why do my billed costs differ from my formula estimate?", "a": "Usually because output ran longer than estimated. Our test calls hit a 200-token output cap, so real answers that run long bill more output. Always size output volume generously since on GLM-4.6 output is the dominant cost."} ], "external_links_used": [ {"url": "https://z.ai/model-api", "source_name": "Z.ai Model API Pricing", "claim": "Official GLM-4.6 $0.60/$2.20, GLM-4.5-Air $0.20/$1.10, and free Flash tier (GLM-4.7-Flash / GLM-4.5-Flash) on Z.ai international"}, {"url": "https://api-docs.deepseek.com/quick_start/pricing/", "source_name": "DeepSeek API Docs - Pricing", "claim": "DeepSeek V4-Flash native first-party rate $0.14 input / $0.28 output per million"} ], "internal_links_used": [ {"url": "/blog/glm-api-pricing/", "anchor_text": "GLM API pricing hub", "type": "hub"}, {"url": "/blog/deepseek-api-pricing/", "anchor_text": "DeepSeek API pricing hub", "type": "cross-cluster"} ], "first_hand_evidence": { "source": "glm-api-pricing-evidence.json runs glm-4.6_general, glm-4.5-air_general, glm-4.7-flash_general, glm-5-turbo_general, glm-4.6_coding", "measured": "GLM-4.6 32in/200out $0.00036376 8.58s (via OpenRouter); GLM-4.5-Air 32in/200out $0.00017374 8.07s; GLM-4.7-Flash 31in/200out $0.000103875 26.24s (slowest); GLM-5-Turbo 31in/200out $0.0008372 7.66s; all general calls hit 200-token output cap", "captured": "2026-06-26" }, "images_status": "spec-only (not generated; FAL_API_KEY unset)", "images": [ {"position": "featured", "type": "generated", "prompt": "Clean editorial diagram of a GLM API cost formula: input tokens times input rate plus output tokens times output rate, with GLM-4.6 and GLM-4.5-Air rate cards stacked beside a worked monthly total. Annotate that output dominates the bill. Blue and amber palette, minimal background, 16:9.", "alt": "Editorial diagram of the GLM API blended-cost formula with GLM-4.6 and GLM-4.5-Air rate cards and a worked monthly total showing output as the dominant cost"} ] } -->