LLM Gateway Billing: How Group Multipliers Affect Token Costs

    LLM gateways often charge different amounts for the same model usage because API keys belong to groups with different billing multipliers. This article explains how input, output, cache-read, and cache-write tokens contribute to the base cost, how group multipliers are applied, and how to verify pricing displays, reconcile bills, and control costs in coding workflows.

    Separate the Tool from Its Billing Model

    AI coding tools, conversational assistants, and code-completion services all turn user requests into model calls. What users often want to understand is not a product’s marketing message, but why the same conversation consumes different amounts of credit across accounts or billing groups. Separating what the product does from how it charges makes the technical boundaries clearer.

    From a billing perspective, a call typically involves three calculations: measure usage by token category, calculate a base cost using published or agreed rates, and multiply that cost by the multiplier assigned to the API key’s group. The result is the amount deducted from the account balance.

    Model weights, inference implementations, and context windows may differ substantially. However, differences between billing groups often come down to the final multiplier—not a change in how tokens are counted.

    Why Token Usage Has Four Categories

    Modern conversational APIs commonly support prompt caching. When the same system prompt, long document, or tool instructions are reused, they do not necessarily need to be billed as new input each time. Usage reports therefore often distinguish four categories, each with its own meaning and rate:

    1. Uncached input: Tokens newly supplied for the current request that do not hit the cache.
    2. Output: Tokens generated by the model, typically charged at the highest rate.
    3. Cache reads: Tokens retrieved from an existing cache and billed at the cache-read rate. This rate is generally much lower than the rate for new input, which is a major reason long-context workloads can become cheaper.
    4. Cache writes: Tokens written to the cache when a reusable prefix is first cached. Writes often cost more than ordinary input, with that initial expense offset by savings from subsequent reads.

    These categories should not simply be added together and charged at one rate. Calculate each category separately, then sum the costs.

    When rates are quoted per million tokens, the calculation is:

    1. Base cost = Uncached input tokens / 1e6 × Input rate
    2. + Output tokens / 1e6 × Output rate
    3. + Cache-read tokens / 1e6 × Cache-read rate
    4. + Cache-write tokens / 1e6 × Cache-write rate
    5. Credits deducted = Base cost × Group multiplier

    If a category has zero usage, its contribution is zero. Keep the categories explicit so that cache writes are not accidentally treated as ordinary input.

    Use the API’s returned usage data rather than estimating tokens by dividing character counts by a rule-of-thumb factor. Chinese text, code, and special symbols tokenize differently, and the same text can have substantially different token counts under different tokenizers.

    Where the Group Multiplier Fits in the System

    A proxy gateway or centralized enterprise endpoint usually sits between the caller and the upstream model service. Its responsibilities include authentication, routing, rate limiting, metering, and billing—not redefining how the model counts tokens.

    A typical request is settled in this order:

    1. Validate the API key, check access to the requested model, and enforce concurrency or quota limits.
    2. Forward the request to the appropriate upstream service and collect the final usage report.
    3. Calculate the base cost using upstream rates or the platform’s published base rates.
    4. Retrieve the multiplier associated with the API key’s group and apply it to the base cost.
    5. Record the charge, deduct the balance, and handle failures, timeouts, or partial generation according to the applicable billing rules.

    Saying that “the same model uses the same token accounting across groups” means that the metering basis is consistent. Differences users experience can come from multipliers, model availability, reliability, and concurrency policies—not from counting the same text as two different sets of tokens.

    A multiplier is a commercial and capacity-management policy, not part of the model algorithm. Common group arrangements include lower-multiplier shared or trial pools, pools intended for higher availability, subscription-based pools, and enterprise pools governed by contracts.

    Multipliers can change. Check the current published value in the console before making calls rather than treating an old screenshot as a permanent pricing agreement.

    Three Common Pricing Display Mistakes

    Applying the Multiplier Twice

    A unit price shown on a console card may already equal the base rate multiplied by the selected group’s multiplier. Multiplying the resulting bill again would double-apply the multiplier.

    When checking prices, establish whether the displayed rate is the base rate or the effective rate after the multiplier. The multiplier adjusts the base charge; it is not a separate service fee added afterward.

    Treating the Default View as the Base Rate

    An “All” or default view may display prices using a default multiplier to provide a reference point. That view is not necessarily the upstream list price, nor does it necessarily reflect the multiplier for your API key.

    Before reading prices, select the group your key actually belongs to. Then check all four rates: input, output, cache reads, and cache writes.

    Assuming a Currency Symbol Means Actual Currency

    Some platforms use a fixed conversion between purchased credits and an internal accounting unit while still displaying $ or a similar symbol. In that case, the deducted number represents account credits, not necessarily actual US dollars.

    When comparing gateway charges with direct-provider billing, account for exchange rates, credit purchase ratios, tax treatment, and whether cache-hit behavior is equivalent. Comparing only the numbers shown on two pricing pages can lead to an incorrect conclusion.

    A Worked Billing Example

    Suppose a request returns the following usage:

    • Uncached input: 2,000 tokens
    • Output: 800 tokens
    • Cache reads: 50,000 tokens
    • Cache writes: 0 tokens

    Assume illustrative base rates of 3 for input, 15 for output, 0.3 for cache reads, and 3.75 for cache writes, all per million tokens. The group multiplier is 2.

    These rates illustrate the calculation only; they are not current prices from any provider.

    1. Base cost = 2000/1e6 × 3
    2. + 800/1e6 × 15
    3. + 50000/1e6 × 0.3
    4. + 0
    5. = 0.006 + 0.012 + 0.015
    6. = 0.033
    7. Credits deducted = 0.033 × 2 = 0.066

    Although the request generates only 800 output tokens, their cost is close to that of 50,000 cache-read tokens.

    If a later request needs to write a long prefix to the cache instead of reading an existing entry, the cache-write charge can raise that request’s cost. Subsequent reads may still reduce the total cost across the conversation. Evaluate cost over the full session, not just by the output length of one turn.

    Model Access Is Also Tied to the Billing Group

    A group is more than a multiplier label. It may also determine the available models, regions, concurrency limits, and fallback policies.

    If the requested model is unavailable to the API key’s group, the appropriate behavior is to reject the request rather than silently move it to a group with a higher or lower multiplier. Silent group switching makes bills difficult to explain and audit.

    Before deploying a workload, perform three checks:

    1. Confirm that the target model is available in the key’s group.
    2. Confirm how the four token rates and the multiplier are displayed.
    3. Send a small request, inspect its usage, calculate the charge manually, and compare it with the bill. Any difference should be within rounding tolerance.

    If the discrepancy is consistently positive or negative, first check for omitted cache-write charges, prices taken from the default view rather than the actual group, and failed requests or retries that may have been billed multiple times.

    Controlling Costs in Coding Workflows

    AI coding requests often contain long system prompts and repository context, short new user instructions, and moderately sized patches or explanations. As a result, cache reads can dominate token volume while output accounts for a large share of the cost.

    Practical controls include:

    • Keep reusable prefixes stable. Place system prompts, coding conventions, and tool definitions in a cacheable prefix. Rewriting that prefix on every turn can prevent cache hits.
    • Limit retrieved context. Adding irrelevant files increases both initial cache-write usage and later cache-read usage.
    • Match model capability to the task. Simple renaming or formatting tasks do not necessarily require the highest-tier model.
    • Set agent limits. Cap the number of turns and the output length per turn so that repeated calls do not rapidly exhaust credits after the multiplier is applied.
    • Attribute charges by API key, project, and group. This helps identify automated tasks that are making unproductive repeated calls in a high-multiplier group.

    These measures change usage and routing. They do not change the underlying billing structure: base cost multiplied by the group multiplier.

    Implementation Considerations for Reconciliation and Budgets

    Teams using a unified model gateway should persist raw usage rather than storing only the final charge. Useful billing records include:

    • All four token usage categories
    • The base-rate version
    • The group-multiplier version
    • The request identifier
    • Whether the request was a retry

    Both rates and multipliers can change. Without versioned records, historical bills cannot be reliably reconstructed.

    Budget controls can operate at two levels. Hard controls include balance and concurrency limits; soft controls include daily spending alerts by project.

    Alert thresholds should account for the output rate multiplied by expected generation length and the group multiplier, rather than relying only on input character counts. Cache writes can create a spike during initial warm-up, so that day’s average should not be treated as the steady-state cost.

    This resembles other metered cloud services: object storage charges by capacity, message queues by message count, and model calls by tokens. The general structure is usage multiplied by a unit rate and then by a contractual factor.

    What makes model gateway billing distinctive is that usage is divided into several token categories, and caching changes the pricing mix for the same context across turns. Understanding that structure and the group multiplier explains most differences in credit deductions without relying on any particular brand’s plan names.

    Summary

    To verify a request’s charge, you need two things: the base cost calculated from the four token categories and their rates, and the multiplier assigned to the API key’s group. Multiplying them gives the amount deducted.

    In the console, select the actual group, check whether displayed prices already include the multiplier, and establish whether the currency symbol represents platform credits or actual currency. A model unavailable to the group should produce a failure rather than a silent change in billing group.

    For long-context coding assistants, cache hits and uncontrolled output often affect the final bill more than small differences in the multiplier.