GuidesCalculator
AI chatbot conversation cost calculator
The calculator
- Tokens read per conversation
- —
- Tokens written per conversation
- —
- Cost of one conversation
- —
- Cost per month
- —
The starting prices are an example: replace them with your provider’s.
The calculation
At turn n, the model reads the system prompt, the n − 1 previous exchanges and the new message. We add this up over all turns, then apply the input and output prices.
Three levers
- 1SummariseAfter a few turns, the history becomes a short summary.
- 2CacheThe system prompt, identical at every turn, costs less when cached.
- 3ShortenBrief answers: output is the most expensive part.
For a single call: the token calculator. To understand why: the context window.
Frequently asked questions
- Why does the cost climb so fast?
- The tenth message makes the model re-read the nine before it and their answers. The volume read grows roughly with the square of the number of turns.
- How can I reduce the cost?
- Summarise the history after a few turns, cache the system prompt, and limit answer length.
- Are my figures sent anywhere?
- No. The calculation runs in your browser.