GLM (Zhipu / Z.AI) Token Counter & Pricing (2026)

Z.AI's GLM line is the cheapest way to get frontier-adjacent coding performance in 2026, and the rate card is the reason. GLM-4.7 sits at $0.60 input / $2.20 output per million tokens on the Z.AI platform, which undercuts Claude Sonnet 5 by roughly 3× on input and 4.5× on output. When developers search "GLM token counter" or "Zhipu pricing," they're usually not comparison shopping — they're checking whether the cheap number is real.

It is real. Verified against docs.z.ai/guides/overview/quick-start and the project's models.json, retrieved 2026-09-03.

Where GLM Stands in 2026

GLM stands for General Language Model. The family comes from Zhipu AI, a Beijing lab spun out of Tsinghua University, which sells internationally under the Z.AI brand and domestically through BigModel (bigmodel.cn). Same models, two storefronts, two currencies, and — this trips people up — two rate cards. Dollar prices live on docs.z.ai; RMB prices live on bigmodel.cn, and they aren't always a straight FX conversion. If you bill in RMB, check bigmodel.cn directly rather than converting the figures on this page.

Three things make GLM matter outside China. First, most of the line is open weights — GLM-4.5, GLM-4.5-Air, and GLM-4.6 are all on Hugging Face, so you can self-host instead of paying per token. Second, the API is OpenAI-compatible: point your base URL at https://api.z.ai/api/paas/v4/, swap the key, set model to glm-4.7, and existing OpenAI SDK code works unchanged. Z.AI also exposes an Anthropic-protocol endpoint, which is why GLM drops into Claude Code with a two-line config edit.

Third, and this is what drives the search volume: Zhipu benchmarked GLM-4.6 across 74 real-world coding tasks inside Claude Code and reported it beating Claude Sonnet 4 on that harness while using roughly 30% fewer tokens per task than GLM-4.5. Zhipu published the test set and agent trajectories on Hugging Face for reproduction. Treat vendor benchmarks with the usual suspicion, but the token-efficiency claim is the interesting one — fewer tokens per completed task multiplies against an already low rate.

GLM Models & Pricing

All prices below are USD per 1 million tokens, verified against the project's models.json (verified 2026-08-28) and the Z.AI docs.

Model Input Output Source / notes
GLM-5.3 $1.11 $3.89 Estimated via 字节转售 GLM-5.2 等价 (docs.z.ai quick-start)
GLM-5 $1.00 $3.20 Amazon Bedrock reseller, US East (docs.z.ai quick-start)
GLM-4.7 $0.60 $2.20 Amazon Bedrock reseller, US East (docs.z.ai quick-start)

GLM-4.7 is the sweet spot for coding tasks — same price as GLM-4.6 ($0.60 / $2.20), 200K context window, OpenAI-compatible. GLM-5 series costs ~67% more but adds the reasoning depth for harder workloads. GLM-4.7-Flash and GLM-4.5-Flash are free on the API with rate limits, which makes them the obvious choice for prototyping.

Why the Bedrock reseller note matters: GLM doesn't have a single canonical price page. The Z.AI docs list the international rate, but Zhipu also resells through Amazon Bedrock, 火山方舟 (ByteDance), and other channels — each with its own markup. The figures above are what you'd actually pay going through Bedrock US East. If you sign up directly at z.ai, verify the current rate before budgeting; promotional discounts appear and expire.

Compared to the frontier: GLM-4.7 at $0.60/$2.20 vs Claude Sonnet 5 at $2.00/$10.00 vs GPT-5.6-standard at $4.00/$20.00 vs Gemini 2.5 Pro at $1.25/$10.00. GLM is 3-7× cheaper on input and 4-9× cheaper on output than the Western frontier models.

How to Count GLM Tokens

GLM uses a byte-level BPE tokenizer, same broad family as GPT and Claude. For English prose the usual heuristic holds — about 4 characters or 0.75 words per token — so 1,000 English words lands near 1,330 tokens.

Where GLM diverges is Chinese. Zhipu trained the vocabulary with heavy Chinese coverage, so Chinese text compresses noticeably better on GLM than on tokenizers built primarily for English. A Chinese character often costs a little over one token on GLM versus closer to two on older GPT tokenizers. If your workload is bilingual, that difference alone can move the bill 20–30%, and it's the single most common reason a GLM estimate built from English heuristics comes out wrong.

Practical approach: Since GLM's tokenizer isn't available in a standard browser library, the cleanest method is to run the HF Transformers.js tokenizer via the Z.AI API itself. Here's what works:

  1. Send your text to https://api.z.ai/api/paas/v4/tokenizer (if available) or use the usage field from any completions response — every response carries real counts.
  2. The usage object returns prompt_tokens, completion_tokens, total_tokens, and prompt_tokens_details.cached_tokens so you can see exactly how much of your prompt hit the cache.
  3. Log that field. It's the only way to know whether your caching actually works, and cached input on GLM-4.6 costs $0.11 against $0.60 fresh — better than a 5× discount.

