Testing a Discounted Token Plan: One Prompt with GLM5.1 and CC Used 60% of the Quota

    This article reviews a single observed test of a discounted time-based token plan using GLM5.1 and CC. One request with about 105,682 input tokens consumed 1,214.84 AFP quota units, roughly 61% of a 2,000-unit period allowance and about 6% of a 20,000-unit monthly allowance. The key point is not a service benchmark, but a cost pattern: under subscription quota plans, token consumption is driven mainly by context size and agent loop count, not by the number of user questions. The article explains four token-amplification factors, shows how to estimate cost per turn, how to budget context, when quota plans are suitable, and how to reduce engineering cost.

    Why One Prompt Used 60% of a Token Plan Quota

    The Starting Point: A Single Question Consumed Most of the Period Allowance

    A reported test is a useful example. A discounted time-based token plan provided about 2,000 quota units per cycle, with a monthly total of about 20,000 units. After a single request of about 105,682 tokens, the account deducted about 1,214.84 AFP units.

    By simple calculation, that one question used about 61% of the current cycle allowance and about 6% of the monthly allowance.

    It is important to note that this result comes from a single observation. It can be heavily affected by model tier, context length, output length, cache behavior, and other variables. It should not be treated as a specification for any particular service.

    The useful part is that it exposes an easily overlooked mechanism:

    In a subscription quota model, cost is not mainly determined by how many questions you ask. It is determined by how many tokens the system has to resend on your behalf.

    The original conclusion is also restrained: this type of plan is not ideal for running agents, but may be sufficient for code completion.

    The rest of this article breaks down the cost mechanism behind that conclusion.

    How Tokens Are Burned: Four Amplification Factors

    1. Context Padding: Large Fixed Overhead Beyond the User Prompt

    A single request usually contains far more tokens than the user’s actual sentence. It commonly includes:

    • System prompts and role settings;
    • Tool or function-calling schema definitions; dozens of tool descriptions can easily occupy thousands of tokens;
    • Conversation history, which grows turn by turn;
    • Externally injected content, such as retrieved snippets, opened file contents, or terminal output.

    In the test above, a single request size of about 105,000 tokens can basically only be explained by long context and accumulated multi-turn content, not by a short natural-language question alone.

    2. Agent Loop Amplification: The Same Context Is Submitted Repeatedly

    This is the most important difference.

    Normal question answering is usually one question and one answer. An agent, however, works in a loop: think, call a tool, read the result, think again, and continue. Each loop iteration must carry the full conversation history and tool results for inference.

    As a result, token consumption grows roughly quadratically:

    1. Per-turn input = fixed overhead + sum(tool outputs from previous turns)
    2. Total cost ≈ sum over n turns of (per-turn input × input coefficient + per-turn output × output coefficient)

    For a 20-turn task, cumulative input tokens may be more than ten times the input of the final turn alone. This explains why a task that appears to be “just one question” can still drain quota very quickly.

    3. Input and Output Tokens Are Priced Asymmetrically

    Most services price input and output tokens separately, and output tokens are usually much more expensive than input tokens.

    Agent scenarios often generate large amounts of code, patches, and explanatory text. This pushes up the output-side weight even further.

    4. Cache Hit Rate Determines the Real Discount

    Most mainstream services provide context caching. Stable prefixes, such as system prompts, tool definitions, or long documents, can reuse cached context. Cached portions are usually charged at a much lower rate.

    A cache-friendly request structure, with a stable prefix and variable content placed later, can reduce actual cost by a large margin. On the other hand, if the system prompt or tool list changes every time, the cache may fail completely and cost can increase significantly.

    In addition, quota units and tokens are usually not a simple 1:1 linear relationship. Common pricing models also apply model-tier coefficients, input/output differences, and cache discounts.

    Therefore, when looking at quota consumption, you must also look at model tier and cache hit rate. Looking only at token counts can easily lead to a wrong conclusion.

    Calculating and Budgeting Cost

    1. Per-Turn Cost Estimation Script

    Regardless of the service provider, if the API returns usage data, you can calculate the cost yourself:

    1. # Example code: estimate quota cost per turn
    2. def estimate_cost(turns, in_coef, out_coef, cache_discount=0.0):
    3. """
    4. turns: list of dictionaries with prompt_tokens, completion_tokens, and cache_hit_ratio
    5. in_coef / out_coef: quota coefficients for input and output tokens
    6. cache_discount: fractional discount for cache-hit input tokens
    7. 0.3 means a 30% discount
    8. """
    9. total = 0.0
    10. for t in turns:
    11. p = t["prompt_tokens"]
    12. hit = p * t.get("cache_hit_ratio", 0.0)
    13. miss = p - hit
    14. total += miss * in_coef
    15. total += hit * in_coef * (1 - cache_discount)
    16. total += t["completion_tokens"] * out_coef
    17. return round(total, 2)

    The key is to make cache_hit_ratio and completion_tokens observable. The former usually depends on server-side usage fields, while the latter often needs client-side instrumentation.

    2. Context Budget: Set the Limit First, Then Write the Prompt

    Treat the context window as a limited budget instead of trying to fill it as much as possible:

    1. CONTEXT_WINDOW = 128_000 # Model context limit (example value)
    2. OUTPUT_RESERVE = 8_000 # Reserve for output
    3. TOOL_OVERHEAD = 12_000 # Fixed overhead for tool schemas
    4. HISTORY_BUDGET = CONTEXT_WINDOW - OUTPUT_RESERVE - TOOL_OVERHEAD
    5. def fit_history(history, budget=HISTORY_BUDGET):
    6. kept, used = [], 0
    7. for msg in reversed(history): # Keep most recent messages first
    8. cost = len(msg) // 3 # Rough token estimate
    9. if used + cost > budget:
    10. break
    11. kept.append(msg)
    12. used += cost
    13. return list(reversed(kept))

    Keeping the most recent few turns and compressing older history into summaries is one of the most effective ways to control cost in long-running tasks.

    3. Build a Usage Dashboard

    Track quota consumption, token counts, cache hit rate, and turns per task on a daily basis. Add threshold alerts.

    General logging and monitoring services can be used to collect metrics and send anomaly notifications, preventing quota from being silently exhausted in unattended tasks.

    Scenario Fit: What Should Use a Quota Plan, and What Should Not?

    Scenario Typical Characteristics Fit
    Code completion / inline continuation Small context, single turn, no loop More suitable
    Short Q&A, document summarization Controllable input, limited output More suitable
    Small changes within a single file 1–3 tool calls Barely usable
    Cross-file refactoring, long-chain agent Multi-turn loops, history growth Not recommended
    Unattended batch tasks Unpredictable consumption, needs rate limiting and circuit breaking Not recommended
    High-concurrency online service Needs stable quota and SLA Should use pay-as-you-go or reserved capacity

    The judgment can be simplified into three questions:

    1. Is the task single-turn, or will it run automatically in a loop? A loop means higher risk.
    2. Are input tokens controllable and estimable? If not, it is not a good fit for a fixed quota plan.
    3. When the quota runs out, will the business degrade or stop completely? If it will stop, you need a buffer or a different billing model.

    Seven Engineering Practices to Reduce Cost

    1. Simplify tool definitions: Merge tools with overlapping semantics and remove redundant description fields. Tool schemas are fixed costs paid on every turn.
    2. Keep the prefix stable: Fix system prompts and tool-list order, and place variable content later to maximize cache hits.
    3. Summarize context: Compress early conversation into structured summaries instead of keeping everything.
    4. Retrieve instead of dumping everything: Retrieve only relevant snippets instead of putting entire files into the context.
    5. Limit output length: Explicitly constrain maximum output tokens to prevent explanations from growing uncontrollably.
    6. Set turn limits and circuit breakers: Agent loops need both a max_steps limit and a quota threshold. Stop when either limit is reached and keep a breakpoint.
    7. Measure before scaling: Use 20–50 representative tasks to measure average cost per task, then estimate monthly usage. Do not guess based on intuition.

    Conclusion

    The real value of that test is not to evaluate a particular service. It shows a transferable cost rule:

    Under subscription quota models, the dominant cost variables are context size and loop turns, not the number of questions.

    One request of 105,682 tokens consuming about 60% of the allowance is not abnormal. It is the expected result of long context plus multi-turn tool loops.

    Therefore, quota plans are best treated as low-friction interactive assistant tools for completion, Q&A, and small changes. Once a task enters autonomous multi-step execution, it is better to switch to pay-as-you-go or reserved capacity, with context budgeting, turn circuit breakers, and usage monitoring in place.

    Measure first, then choose a strategy. That is much cheaper than trying to recover quota after the fact.