Model & prices (USD per 1M tokens)
$
$
%
Your usage
msgs
turns
tokens
tokens
tokens
Savings levers (tick what you would apply)
$
$
Monthly cost now
—
no savings applied
With checked levers
—
per month
Savings
—
per month
Cost per message
—
with checked levers
Which lever saves what
Step (cumulative)Monthly costSaved so far

📐 Formula: for one conversation of T turns, message k sends the system prompt, your message and the last min(k−1, N) exchanges. Cost = input tokens × input price + output tokens × output price, per million. Monthly cost = messages ÷ T × cost per conversation.

How AI APIs bill tokens, and how to cut the bill

Your bill is not "messages × price". Every API call is stateless, so the provider reads the full prompt again each time. Three things set the size of that prompt: the system prompt you send every time, the history of the conversation, and the length of each answer, which is also the most expensive part per token.

Where the money goes

Output tokens usually cost several times more than input tokens. In a long chat the input grows with each turn, so a conversation of ten turns can cost many times more than two single questions. Use the "Which lever saves what" table above to see which change pays off most for your usage.

Free or nearly free savings (no quality loss)

Trade-offs: measure before you apply them

Apps, plugins and tools

Prompt templates that cut tokens

Answer in at most 80 words. No introduction, no summary at the end.
Return only valid JSON with the keys: title, category, priority. No other text.
Use the conversation summary below instead of the full history: [summary]

Suggested order

1) Turn on caching and shorten the system prompt. 2) Cap output length. 3) Only then trim history or route to a cheaper model, and check quality on real examples each time.

Frequently asked questions

How do AI APIs charge for tokens?

Most providers bill input tokens (everything you send: system prompt, history, user message) and output tokens (the answer) separately, per million tokens. Output usually costs several times more than input.

Why does a chat get more expensive as it goes on?

Chat APIs are stateless. Each new message re-sends the whole conversation so far, so input tokens grow with every turn. A 10-turn chat sends far more than ten times the tokens of a one-off question.

What is prompt caching?

Providers can reuse the processing of a repeated prefix (usually the system prompt and fixed documents) and charge a lower rate for those cached input tokens. Caching only helps when the start of the prompt is identical between requests, so keep stable text first.

How accurate is this calculator?

It is an estimate. Prices in the presets are examples, so enter your provider's current prices. Token counts are your own guesses about message length; real tokenizers differ, and non-English text (including Russian) often takes more tokens per word.

Related calculators