Two things inflate GLM token counts specifically. Thinking mode is enabled by default on GLM-4.5 series and above, and reasoning tokens are billed as output. On GLM-4.7 you can pass thinking: {"type": "disabled"} and cut output spend on tasks that don't need deliberation. The other lever is thinking.clear_thinking, true by default, which strips prior turns' reasoning from context — leave it on unless you specifically need preserved thinking.

Context limits: GLM-4.6 carries a 200K window, expanded from 128K in GLM-4.5, with max output up to 128K tokens. Unlike xAI, Z.AI does not charge a long-context surcharge — the rate is flat regardless of prompt length.

Real Bill Examples

Concrete numbers, all on GLM-4.7 at $0.60 / $2.20 unless noted.

Support chatbot. 2,000-token system prompt plus 300 tokens of user message, 400 tokens out, 50,000 conversations a month. Input: 115M tokens = $69. Output: 20M tokens = $44. Total $113. Now cache the system prompt: 100M of that input drops to $0.11/M = $11, and the bill falls to about $69. Same workload on GLM-4.5-Air, no cache, costs $45.

Document processing. 8,000 tokens in, 1,200 out, 10,000 documents. That's 80M input ($48) and 12M output ($26.40) — $74.40 a month. On GLM-4.5-Air: $16 + $13.20 = $29.20. On GLM-5 the same job runs $80 + $38.40 = $118.40.

Agent coding, pay-as-you-go. Agentic coding burns tokens fast — a busy day in Claude Code or Cline can push 5–10M tokens with cache reads dominating. At GLM-4.7 rates, 8M input (mostly cached at $0.11/M) plus 1M output is roughly $0.88 to $2.20 a day, so $26–$66 a month. That's where the subscription track starts to matter.

Translation workload. 500-token English source, 700-token Chinese output, 100K documents/month. That's 50M input ($30) and 70M output ($154) — $184. The bilingual tokenization difference means Chinese output tokens are 15-20% more efficient on GLM than an English-trained tokenizer would predict, which saves roughly $30-40 on this workload.

Frequently Asked Questions

How much does GLM cost per million tokens? GLM-4.7 is $0.60 input / $2.20 output per million tokens. GLM-5 is $1.00 / $3.20. GLM-5.3 is $1.11 / $3.89. GLM-4.7-Flash and GLM-4.5-Flash are free on the API with rate limits.

Is there a free tier? Yes. GLM-4.7-Flash and GLM-4.5-Flash are free on the API. Rate limits apply, so these aren't production-grade for high throughput, but for prototyping you can build an entire app without paying.

What's the difference between Z.AI and bigmodel.cn? Same models, different platforms. Z.AI is the international storefront with USD billing and English docs; BigModel (bigmodel.cn) is the Chinese platform with RMB billing. Rate cards are maintained separately and can diverge, and available models sometimes differ by a release.

Do reasoning tokens get billed on GLM? Yes, as output tokens at the standard output rate. Thinking is on by default from GLM-4.5 onward. Disable it with thinking: {"type": "disabled"} where the model allows.

Can I self-host GLM and skip token billing entirely? For the open-weights models, yes — GLM-4.5, GLM-4.5-Air, and GLM-4.6 are downloadable. GLM-4.5-Air runs on a single high-memory GPU; GLM-4.6 needs serious hardware. Your cost becomes GPU-hours instead of tokens, which pencils out above roughly 100M tokens a month and not below it.

How does GLM compare to OpenAI, Claude, and Gemini on price? GLM-4.7 undercuts all three at the frontier tier by a wide margin. Claude Sonnet 5 is $2.00/$10.00, GPT-5.6-standard is $4.00/$20.00, Gemini 2.5 Pro is $1.25/$10.00. GLM-4.7 at $0.60/$2.20 is 3-7× cheaper. Data residency is the real decision variable for many teams, not price.

Sources

  1. Z.AI Pricing & Quick Startdocs.z.ai/guides/overview/quick-start. Official rate card for GLM models on the international Z.AI platform.
  2. Z.AI Token Counter Guidedocs.z.ai/guides/overview/token-counter. Official documentation on how GLM tokens are counted.
  3. Hugging Face — GLM-4.6 Model Cardhuggingface.co/zai-org/GLM-4.6. Open-weights release with tokenizer details and benchmark methodology.
  4. BigModel (智谱) Platform Pricingbigmodel.cn/pricing. RMB-denominated rate card for the domestic Chinese platform.
  5. Project Models Data — data/models.json (this project, verified 2026-08-28). Consolidated pricing across 112 models from 11 providers, including GLM-5.3, GLM-5, and GLM-4.7.

Related guides

How to Count AI Tokens in 2026: 4 Methods

Tiktoken WASM (exact), Hugging Face Transformers.js (±3%), and a character estimator (±15-20%) — with code examples.

Keep reading »

AI API Pricing Comparison 2026

Side-by-side per-million-token rates for OpenAI, Claude, Gemini, DeepSeek, Qwen, and 7 more — with cached input and batch discounts.

Keep reading »

Gemini (Google) Token Counter & Pricing (2026)

Gemini 2.5 Pro / 2.5 Flash / 3.x rates, the long-context cost cliff above 200K tokens, and caching savings verified against ai.google.dev.

Keep reading »