Estimate token spending
Enter input and output tokens per request to calculate an estimated cost for the selected model and usage volume.
AI infrastructure cost planning tool
Estimate the cost of using AI models across your application. Adjust input and output tokens, request volume, caching, batch processing and model selection to understand your projected API spend before deployment.
Estimates apply standard token rate multipliers based on current provider documentation.
Selected model vs. comparative models
| Model Name | Cost / Request | Monthly Cost | Yearly Total | Diff % |
|---|
Check the models you would like to compare side-by-side against your base model selection:
AI API costs are usually driven by the number of input tokens sent to a model and the number of output tokens it generates. The price per token can differ substantially between providers and models, so estimating usage before launch helps developers plan infrastructure budgets, compare model options and avoid unexpected operating costs.
This AI API Cost Calculator turns token usage and request volume into an estimated cost per request, monthly spend and annual projection. You can select a provider and model, enter known token counts or estimate them from text length, then test caching, batch processing and growth assumptions. The comparison area applies the same usage assumptions to selected models so their estimated costs can be reviewed side by side.
Enter input and output tokens per request to calculate an estimated cost for the selected model and usage volume.
Apply the same request pattern to other selected models and compare cost per request, monthly spend and yearly totals.
Test how cached input shares, cache writes and the configured batch discount may affect the estimated API bill.
Apply a monthly growth assumption to estimate how higher request volume can change the projected annual cost.
Input tokens represent the text and other supported content supplied to a model, including prompts, system instructions, conversation history and context retrieved by your application. Output tokens are the tokens generated in the model response. Providers generally publish separate rates for input and output, so the two quantities should be estimated independently.
Token counts are not the same as word counts or character counts. A token can be a whole word, part of a word, punctuation or another text unit. The calculator's text-length mode uses approximate conversion factors as a quick planning aid; actual tokenisation varies by model, language, formatting and content. For a more reliable estimate, use token counts from the relevant provider's tokenizer or API usage response.
The basic estimate multiplies input tokens by the model's input rate and output tokens by its output rate. The combined amount is divided by one million because the model pricing table is expressed per one million tokens. The calculator then multiplies the per-request amount by the number of requests in the selected period.
When daily request volume is selected, the calculator converts it to an estimated monthly volume using an average month of 30.4375 days. The annual estimate adds twelve months of spend. If monthly growth is entered, the annual projection compounds the monthly cost across twelve months rather than simply multiplying the initial month by twelve.
Input and output processing can have different computational requirements, and providers may price them separately. A workload that generates long responses can therefore cost more than one that mainly classifies or summarises short inputs, even when both receive a similar number of requests. To improve an estimate, measure representative prompts and responses from your actual application rather than relying on request count alone.
Some model APIs offer prompt or context caching for eligible repeated input. Instead of paying the standard input rate for every repeated token, a qualifying cache read may be billed at a different rate. Cache creation or writing can also have its own pricing rules and eligible duration. The actual savings depend on the provider, model, cache eligibility, cache lifetime, hit rate and the amount of repeated context.
Use the cached input share to model the portion of input tokens expected to be served from cache. The cache write share represents input tokens being written to the cache. The calculator prevents the two shares from exceeding the total input share. Its configured cache prices and durations are model-specific assumptions; check provider documentation to confirm that the selected caching feature and duration apply to your API workload.
Batch processing is designed for workloads that do not require an immediate response. Depending on the provider and endpoint, batch APIs may offer different pricing or processing limits in exchange for asynchronous completion. This calculator applies its configured 50% batch discount when the option is enabled. That percentage is a modelling assumption in the supplied calculator, not a guarantee that every listed model or provider offers the same discount.
Before using batch processing, check supported endpoints, submission limits, completion windows, data retention rules and the provider's current batch pricing. It is generally unsuitable for interactive features that must return an answer immediately.
A useful cost comparison holds the workload constant. Use the same input tokens, output tokens, request volume, caching assumptions and batch setting for each model. The comparison table then shows the estimated cost per request, monthly cost, annual total and percentage difference from the selected base model.
Price alone does not determine the best model for a product. Also evaluate response quality, latency, context limits, reliability, tool support, structured output support, privacy terms and the amount of correction or human review required. A lower-cost model may be more expensive overall if it needs repeated retries or produces results that require substantial rework.
API traffic often changes after a product launches. More users, longer conversations, larger context windows, additional agent steps and higher output limits can all increase token consumption. Enter a monthly growth percentage to see how a consistent growth assumption changes the twelve-month estimate. Treat this as a scenario, not a prediction: real usage can be seasonal or uneven, and token consumption per user may change as features evolve.
This calculator models text-token input and output costs using the price data embedded in its configuration. It does not represent every possible charge. Depending on the provider and product, separate charges may apply for image, audio, video, search, tool calls, storage, fine-tuning, dedicated capacity, priority processing, long-context tiers or other services. Some of these may be excluded from the current model configuration.
Currency conversion values are fixed estimates in the calculator and are not live exchange rates. Provider prices can change, model names and availability can differ by account or region, and third-party rate summaries may not match the provider's current billing page. Review the provider's official documentation and your actual invoices before relying on a forecast.
Multiply the input tokens by the model's input price per token, multiply output tokens by its output price per token, and add the two amounts. If pricing is listed per million tokens, divide the combined token-price calculation by one million.
Providers may price prompt processing and generated output separately because they involve different workloads. Use the model's published input and output rates and estimate each token count independently.
There is no exact universal conversion. Token count depends on the tokenizer, language, vocabulary, punctuation and formatting. The calculator uses an approximate words-to-tokens factor for early planning; use a provider tokenizer for a more precise count.
No. It uses the model rates embedded in the supplied calculator code. Provider pricing and model availability can change, so confirm current rates on official provider pricing pages before making a budget or purchasing decision.
It is the percentage of input tokens assumed to qualify for a cache-read price instead of the standard input price. Actual cache eligibility and savings depend on provider rules, cache hits, model support and cache duration.
It represents the percentage of input tokens assumed to be written to a prompt cache. Cache writes may have a different price from standard input or cache reads, depending on the provider and duration.
Batch processing can suit tasks that do not need an immediate response, such as offline classification or bulk document processing. Check the provider's current batch discount, supported models, limits and completion window.
The calculator multiplies daily request volume by 30.4375 to estimate an average month, then multiplies by the estimated cost per request.
Yes. When a monthly growth rate is entered, the calculator compounds monthly spend over twelve months. With zero growth, it uses twelve times the monthly estimate.
Your bill may include services not modelled here, higher real token usage, retries, longer context, different cache behaviour, taxes, currency conversion, provider-specific fees or updated model prices. Compare estimates with actual usage and invoices.