LLM Subscription vs. API Cost Analysis: How to Calculate the Real Cost per Token

    This article explains how to compare large language model (LLM) subscription plans and pay-as-you-go API pricing on a fair basis. It shows how to convert fixed-fee token plans into an equivalent per-million-token price, why cache writes and default caching policies can quietly raise input costs, and how to model a full context lifecycle—from filling the context window to triggering compression—to measure both the average and marginal cost per token. A tier-by-tier comparison table and a practical checklist for routing, compression, and quota utilization help readers make reproducible, auditable cost decisions instead of relying on list prices.

    1. Why a Low List Price Is Not Always a Low Real Cost

    When choosing an LLM, the most common mistake is comparing only the prices published on official pricing pages. The actual bill is determined by four variables working together: the billing unit, the caching strategy, the context lifecycle, and whether you bought a fixed-quota plan or a metered API. The exact same prompt can cost several times more or less depending on the cache hit rate and the compression strategy in use.

    So the first step in cost analysis is not to look at the unit price, but to put both billing models on the same measurement scale: an equivalent price per million tokens.

    2. Converting a Subscription Plan into an Equivalent Unit Price

    A subscription (token plan) is essentially a prepaid discount: you pay a fixed monthly fee and receive an observable usage ceiling. The conversion works as follows:

    1. Equivalent monthly quota = Weekly quota × 52 / 12
    2. Discount multiplier = Equivalent monthly quota / Monthly fee
    3. Equivalent unit price = Official metered unit price / Discount multiplier

    For example, if a high-tier plan costs 200 USD per month and the observed weekly usage ceiling is about 1600 USD, the equivalent monthly quota is roughly 6933 USD and the discount multiplier is about 34.7x. If a lightweight plan costs 10 USD per month with a 60 USD weekly quota, the discount multiplier is about 6x. The larger the discount multiplier, the lower the converted input, cache, and output unit prices become.

    Three constraints deserve particular attention:

    • The quota is a ceiling, not a guaranteed minimum—if you do not use it up, there is no benefit.
    • In some plans, different models share the same quota, or only part of the quota can be used for high-quality models. When converting, you must count only the usable portion; otherwise you will overestimate the value.
    • Using weekly quota × 52 / 12 is an estimate. When different tiers fluctuate significantly, calculating from a single stable tier is more reliable.

    3. Caching: Hits, Writes, and Default Policies

    The most easily overlooked part of the cost model is the cache write. The industry generally splits caching into two categories: “hit reads” (cheap) and “writes/establishment” (relatively expensive). If one API charges no extra write fee by default while another adds a manually controllable cache write, then simply keeping the old default parameters can raise input-side costs by roughly a quarter.

    Practical recommendations:

    1. First confirm whether the default parameters enable write billing.
    2. For stable prefixes such as long system prompts, fixed tool descriptions, and coding conventions, place them at the front and keep them byte-for-byte unchanged.
    3. Put variable content at the end to avoid prefix drift that invalidates the cache.
    4. Compression or summarization operations break the cache by default and should be counted as a cold start.

    4. Modeling a Real Workload: Fill the Context, Then Compress

    The traditional approach multiplies a fixed cache hit rate by the input volume, which is badly distorted in heavy coding scenarios. A more realistic method is a full lifecycle simulation:

    1. loop:
    2. Append a small amount of input and output
    3. Record the cached amount carried by this request
    4. Until context compression is triggered
    5. Compression cost = Input of the compression request + output (cache invalidated, counted as a cold start)
    6. Total cost = Sum of per-turn costs + compression cost
    7. Actual price per token = Total cost / Total tokens
    8. Price per new token = Total cost / New (non-cached) tokens

    This method answers two key questions: the real level of the overall bill, and the marginal cost of “writing one more line of code.” In practice, as the context approaches its limit, a rising cache share lowers the average unit price, but the cold start at the moment of compression creates a distinct cost spike.

    5. Tier-by-Tier Comparison: High-Quality vs. Low-Cost

    Putting plan conversions and metered prices in the same table (values are illustrative, unit: per million tokens):

    Tier Billing model Input Cache Output
    High-quality High-tier plan, converted ~0.058 ~0.006 ~0.346
    High-quality Metered (same tier) ~0.144 ~0.014 ~0.865
    High-quality Lightweight plan, converted ~0.290 ~0.002 ~0.580
    Low-cost Metered 0.20 0.02 1.20
    Low-cost High-tier plan, converted ~0.006 ~0.0006 ~0.035
    Low-cost Lightweight plan, converted ~0.023 ~0.0005 ~0.047

    Two conclusions follow:

    • When the discount multiplier of a high-tier plan is large enough, its converted unit price can be several times lower than the metered price of the same tier.
    • After plan conversion, a low-cost tier model’s unit price can be an order of magnitude below some metered models. This is the arithmetic source of “plans are cheaper than metered billing,” not a price cut by the model itself.

    6. An Actionable Selection and Optimization Checklist

    • Measure the workload first: gather average context length, cache hit rate, and compression frequency before discussing unit price.
    • Route in layers: send stable prefixes through the cache, use the low-cost tier for exploratory tasks, and reserve the high-quality tier for critical generation.
    • Control compression: raise the compression trigger threshold and preserve key fragments to reduce cold starts.
    • Use the quota fully: a plan’s value depends entirely on quota utilization—idle quota is a loss.
    • Build a dashboard: bring token usage, cache hits, and compression counts into monitoring and alerting, keep records with a logging service, and produce an auditable cost report.

    7. Conclusion

    The right way to compare LLM costs is to convert subscriptions and metered billing into an equivalent unit price, then validate it with a real lifecycle workload. Only by accounting for cache writes, compression cold starts, and quota utilization together can you reach conclusions that are reproducible and auditable. When implementing this on platforms such as Baidu AI Cloud, it is likewise advisable to build your own closed-loop cost accounting on top of general-purpose capabilities (monitoring and alerting, logging services, container platforms), making decisions with data rather than list prices.