THE SHORT ANSWER
Estimate monthly AI API spending by multiplying user actions by model calls per action, then pricing the input and output of each call. Add caching, retries and non-token charges separately. A useful forecast includes a normal scenario and a heavy-usage scenario rather than one deceptively precise number.
Which inputs do you need?
Start with active users, actions per user per day and active days per month. Then list the model calls behind each action. A visible “generate report” button may trigger classification, retrieval, drafting and validation.
For each call, estimate regular input, cache reads, cache writes and output. Use observed usage from an existing product where available. For a new product, label assumptions and revise them as real data arrives.
How does the basic monthly calculation work?
Consider an illustrative product with 1,000 active users, five actions per day and 20 active days. That produces 100,000 monthly actions. If each action makes two model calls, the forecast contains 200,000 calls.
At 1,500 input and 300 output tokens per call, monthly usage is 300 million input and 60 million output tokens. With hypothetical rates of $0.50 input and $2 output per million tokens, the bill is $150 plus $120: $270.
This is a planning example, not a Tokely quote.
How do retries change the forecast?
If 5% of those calls require exactly one additional fully billable call of the same size, the token estimate increases to $283.50. If retries use a larger model or a longer prompt, calculate that attempt separately instead of adding a flat 5%.
Timeouts and partial streams can produce uncertain usage. Reconcile them after settlement, and maintain a contingency while forecasting.
How should you model caching?
Divide input into regular, cache-read and cache-write categories using the provider’s billing definitions. Estimate eligible reuse, not just repeated text. Cache expiry, routing and prompt changes can reduce the hit rate.
Do not multiply the entire bill by a claimed cache discount. Output and uncached content remain chargeable. For the worked distinction, read prompt caching vs semantic caching.
What belongs outside the token subtotal?
Add embedding generation, vector storage, search tools, media generation, infrastructure and platform fees where applicable. Keep taxes and currency conversion visible if they affect your cash budget.
Also allow for growth in conversation length. A product with unchanged user counts can consume more tokens when users build longer histories or attach larger documents.
How do you make the forecast useful for decisions?
Create low, expected and high scenarios by changing the assumptions that drive usage. Report the biggest sources of uncertainty. If output length dominates cost, refining that estimate is more useful than debating a tiny infrastructure charge.
Use the Tokely calculator to compare the current token rates of candidate models. Check billing documentation for reservations and settlement, then reconcile the forecast with actual cost per customer and feature each month.