To reconcile a charge on your AI cost report with actual usage, you compare the billed amount against the recorded number of tokens or API calls your account made during the billing period, then verify that the pricing tier, model, and any discounts or overage rates match what your provider charges. This article explains the components of an AI cost report, how to read them, and a step-by-step method to audit a charge so you can spot billing errors or usage spikes.
Formula
The cost of an AI API call is calculated by multiplying the number of tokens sent to the model (input) by the price per million tokens, and adding that to the number of tokens the model returns (output) multiplied by its price per million tokens. The formula is:
Cost = (Input tokens / 1,000,000 × Input price per 1M tokens) + (Output tokens / 1,000,000 × Output price per 1M tokens)
- Input tokens – the number of tokens in your prompt, including system instructions, conversation history, and any tools or context you send.
- Output tokens – the number of tokens the model generates in its response.
- Price per 1M tokens – the provider’s rate for each token type, usually quoted in US dollars per million tokens.
Some providers also charge for cached input tokens (tokens that were processed before and are served from a cache) at a lower rate, or for background processing. Always check your provider’s pricing page for the exact model and region.
Worked Example
Using the default values from the calculator above: 1,000,000 input tokens at $3.00 per million and 200,000 output tokens at $15.00 per million.
- Input cost: 1,000,000 / 1,000,000 × $3.00 = $3.00
- Output cost: 200,000 / 1,000,000 × $15.00 = $3.00
- Total cost = $3.00 + $3.00 = $6.00
The calculator returns $6.00, matching the manual calculation.
Why AI Cost Reports Confuse People
AI cost reports are confusing because they aggregate usage across many dimensions: different models, different users, different API keys, and different time zones. A single line item might combine thousands of calls, each with its own token count. Providers also report usage in “tokens” but bill in “dollars,” and the conversion depends on the model’s pricing, which can change with version, region, or promotion. Additionally, some providers include a “free tier” or credits that offset charges, making the billed amount lower than the raw usage would suggest. Without a clear breakdown, it’s hard to tell if a charge is correct or if it includes a spike from a misconfigured script or a denial-of-service attack.
How to Reconcile a Charge Step by Step
To reconcile a charge, you need to gather the usage data from your provider’s dashboard or API and compare it to the invoice. Here’s a systematic approach:
- Identify the charge – Find the line item on your invoice that you want to verify. Note the date range, the model name, and the amount.
- Export usage logs – From your provider’s dashboard, export the usage report for the same date range. Look for fields like “model,” “input tokens,” “output tokens,” “cached tokens,” and “requests.”
- Calculate expected cost – For each model, multiply the total input tokens by the input price per million and the total output tokens by the output price per million. Add any additional charges like cached input or image processing.
- Add any fixed fees or credits – If you have a subscription plan, add the base fee and subtract any credits or discounts applied.
- Compare to the invoice – The sum of your calculations should match the invoice amount. If it doesn’t, check for rounding differences (providers often round to the nearest cent or tenth of a cent) or missing line items.
- Investigate discrepancies – If the numbers don’t match, look for usage that might be from a different region, a different model version, or a data transfer fee. Also check if the invoice includes taxes or other fees.
Common Pitfalls That Cause Mismatches
Several common mistakes lead to reconciliation errors:
- Mixing up input and output prices – Output tokens are almost always more expensive than input tokens. Swapping them will drastically change the cost.
- Ignoring cached tokens – Some providers charge less for cached input tokens. If you’re using a cache, the price per token is lower, and using the standard input price will overestimate the cost.
- Forgetting about the free tier – Many providers offer a free monthly allowance. If you used fewer tokens than the free tier, your bill should be zero, but the usage report still shows token counts.
- Timezone differences – The invoice may be in UTC, while your usage logs are in local time. A few hours of usage near the month’s boundary can appear in the wrong month.
- Rounding – Providers often round token counts to the nearest thousand or the cost to the nearest cent. Rounding differences can accumulate over many calls.
How to Choose the Right Pricing Model
AI providers offer several pricing models: pay-as-you-go per token, monthly subscriptions with included credits, and enterprise contracts with volume discounts. When reconciling charges, the pricing model determines what you compare. For pay-as-you-go, you compare token usage to the per-token rate. For subscriptions, you check whether your usage exceeded the included quota, and if so, what overage rate applies. For enterprise contracts, you may have a flat fee plus usage-based charges, and the contract specifies the rates. Always read the pricing page and your contract to know which model applies to your account.
Using the Calculator to Verify a Charge
Our calculator helps you estimate the cost of a single call or a batch of calls. To use it, enter the total input and output tokens for the period, and the applicable prices per million tokens. The calculator returns the estimated cost. If your invoice shows a higher amount, check for additional fees, taxes, or usage that you didn’t include. If it shows a lower amount, you might have unused credits or a discount. The calculator is a starting point for reconciliation, not a substitute for a detailed audit.
Frequently Asked Questions
Why does my invoice show a charge when I only used the free tier?
The free tier usually applies to a limited number of tokens per month. If you exceed that limit, you are charged for the overage. Check your usage report to see if you went over the free quota. Also, some providers have a free tier that only applies to certain models or regions, so usage on other models may be billed.
What are “cached tokens” and how do they affect my bill?
Cached tokens are input tokens that the provider has processed before and stored, so they are cheaper to process again. If your application sends the same context repeatedly, the provider may automatically use cached tokens, reducing your cost. Your usage report may show cached input tokens separately, at a lower price per token. When reconciling, use the cached rate for those tokens.
How do I find the exact token count for a specific API call?
Most providers include token usage in the API response. Look for a field like usage in the JSON response, which contains prompt_tokens and completion_tokens. You can also use the provider’s tokenizer tool to count tokens for a text string. For historical calls, check the usage logs in your dashboard.
Can I dispute a charge if I think it’s wrong?
Yes. Contact your provider’s billing support with the specific invoice line and your usage logs. Explain the discrepancy and provide your calculations. Most providers have a dispute process, and they will investigate. Keep records of your usage and the pricing page at the time of the charge.
Why does my usage report show more tokens than I sent?
Token counts can be higher than expected due to system prompts, conversation history, and tool definitions that are automatically added to your request. Also, some providers count tokens differently (e.g., including white space or special characters). Check the provider’s documentation on how they count tokens.
What if I use multiple models in one month?
Each model has its own pricing. Your invoice should list charges per model, and your usage report should also be filterable by model. Sum the costs for each model separately and then add them together. The calculator works for a single model; for multiple models, run it once per model and sum the results.
Related
Formula used
in tokens | Tokens used (input) | tokens | 1000000 | 0 in out_tokens | Tokens used (output) | tokens | 200000 | 0 in price_in | Input price per 1M tokens | USD | 3.00 | 0 in price_out | Output price per 1M tokens | USD | 15.00 | 0 out cost | Estimated cost | USD | (tokens / 1000000 * price_in) + (out_tokens / 1000000 * price_out) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Turn Off Backup Encryption in iTunes?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It