Estimate what your AI app will cost: enter input/output tokens and requests to see per-call and monthly spend. Prices are editable to match any model. ✓ Editable rates
LLM API spend
Large language models charge by the token (~¾ of a word), with separate prices for input (your prompt) and output (the model's reply) — usually quoted per million tokens. Output is typically 3–5× more expensive than input, so long replies dominate cost. The formula: cost = (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price), times your request volume.
Because prices change often and vary by provider, this calculator keeps the rates editable — drop in the exact numbers from your provider's pricing page. To cut spend: trim prompts, cap output length, cache repeated context, and use a smaller model for simple tasks. Estimate only.
Large language model APIs bill per token, and input and output tokens are priced differently — output typically costs several times more than input, because generating tokens is more computationally expensive than reading them. A token is roughly four characters of English, so about 750 words per thousand tokens, though code and non-Latin scripts tokenise less efficiently. The cost driver most people miss is conversation history: in a multi-turn chat the entire prior exchange is resent as input on every request, so input cost grows quadratically with conversation length unless caching is used.
Cost = (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price)Tokens ≈ characters ÷ 4, or words × 1.33Multi-turn: cumulative input = Σ of all prior turns resent each timeCached input is typically priced far below fresh inputwhere:
Assumptions: Prices vary by model and change frequently; check current provider pricing rather than relying on a cached figure. Token counts differ between tokenisers, so estimates from one provider do not transfer exactly to another.
Cost a month of API usage, then show what prompt caching saves.
Result$19.20 — falling to $12.72 with prompt caching
The output-heavy cost profile is why asking for concise responses reduces spend more than shortening prompts. Caching helps most in long agentic conversations where a large stable context is resent on every turn — exactly the workload where naive costs escalate fastest.