Free developer tool
Context Budget Studio
See what your LLM context actually costs. Paste an agent prompt, system message, or RAG payload — it estimates tokens locally, prices the same call across six models, flags the 32K accuracy cliff, heatmaps which chunks eat your budget, and models prompt-cache savings. Nothing leaves your browser.
Context input
Model cost matrix
One call = your input + response tokens. Prices are per 1M tokens and editable — click a number to match today's rates.
| Model | In $/M | Out $/M | Cost / call |
|---|---|---|---|
Claude Opus 4.8frontier · 200K ctx | $0.0585 | ||
Claude Sonnet 5balanced · 200K ctx | $0.0117 | ||
Claude Haiku 4.5fast · 200K ctx | $0.00390 | ||
GPT-4oomni · 128K ctx | $0.00800 | ||
GPT-4o minicheap · 128K ctx | $0.00048cheapest | ||
Gemini 2.5 Prolong ctx · 1,000K ctx | $0.00750 |
Accuracy cliff gauge
Benchmarks show model accuracy sliding well before the max window — often near ~32K tokens. Position matters more than the limit.
Chunk cost heatmap
Blocks split on blank lines. The hottest chunks are where trimming buys the most — the core move of context engineering.
Prompt-cache ROI
Repeated static context (system prompt, tools, docs) can be cached: ~0.1× to read vs. full price each call. Model your loop.
How these numbers are calculated
Every dollar figure — the cost matrix, the A/B deltas, and the cache projection — comes from a single formula:
Worked example — the default prompt on Sonnet 5: (399 ÷ 1M) × $3 + (700 ÷ 1M) × $15 = $0.011697 per call.
- The token count is the only estimate. It's a character/word heuristic — no tokenizer ships to your browser — so treat it as ±10–15%. The cost arithmetic on top of it is exact. For a precise count, run the provider's own tokenizer.
- Prices are yours to set. The defaults are illustrative 2026 list rates per 1M tokens; click any In/Out cell in the matrix to match your provider's live pricing and every panel recomputes instantly.
- Output usually dominates. Response tokens bill at the higher output rate, so a model like Opus ($75/M out) moves the total far more than its input price. Set the “Response tokens” field to your real average.
Why context cost matters in 2026
Agentic workflows burn tokens 10–100× faster than chat, because every reasoning step re-sends the accumulated context on each tool call. Teams routinely report individual developers spending $400–$1,500 per month on coding agents, with outliers far higher during long autonomous runs. The three levers that reliably cut that bill are context engineering (send the minimum set of high-signal tokens), prompt caching (reuse a static prefix at a fraction of the price), and model-tier routing (send cheap work to small models). This tool is a fast way to reason about all three before you ship a prompt.
Frequently asked questions
How does Context Budget Studio estimate tokens?
It uses a character- and word-based heuristic that runs entirely in your browser — no model tokenizer or vocabulary is shipped client-side, and no text is sent to a server. Treat the counts as roughly ±10–15%: accurate enough to compare prompts and plan a budget, but not exact billing figures. For precise counts, run the provider’s own tokenizer.
How is cost per call calculated?
Cost per call = (input tokens ÷ 1,000,000) × the model’s input price + (output tokens ÷ 1,000,000) × its output price, using the per-1M-token rates in the matrix (which you can edit). For example, the default prompt on Claude Sonnet 5 works out to (399 ÷ 1M) × $3 + (700 ÷ 1M) × $15 = $0.011697 per call. The token count is a heuristic estimate (±10–15%), but the arithmetic on top of it is exact.
What is the “32K accuracy cliff”?
Benchmarks (including a widely cited Databricks evaluation) have found that answer correctness for several frontier models starts to decline around 32,000 tokens of context — well before the advertised maximum window — especially when the relevant fact sits in the middle of a long prompt. The gauge shows where your context sits relative to that point, because position often matters more than the hard limit.
Are the model prices accurate?
The defaults are illustrative 2026 list rates per 1M tokens for Claude Opus/Sonnet/Haiku, GPT-4o and GPT-4o mini, and Gemini 2.5 Pro. Every price cell is editable — click a number and type your provider’s live rate, and the whole cost matrix, cache ROI, and A/B comparison recompute instantly.
How does the prompt-cache savings estimate work?
Cache-aware providers let you reuse a static prefix (system prompt, tool schemas, large documents) at roughly 0.1× the input price to read, versus full price every call. Enter your calls per day, the share of the prompt that is cacheable, and the read multiplier, and the panel projects monthly spend with and without caching, assuming a warm cache.
Does any of my prompt text get uploaded?
No. The whole tool is client-side JavaScript — estimation, pricing, and exports all run locally with no network calls and no API keys. The “Share link” button is the only way your content leaves the page, and only if you choose to copy and send that link, which encodes your inputs into the URL.