Prompt Optimization Calculator
Free prompt optimization calculator with 2026 model rates for OpenAI, Anthropic, Google Gemini, DeepSeek, Mistral and xAI. Measure token reduction, dollars saved and an efficiency score that keeps quality honest. No sign-up.
- Reduction
- 40.0%
- 1,200 tok/run saved
- Saved / mo
- $5.76
- 20,000 runs/mo
Optimization at a glance
$0.000288
1,200 tok
$69.12
58 / 100
C · Needs work
85 / 100
Your prompts — results update live
Live result
- Saved / mo
- $5.76
- Reduction
- 40.0%
- Saved / yr
- $69.12
- Score
- 58 / 100 (C · Needs work)
Model & provider comparison for this workload
| Provider · Model | Input $/1M | Output $/1M | Monthly | Note |
|---|---|---|---|---|
| OpenAI · text-embedding-3-smallCHEAPEST | $0.020 | $0.000 | $0.7200 | Embeddings — input only. |
| Google · Gemini 1.5 Flash | $0.075 | $0.300 | $5.70 | Cheapest big-lab model. |
| OpenAI · GPT-4o mini | $0.150 | $0.600 | $11.40 | Budget default for most tasks. |
| Meta (self-host) · Llama 3.1 70B* | $0.350 | $0.400 | $16.60 | *Hosting cost via Together/Fireworks ≈. |
| Anthropic · Claude 3 Haiku | $0.250 | $1.250 | $21.50 | Fast + cheap Anthropic tier. |
| DeepSeek · DeepSeek V3 | $0.500 | $2.000 | $38.00 | Open-weight value leader. |
| DeepSeek · DeepSeek R1 | $0.550 | $2.190 | $41.70 | Reasoning model, MoE efficient. |
| Google · Gemini 1.5 Pro | $1.250 | $5.000 | $95.00 | Huge context, cache discounts. |
| Mistral · Mistral Large | $2.000 | $6.000 | $132.00 | EU-hosted flagship. |
| xAI · Grok 2 | $2.000 | $10.000 | $172.00 | X-integrated flagship. |
| OpenAI · GPT-4o | $2.500 | $10.000 | $190.00 | Flagship multimodal default. |
| Anthropic · Claude 3.5 Sonnet | $3.000 | $15.000 | $258.00 | Best reasoning / coding mix. |
Same workload priced on every model — only per-token rates change. Output billed higher everywhere. Prices: Oct 2026 public API tiers; batch (−50%) and cache (−50–75%) not applied.
Cost-optimization checklist
Tick off what already ships — this page scores 1/6 (17%).
Learn — AI costs, deeply
An AI bill is requests × tokens × rate × rounds. Providers publish per-token prices, but your architecture decides the multipliers: which tier answers, how much context you send, whether prefixes hit cache, whether async work uses batch, and how many tool-call rounds each task needs. Master those five levers and most teams cut 50–90% without changing what users see.
1 · How per-token pricing really works (and the formula)
monthly = cost/request × requests/day × 30 × rounds-multiplier
blended $/1M = in% × $in + out% × $out · batch ≈ ×0.5 · cached input ≈ ×0.25–0.5
Tier first
25–100× range
GPT-4o ($10/1M out) vs mini ($0.60/1M out) on identical tokens. Routing beats haggling.
Outputs next
2–5× input
Capped completions, structured outputs, and fewer agent rounds cut the dearest tokens.
Volume last
linear × discounts
Cache, batch, and annual commits bend the curve once architecture is lean.
Honest limits: public rates move quarterly and hide add-ons (throughput units, private endpoints, support). Treat calculator outputs as planning estimates — reconcile monthly against provider invoices and own logs.
2 · Token math — count before you pay
| Unit | ≈ Tokens | Rule of thumb |
|---|---|---|
| 1,000 words (English) | ~1,330 | words × 1.33 |
| 4,000 characters | ~1,000 | chars ÷ 4 |
| 1024×1024 image | ~250–1,000 | rises with detail / tiling |
| 1 min audio (STT) | ~3–6K* | *often billed per-minute instead |
| Chat turn (support) | ~1.5–3K | history + system + answer |
Measure your own p50/p95 per endpoint for a week — averages hide the long-tail threads that dominate spend. Code and non-English text tokenize denser; always sample real traffic, not docs examples.
3 · Factor-impact table — what moves the bill most
| Factor | Typical impact | Why |
|---|---|---|
| Model tier choice | Very high | Flagship vs mini/flash is a 25–100× swing on identical tokens. Route by difficulty. |
| Output token volume | Very high | Output costs 2–5× input and compounds with agents (3–5 rounds per task). Cap max_tokens. |
| Prompt bloat | High | Stuffed context is billed every call. Retrieve (RAG) instead of pasting whole docs. |
| Cache hit rate | High | Cached system prompts/docs bill at 25–50%. Stable prefixes = free money. |
| Batch vs real-time | High | Batch APIs cost ~50% for async work (ETL, evals, moderation, backfills). |
| Tool-call loops | Medium–high | Each agent round re-sends history. Compact transcripts + stop conditions. |
| Multimodal inputs | Medium–high | One image ≈ 250–1,000 tokens; a minute of audio ≈ 3–6K tokens. |
| Retries / errors | Medium | Partial generations still bill. Timeouts + idempotency keys stop double-spend. |
| Over-provisioned context | Medium | 1M-context calls tempt 10× prompts. Only send what the task needs. |
| Region / egress | Low | Minor vs token cost, but private endpoints + data-residency add fixed fees. |
| Fine-tune hosting | Low–medium | Inference billed like base model; savings come from shorter prompts, not cheaper tokens. |
| Self-host fixed cost | Lever | GPU $/hr beats API $/token only past break-even volume — model it before migrating. |
Cache + batch playbook (fastest payback)
- • Freeze stable prefixes (system prompt, tools schema, top docs) so cache hits.
- • Route evals, moderation, backfills and nightly ETL to Batch API (−50%).
- • Log cache-hit % weekly; a 60%+ hit rate halves effective input price.
- • Keep temperature/format stable — churned phrasing busts cache silently.
GPU-vs-API break-even playbook
- • GPU monthly ≈ $/hr × 730 × utilization. API monthly ≈ tokens × blended rate.
- • Example: RTX 4090 at $0.49/hr ≈ $358/mo — beats GPT-4o mini only past ~600M tok/mo.
- • Add engineering cost: drivers, scaling, evals, on-call. APIs bundle that.
- • Re-run quarterly — rate cuts keep moving the break-even point upward.
4 · TCO: the bill beyond tokens (4-week measurement protocol)
- Week 1 — instrument: log input/output tokens, model, cache-hit, latency per request.
- Week 2 — change one lever (tier router, cache, batch, or caps) on a canary slice.
- Score = (new − old) ÷ old on cost/request, quality (evals), and p95 latency.
- Add people + infra: TCO = API + GPU/hosting + vector DB + evals + support deflection value.
- Hold a control slice — provider-side changes move everyone at once; diff against it.
5 · RAG vs fine-tuning, honestly priced
- RAG pay-as-you-go — embeddings (~$0.02/1M) + vector DB ($20–200/mo) + retrieved tokens per query. Wins when knowledge changes or needs citations.
- Fine-tuning upfront — training tokens billed once (e.g. mini ≈ $3/1M) + eval + shorter prompts forever. Wins for stable style/format/reasoning.
- Combine them — fine-tune the format, retrieve the facts. Most production systems do both.
- YMYL note — calculators here are planning estimates, not procurement or legal advice; validate against contracts.
6 · Benchmarks & standards we cite
| Workload | Typical $/mo | Tokens |
|---|---|---|
| Side-project chatbotGPT-4o mini / Haiku tier. | $5–$25 | ~5M / mo |
| Growing SaaS copilotMixed mini + flagship routing. | $150–$800 | ~100M / mo |
| Support automation (10K chats)Model choice = 10× swing. | $120–$1,900 | ~250M / mo |
| Doc-processing pipelineBatch API halves this. | $60–$400 | ~200M / mo |
| Enterprise RAG rolloutCache + self-host evaluated. | $2K–$25K | ~2B / mo |
- Provider pricing pages (OpenAI, Anthropic, Google AI, DeepSeek, Mistral, xAI) — per-token source of truth
- NIST AI Risk Management Framework (AI 100-1) — cost-aware deployment & monitoring
- ISO/IEC 42001:2023 — AI management system (budget, roles, measurement)
- Schema.org WebApplication + FAQPage + HowTo — structured data used on these pages
- WCAG 2.2 AA — accessible calculator UX (labels, contrast, keyboard)
Frequently Asked Questions
10 answers covering pricing, tokens, models, caching, batch, RAG, GPUs and budgeting — each targets an exact search phrase.
How is prompt optimization measured?
What is a good prompt efficiency score?
How much can prompt optimization save?
Does compression hurt answer quality?
What is prompt caching versus compression?
How do few shot examples affect cost?
How do I budget prompt experiments?
When should I stop optimizing?
Can I compare models here?
Is this calculator free?
Long-tail questions this page answers
Each phrase below maps to a section or FAQ further down — written to match the exact phrasing searchers type.