GLM 5.4 Token Counter & API Cost Calculator
Estimate GLM Coding Plan credits and tier capacity from prompt and output tokens, check your context budget, and model metered API costs separately.
| Plan model | Credits / request | Max turns / 5h | Weekly credits used (7d) | Tier fit |
|---|
| Model | Single request | Monthly cost | Context fit | Decode at 75 / 200 tok/s |
|---|
Coding Plan credits follow Z.ai DevPack multipliers (4.6 / 1.1 / 16 vs GLM-5.3’s 6.9 / 1.7 / 24). Standalone GLM 5.4 metered API rates remain pending; USD rows model comparison scenarios. The GLM-5 list scenario uses its published $0.20 per million cached-input tokens.
Estimate GLM Coding Plan credits
Use the GLM 5.4 token counter to estimate Coding Plan credits for Lite ($18/month), Pro ($80/month) or Max ($168/month). Enter measured token counts or paste a text prompt, then enter the expected output and cached input. Cached input is included in total input. Leave the loop adjustment off to compare models on the same token mix.
A 50,000-token prompt with 40,000 cache hits and 4,000 output tokens uses 15.40 credits with GLM 5.4 and 23.30 with GLM-5.3. In the Pro tier, 12,000 credits cover up to 779 such GLM 5.4 requests in one 5-hour window. At the off-peak rate, the same request uses 7.70 credits and the window covers up to 1,558 turns, before other usage. The weekly limit applies separately. See GLM 5.4 Coding Plan pricing for the source and formula.
How the GLM 5.4 token counter estimates input
The GLM 5.4 token counter estimates the input from Unicode character counts and the format you choose. English prose starts at four characters per token. Code mode uses 3.2 for non-CJK code points. Han, Hiragana, Katakana and Hangul use 1.5 characters per token. The CJK-heavy mode applies that last ratio to the whole sample. The result rounds up once after the component estimates are added.
The counters describe the pasted text. Character counts use Unicode code points, so a composed emoji may contain several characters by this measure. Line counts follow line breaks and include a trailing blank line. Word counts group letters and digits and count CJK-script characters individually as a rough segmentation convention. The selected format changes the token estimate only.
Provider tokenizers split text by vocabulary, and two providers can report different usage for the same string. Indentation, punctuation, rare identifiers, emoji and mixed scripts can make the error larger. For a budget near a limit, use the usage record from the client or endpoint. Paste mode does not model image, video or PDF tokenization.
Use measured usage in monthly workload mode
The GLM 5.4 token counter can use provider-reported input and output counts directly. Choose Token Sliders / Monthly Workload, enter the token counts and set requests per day. Number fields provide precise control when long sliders make adjacent values hard to select. For the API scenario table, the calculator multiplies the per-request price by daily requests and 30 days.
Count the complete prompt sent by the client. Include system and developer instructions, conversation history, tool results and any attached material the endpoint converts to tokens. Sum costs request by request for a multi-step job that resends the same repository context. A single row for the whole job may miss repeated input or put the total on the wrong side of a pricing threshold.
Worked example: 50,000 input and 4,000 output
With zero cache hits and GLM-5’s published $1.00 input and $3.20 output per million as scenario inputs, the GLM 5.4 estimate comes to $0.0628 per request. The 12% loop setting changes the budget to 3,520 output tokens and the modeled cost to $0.061264. At 20 requests a day, this is about $36.76 per 30 days. The GPT-5.4 uncached base rate gives $0.185 per request, or $111 per month at the same volume, before other provider fees.
How the calculator treats prices and caching
The GLM 5.4 token counter treats the standalone public API rate as pending while letting you test published baselines and custom quotes. Its Z.ai GLM-5 list, aggregator low and GLM-5.3 parity presets are comparison inputs. The GLM 5.4 pricing page identifies the sources and distinguishes subscriptions, published API prices and sample rates.
The cached-input field is capped at total input. The GLM-5 list preset applies its published $0.20 cache-read rate. Other GLM 5.4 scenarios assume no discount for cache reads. GPT-5.4 uses its $0.25 base cache-read rate. According to the OpenAI model documentation, requests over 272,000 input tokens use double input pricing and 1.5× output pricing for the full session. The tool doubles the cached-input charge in that tier too. Enter cache hits you can justify from actual usage. Writing caches, tools, batch processing and taxes are outside this estimate.
The loop reduction is optional and adjustable from 0% to 14%. It uses 12% as the center of a band Z.ai published for a separate 30B experiment. The GLM 5.4 benchmarks page explains which results belong to that experiment. Leave the reduction at zero for a literal output requirement, such as a fixed-length report or a specified number of generated records.
Context fit and generation time
The GLM 5.4 token counter compares input plus output against a 200K planning budget and the documented 1M Coding Plan window. It also checks each model’s output cap. A 200K prompt with 16K budgeted output is already above the smaller budget. As the combined count reaches the larger window, client reserves, system messages and compaction can matter more than the calculator’s result.
The GLM-5.4 row divides modeled output by 75 tokens per second for a peak example and by 200 for an off-peak example. Those numbers cover generation only. Prompt processing, time to first token, tool calls and long reasoning may extend the wait. Competitor rows show a dash for time because the GLM-5.4 speed assumptions apply to its row.
Compare the same workload on the GLM 5.4 simulator, inspect how the GLM 5.4 Loop Transformer affects reasoning and use the GLM 5.4 VRAM calculator for a separate self-host rental scenario.
Check a GLM 5.4 token counter estimate near the context limit
When sizing a repository bundle in the GLM 5.4 token counter, paste a representative chunk first, then compare the estimate with measured tokens from your provider. If a source sample estimates at 48K and the request log shows 52K, enter 52K in the numeric mode and rerun the budget. Reserve output separately for the longest response the job needs. A reliable buffer matters most near the boundary, where a few additional tool results can trigger compaction or a different billing tier. Save the observed counts with the provider and date because a later client or tokenizer can produce different totals.
Related tools and guides
Frequently asked questions
Does the GLM 5.4 token counter upload what I paste?
The calculator runs locally and sends no prompt text or numeric inputs. An analytics event can record that the tool was used.
Can this tool match a provider’s tokenizer exactly?
No. The text mode uses character ratios. Use the number fields when you have provider-reported token counts.
Why is my 200K prompt above the 200K budget?
The fit check adds output to input. A prompt of 200,000 tokens plus any positive output exceeds a 200,000-token total.
Does the loop adjustment discount the prompt?
It changes the modeled GLM-5.4 output only. Input and competitor output stay at the entered baseline.