GLM-5.2 API pricing vs GPT: what an open-weights flagship really costs
By LW Forge โ maintainer of LLM Scout ยท Updated August 17, 2026
GLM-5.2 is the model that makes the price question awkward. It is a 744B-parameter Mixture-of-Experts released by Z.ai in June 2026 with MIT-licensed weights, a 1M-token context window, and a list rate of $1.40 per million input tokens against GPT-5.6 Terra's $2.50. That headline is real, but it is also the least interesting number in the comparison โ the output rate, the cache rate, and the aggregator rate all move the answer more than the input price does.
The rates, as of August 4, 2026
| Model | Input / 1M | Output / 1M | Cache read | Context |
|---|---|---|---|---|
| GLM-5.2 (Z.ai direct) | $1.40 | $4.40 | $0.26 | 1M |
| GLM-5.2 (OpenRouter) | ~$0.75 | ~$2.37 | varies by host | 1M |
| GPT-5.6 Terra | $2.50 | $15.00 | $0.25 | 1.05M |
| GPT-5.6 Sol | $5.00 | $30.00 | $0.50 | 1.05M |
| Claude Sonnet 5 | $3.00 | $15.00 | $0.30 | 200k |
| Claude Opus 4.8 | $5.00 | $25.00 | $0.50 | 200k |
The OpenRouter figure was carrying a promotional discount when we checked; it sat closer to $0.93/$3.00 in July. Aggregator rates for open-weights models move week to week because they are set by whichever host is cheapest that day, so treat them as a range rather than a quote, and confirm the live number before you build a budget on it.
The output rate is where the gap actually lives
GLM-5.2 bills output at 3.1ร its input rate. GPT-5.6 bills output at 6ร, Claude at 5ร. Since almost every real workload generates far fewer output tokens than it consumes, that ratio is easy to skim past โ and it is the single biggest driver of the total.
Take a mid-sized agentic coding assistant: 300M input tokens and 40M output tokens in a month.
| Model | Input cost | Output cost | Monthly total |
|---|---|---|---|
| GLM-5.2 (OpenRouter) | $225 | $95 | $320 |
| GLM-5.2 (direct) | $420 | $176 | $596 |
| GPT-5.6 Terra | $750 | $600 | $1,350 |
| Claude Sonnet 5 | $900 | $600 | $1,500 |
| Claude Opus 4.8 | $1,500 | $1,000 | $2,500 |
| GPT-5.6 Sol | $1,500 | $1,200 | $2,700 |
Direct GLM is 2.3ร cheaper than Terra on that traffic, not the 1.8ร the input rates suggest, because output is where GPT's multiplier does the damage. Push the workload more output-heavy โ code generation, long drafts, reasoning traces you pay for โ and the ratio keeps widening in GLM's favour. Run your own token profile through the GPT vs Claude comparison and set these rates beside the result.
The cache detail that quietly narrows it
Here is the part almost nobody checks. GLM-5.2 charges $0.26 per million cached input tokens. GPT-5.6 Terra charges $0.25. In absolute terms, GLM's cache reads are more expensive than Terra's โ Z.ai's discount is roughly 81% off input, while OpenAI and Anthropic both do a flat 90%.
That matters because heavily cached workloads are exactly the ones people optimise hardest. Rerun the same 300M/40M workload with 90% of input served from cache:
| Model | Cached input | Fresh input | Output | Total |
|---|---|---|---|---|
| GLM-5.2 (direct) | $70 | $42 | $176 | $288 |
| GPT-5.6 Terra | $68 | $75 | $600 | $743 |
GLM still wins by 2.6ร, but every dollar of that lead now comes from the output rate โ the input side is a wash. If your prompt is a giant fixed system block and your replies are short labels, GLM's advantage over Terra is much smaller than the sticker suggests. How prompt caching changes the bill works through the mechanics; measure your real prefix in the token calculator before assuming which side you're on.
What you give up
Ecosystem maturity is the honest cost. Structured outputs, function calling edge cases, SDK coverage, observability integrations โ the frontier labs are ahead, and you will spend engineering time on glue you'd get free elsewhere. Routing through an aggregator adds a second variable: the host serving your request may be running a different quantisation than the one you benchmarked, so quality can drift without your prompt changing.
Data governance is the other one. Z.ai's hosted API runs under Chinese jurisdiction. For a consumer side project that may be irrelevant; for a regulated workload with residency clauses it can be disqualifying at any price. That is the real reason the open weights matter โ not that they are free, but that they are an exit.
When self-hosting actually wins
Rarely, and later than people expect. GLM-5.2 is 744B parameters; even at 8-bit you need roughly ten H100-class GPUs just to hold the weights, and realistically more like sixteen once you want KV cache room at long context. At typical cloud rates of $2-3 per GPU-hour, a node kept warm around the clock lands somewhere near $25,000-30,000 a month.
Against the $596 direct-API bill above, that is not close. You'd need roughly fifty times that traffic โ on the order of 15B input tokens a month โ before the arithmetic flips, and only if you keep utilisation near 100%. Price your own hardware assumptions in the GPU cloud cost calculator rather than trusting the ranges above.
So the sequence is: aggregator first, direct API when you need a stable provider, self-host when governance or latency forces it โ and treat the cost saving as a bonus, not the reason. If you want the same analysis on the other end of the open-weights market, Kimi K3 vs Claude Opus 4.8 covers a model with open weights and a premium price tag. For the full field, the cheapest LLM APIs of 2026 has the wider table.