Prompt cost estimator
Before you ship a feature, you want one number: what does one prompt cost, and what does that mean at scale? Pick a realistic workload, a model and a monthly request volume — the estimator returns per-request, monthly and yearly API cost, with and without prompt caching.
Retrieved docs (3-5 chunks) plus policy prompt, short reply. Output tokens per request: 400 (fixed per workload so estimates stay comparable across models).
GPT-5 mini: $0.25 in / $2 per 1M tokens, $0.025 per 1M cached input tokens. Cache-hit math reduces the input side only — output tokens are never cached.
Same workload, every model that fits the context window
| Model | Per request | Monthly (1K req) | vs cheapest |
|---|---|---|---|
| GPT-5 nanoOpenAI | $0.00034 | $0.34 | — |
| GPT-4o miniOpenAI | $0.00076 | $0.76 | 2.3× |
| DeepSeek V3.2 (chat)DeepSeek | $0.00115 | $1.15 | 3.4× |
| Llama 4 MaverickMeta | $0.00129 | $1.29 | 3.8× |
| GPT-5 miniOpenAI | $0.00168 | $1.68 | 5.0× |
| Gemini 2.5 FlashGoogle | $0.00205 | $2.05 | 6.1× |
| DeepSeek R1 (reasoner)DeepSeek | $0.0028 | $2.80 | 8.4× |
| Kimi K2Moonshot | $0.0031 | $3.10 | 9.3× |
| Claude Haiku 4.5Anthropic | $0.0055 | $5.50 | 16.4× |
| Qwen3 MaxAlibaba | $0.0066 | $6.60 | 19.7× |
| GPT-5OpenAI | $0.00838 | $8.38 | 25.0× |
| Gemini 2.5 ProGoogle | $0.00838 | $8.38 | 25.0× |
Top 12 cheapest models whose context window (3.5K input tokens used here) can hold the prompt. Models that cannot fit the workload are excluded.
Typical workload sizes (use these if you have no data yet)
The fastest way to get a wrong estimate is to guess a token count from word count. These are observed shapes for common product features; they are deliberately round numbers, because precision at the token level is not what decides whether a feature is affordable.
| Workload | Input tokens | Output tokens | What is in the prompt |
|---|---|---|---|
| Short chat turn | 600 | 250 | System prompt + 2 turns + short answer |
| Support reply (RAG) | 3,500 | 400 | 3–5 retrieved chunks + policy prompt |
| Code review of one diff | 8,000 | 1,200 | Diff + related files in, review out |
| Agent step (tool use) | 15,000 | 600 | History resent every step |
| Long-document Q&A | 40,000 | 800 | 30-page contract in context |
| Write a 1,500-word article | 900 | 2,200 | Brief in, draft out |
Monthly API cost at 10,000 requests
The same six workloads priced on three reference points: GPT-5 nano (cheapest tracked), GPT-5 mini (the usual default) and GPT-5 (frontier reasoning). Prices per 1M tokens as of 2026-10-20; cached input is ignored here so the comparison is conservative.
| Workload | GPT-5 nano | GPT-5 mini | GPT-5 |
|---|---|---|---|
| Short chat turn | $1.30 | $6.50 | $32.50 |
| Support reply (RAG) | $3.35 | $16.75 | $83.75 |
| Code review of one diff | $8.80 | $44.00 | $220.00 |
| Agent step (tool use) | $9.90 | $49.50 | $247.50 |
| Long-document Q&A | $23.20 | $116.00 | $580.00 |
| Write a 1,500-word article | $9.25 | $46.25 | $231.25 |
Workloads: Short chat turn, Support reply (RAG), Code review, Agent step, Document Q&A, 1,500-word article. 10,000 requests per month, no caching, no retries.
Where prompt-cost estimates actually go wrong
1. History resending. In a chat product, request N carries the previous N−1 turns. After ten turns the input is roughly ten times the first message, so per-conversation cost scales quadratically while your dashboard reports a flat per-request price. Cap history, or summarise it, before you trust any monthly projection.
2. Retrieved context that quietly grows. A RAG pipeline tuned for quality tends to add chunks: three chunks become eight, and a 1,200-token input becomes 3,500. That is a 3× cost increase with no visible product change. Log input tokens per request — not just per month — so the drift is visible.
3. Reasoning tokens. On reasoning models you are billed for internal thinking you never see. Short answers can cost as much as long ones. If you route to a reasoning model by default, model that in the output-token field and treat the result as a floor.
4. Retries and tool loops. Agents retry on malformed JSON and call tools several times before answering. 10–25% headroom is normal; 2× is normal for a poorly constrained agent.
How to cut the per-prompt cost
Cache the stable prefix. Put the system prompt and fixed context first, keep it byte-identical, and let the provider cache it. Cached input is typically 10–20% of the normal price, so a workload with a large fixed prompt and a short answer can drop by more than half.
Route by difficulty. Most chat traffic does not need a frontier model. Send easy turns to a mini-class model and escalate only when the answer is uncertain or the task is multi-step. Measure the escalation rate; it is usually below 30%.
Shrink the output. Output is the expensive side, so an instruction like “answer in at most three sentences” often saves more than switching models. Structured JSON output is cheaper than prose for the same information.
Frequently asked questions
How do I estimate the cost of a prompt before running it?
Count the tokens on both sides. Input tokens are everything you send: system prompt, retrieved context, conversation history and the user message. Output tokens are the reply, and they are priced 2–8× higher. Multiply each by the model's per-million price, then multiply by requests per month. The estimator on this page does that for six typical workloads so you can compare models without running anything.
Why is my actual bill higher than the estimate?
Three things are usually missing from a naive estimate: (1) conversation history — every follow-up resends the whole thread, so input grows quadratically across a session; (2) retries, failed generations and tool-call loops, which add 10–25%; (3) reasoning tokens on models like GPT-5 or o-series, which are billed as output even though you never see them. Add 15–25% headroom, more for agents.
Does prompt caching really cut costs?
Only the input side, and only for the cached prefix — typically the system prompt plus stable context. Providers charge 10–20% of the normal input price to read a cache hit. If 70% of a 3,500-token input is cached at $0.125 instead of $1.25 per million, per-request cost drops by roughly 20–60% depending on the output ratio. Output is never cached.
What is a realistic cost for a RAG support assistant?
A support reply with 3,500 input tokens and 400 output tokens costs about $0.0017 per request on GPT-5 mini and $0.0084 on GPT-5. At 10,000 replies a month that is $16.75 versus $83.75 — usually the difference between a project that ships and one that does not.
Should I estimate per prompt or per user?
Estimate per request first, then multiply by requests per user per month. A chat user sending 40 messages a day is a very different unit cost from a user running one nightly report. Agents are the trap: a single user action can trigger 10–50 model calls, each resending the accumulated history.