How AI Coding Tools Are Billed: From Tokens to Group Multipliers

    Third-party gateways for AI coding tools bill a request by estimating cost from official token prices, then multiplying by the rate of the API key’s group. This article explains that formula, how group multipliers are designed, common pricing mistakes, model-coverage gaps, and a practical way to estimate task cost.

    1. The core idea: what the billing formula actually is

    To understand how intelligent coding tools—such as AI coding assistants and command-line agents—are charged on a third-party gateway, one formula is enough:

    1. Actual charge = cost estimated from official list prices × the multiplier of the key’s group

    A detail that is easy to miss: the same model counts tokens the same way in every group. The only difference is the group multiplier applied at the end. Input tokens, output tokens, and cache-read tokens all use the model’s published list prices as the unit-price baseline. Groups differ only in that final multiplier.

    Gateway billing has two steps:

    1. The gateway uses upstream official list prices to estimate what the request is worth. It multiplies the per-million-token prices for input, output, and cache reads by the amounts actually consumed, producing a baseline cost.
    2. It then multiplies that baseline by the multiplier of the group that owns the API key. The result is the amount deducted from the balance.

    To know what a request really cost, you only need two numbers: the cost estimated from the model’s official list prices, and the multiplier of the group that owns the key. With those, any bill can be checked by hand.

    2. Why group multipliers exist

    Gateways use groups because model access channels differ in stability, concurrency, and acquisition cost. Operators split those channels into groups, each with its own multiplier, and a key is priced according to the group it belongs to.

    On a typical gateway, groups and multipliers often follow a pattern like this:

    Group type Multiplier pattern Typical use
    Low-cost shared channel Lower multiplier (for example, below 0.6) Capacity from a shared subscription pool: cheaper, but availability depends on the upstream
    Subscription-plan channel Mid-range multiplier (about 2×) Served by a pool of subscription accounts, aimed at heavy individual use
    Stable official-API channel Higher multiplier (3× or more) Direct official API access, with the strongest stability and concurrency guarantees
    Enterprise custom channel Multiplier negotiated High concurrency and SLA-backed access for a specific organization

    The pattern is clear: the multiplier roughly tracks channel quality. Cheaper pooled groups suit day-to-day coding and batch tests. More expensive stable groups suit production and CI/CD calls that should not fail. Multipliers are not fixed; operators change them as upstream capacity changes. Before you rely on a price, open your group in the gateway’s model catalog or console and confirm the current multiplier.

    3. Three places people misread the price

    1. The multiplier is applied to the official list price

    Take a flagship model with hypothetical official prices of $4 per million input tokens, $20 per million output tokens, and $0.20 per million cache-read tokens. If you select a group with a 2× multiplier, the prices shown on the card are already “official price × 2”: $8 input and $40 output. When you read a price, be clear whether it is the adjusted price or the baseline price.

    2. The default view is often not the official list price

    Many gateways default the model list to “all” models, and cards may show prices at a default multiplier (for example, 2×). If you compare prices without selecting a group, it is easy to treat that figure as the official price. Select the group your key actually belongs to, then read the card price. Otherwise a comparison can be off by a factor of two or more.

    3. How the billing currency converts

    The “$” on a gateway is usually a platform credit unit, not a real US dollar. On many platforms the top-up ratio is 1 Chinese yuan = 1 credit unit, so a billed “$9” deducts 9 yuan from the balance. A direct official API bills real US dollars. To compare the two, convert the official dollar price by the exchange rate first. Otherwise the comparison is wrong.

    4. Groups do not all cover the same models

    Another common trap: not every group includes every model.

    Low-cost shared groups usually expose only some popular models. They may include the main versions of a flagship family but omit the newest smaller models or certain specialized series. If you request a model that the group does not include, the gateway returns an error. It does not silently switch you to another group and bill at a different multiplier.

    Before a large batch of requests, send one minimal test call—for example, a very short message—to confirm that the key’s group supports the target model. That check surfaces the problem before a pipeline fails partway through.

    5. Estimating the cost of a task

    Putting the rules together, a practical estimate looks like this:

    1. 1. Confirm the model for this task and its official unit prices
    2. (input / output / cache read, in $ per million tokens)
    3. 2. Estimate token use
    4. Input ≈ system prompt + context history + user message
    5. Output ≈ expected amount of generated code × an experience factor
    6. (If context caching is on, repeated portions are priced as cache reads)
    7. 3. Compute the baseline cost
    8. Baseline = input amount × input price
    9. + output amount × output price
    10. + cache-read amount × cache-read price
    11. 4. Multiply by the group multiplier to get the actual charge in credits
    12. 5. Convert credits to local currency using the platform ratio
    13. (for example, 1 credit = 1 yuan)

    Practical habits:

    • Use the cache. Coding sessions repeat a large system prompt and prior context. Cache-read prices are often about one-tenth of the input price, which cuts cost on long sessions.
    • Limit context length. Agents accumulate history across a long task. Starting a new session or compressing context stops input tokens from growing on every turn.
    • Match the group to the job. Use a low-multiplier group for everyday experiments and a stable group for critical delivery. Balance cost and reliability with a group strategy instead of running everything on the most expensive channel.
    • Recheck the multiplier. Multipliers change. Include “check the multiplier” in the daily start-of-work checklist so budgets are not based on a stale rate.

    6. Summary

    Billing for intelligent coding tools on a gateway is not opaque. Token accounting is the same across groups, the baseline comes from official list prices, and the group multiplier is the only variable. Select the right group before reading prices, distinguish credit units from real currency, and confirm that the group includes the target model. Combined with caching and context control, that is enough to calculate the cost of a coding task clearly. For a team, assigning groups by scenario and reviewing multipliers on a regular schedule is the most effective way to control AI coding spend.