How to Compare LLM API Pricing: A Multi-Channel Cost Verification Guide
LLM API pricing varies widely across providers, and comparing raw numbers directly often leads to wrong conclusions. This guide explains how to normalize input/output weighting, currency conversion, and cache pricing before comparison, covers three common misconceptions, and provides a reusable five-step verification workflow with sample code, plus practical criteria for evaluating low-cost channels.
Step One: Normalize the Pricing Basis
Before comparing LLM prices across providers, the most commonly overlooked issue is inconsistent measurement. Pricing pages from different providers may differ completely in pricing dimensions, currency, and billing granularity. Comparing raw numbers directly usually yields meaningless conclusions. Before comparing, normalize three elements: input/output weighting, currency conversion, and cache pricing.
1. Input-to-Output Weighting
Most models charge a higher price per output token than per input token, and the ratio varies significantly across models. Refer to each model’s pricing page for exact figures and note the date you checked. Looking at only one price introduces bias, so you first need to determine the input-to-output token ratio of your typical workload, then apply weighting.
Here, the weight is the proportion of input tokens out of all tokens—not the proportion of cost.
Take an agentic coding scenario as an example. System prompts, codebase snippets, and conversation history are repeatedly injected into the context, so input tokens typically dominate, while the code returned per turn is relatively limited. For this scenario, you can use the following weighting:
Blended price = input price × 70% + output price × 30%
Long-document summarization works the other way around. The source document is fed into the model in full, so input tokens also dominate, while the summary output is short. For this scenario, the input weight should be raised significantly, for example to 90%, with the output weight lowered accordingly. In either case, weights should come from your own actual call logs—do not copy someone else’s ratios. The weights are the foundation of every subsequent calculation; if the weights are wrong, no amount of precision downstream will save the result.
2. Currency and Exchange Rate Conversion
Some providers bill in USD, others in CNY. Before comparing, convert everything at a single exchange rate. This article uses 7.2 as an example rate. This is only an illustrative assumption—in practice, note the date and source of the rate, for example, “Example date: YYYY-MM-DD, source: daily midpoint rate from a given institution,” so readers can reproduce the calculation with the same rate.
3. Including Cache Pricing
Some models and providers support context caching, where cached input tokens are billed at a lower price than regular input. In multi-turn conversations and agent scenarios, cache hit rates can be high. Ignoring cache pricing will systematically overestimate costs.
Note that not all models or providers offer caching. Some platforms also charge separately for cache writes or cache storage. When accounting, it is recommended to record three columns—input price, output price, and cached input price—and note in remarks whether write and storage fees are included.
Three Common Misconceptions
Misconception 1: Going direct to the official API is always cheapest
Many people assume official pricing is the anchor and that third-party resellers must cost more. The reality is more complex. Some third-party hosting prices are higher than official direct access, while some aggregator platforms offer lower prices to attract users. When comparing, make sure you compare the same model version, the same billing granularity, and the same point in time—otherwise the conclusion is unreliable. There is no fixed rule between price and provider type; each item must be verified individually.
Misconception 2: The same model is available on all providers simultaneously
After a new model is released, availability across providers varies. Some providers only offer a coding-specialized or lightweight version; others are still on the previous generation. If a provider does not offer the same version, mark it as “not available” in your comparison table. Filling in the gap with the price of a similar version renders the comparison meaningless.
Misconception 3: Platform discounts apply equally to all models
Discount depth on the same platform can vary significantly from model to model. Choosing a platform and choosing a model are interdependent. A safer approach is to first determine your candidate models, then compare prices specifically for those models to find the truly optimal combination.
A Reusable Five-Step Verification Workflow
- Define candidate models and your real consumption profile. Determine the input-to-output ratio, expected cache hit rate, and monthly call volume.
- List all candidate providers. Include official direct APIs, hosting services on cloud platforms, and aggregator platforms, and register each one.
- Capture each provider’s official pricing page or sales quote. Record the capture time and source uniformly, and organize three columns: input price, output price, and cache price. If a field is unavailable, mark it honestly as “not disclosed”—do not fill it in with estimates.
- Calculate blended prices using the normalized basis. Apply the weighting formula and state your exchange rate assumption.
- Output a comparison table with verification methods. State the source and capture time for every number so readers can verify independently.
Below is sample code for calculating the blended price:
def blended_price(input_price, output_price, cache_price,cache_hit_rate=0.3, in_ratio=0.7):"""Calculate the blended price, unit: yuan per million tokens.cache_hit_rate: the proportion of input tokens served from cache,excluding output tokens.Cache write and storage fees are not computed in this functionand must be added separately.in_ratio: the proportion of input tokens out of all tokens.Agentic coding scenarios typically use 0.7; long-documentsummarization should use a higher value, e.g., 0.9."""eff_input = input_price * (1 - cache_hit_rate) + cache_price * cache_hit_ratereturn eff_input * in_ratio + output_price * (1 - in_ratio)# The data below is illustrative only and not a real quote from any providerprice = blended_price(input_price=8.0, output_price=28.0,cache_price=2.0, cache_hit_rate=0.3)print(f"Blended price: {price:.2f} yuan per million tokens")
Running this outputs 12.74 yuan per million tokens. Switching to a long-document summarization scenario with in_ratio set to 0.9, the same price inputs produce 8.38 yuan per million tokens. These are illustrative calculations only—real results depend on the actual prices of the providers you choose.
Beyond the calculation, verify the following details, which frequently cause discrepancies between actual bills and estimates:
- Minimum billing granularity, such as whether billing rounds up per request or per fixed token count.
- Whether failed requests and timeouts are billed.
- Whether cache write and cache storage fees are billed separately.
- Whether non-text content such as images or tool calls incurs extra charges.
- Whether the quoted price includes tax, and whether the exchange rate matches the settlement method.
How to Choose a Provider
What to Watch for with Low-Cost Providers
Price is only half the decision. The following dimensions should also be included in your evaluation matrix.
- Stability and rate-limiting policies. Low-cost providers may come with stricter concurrency limits and higher timeout rates. Load-test thoroughly before using one in production.
- Data compliance and isolation. For sensitive enterprise data, prioritize providers that support private deployment or commit to not retaining data.
- API compatibility. Most providers are compatible with mainstream chat completion API formats, but support for advanced parameters such as forced function calling and structured output varies. Before switching, run interface regression tests and record the API version and regression cases.
- Billing transparency. Actual billing may differ from the pricing page. Run a small trial first before deciding on large-scale integration.
How to Validate a Provider
Run a small trial with real requests covering typical traffic over a full billing cycle, or a representative portion of it. Then compare the billed amount against the estimate from your local formula. When computing the deviation, first exclude one-time trial credits and refunds. If the deviation exceeds roughly 5%, first investigate billing granularity, cache hit rate assumptions, and failed-request billing before deciding whether to continue. The 5% figure is a suggested investigation threshold—adjust it based on your own budget tolerance.
Summary
The cost of an LLM API is jointly determined by weighting assumptions, cache billing, version differences, and provider discounts. Ignoring any one of these can distort the conclusion. A reliable approach is to normalize the basis, verify item by item, cite sources, and allow others to double-check. This method does not depend on the conclusions of any single benchmark or review. Swap in your own traffic profile, and you get your own answer.
Cost optimization is an ongoing process. Spend half a day setting up this framework, and every time you change models, switch providers, or encounter a price adjustment, you can quickly recalculate and adapt your selection in time.
