AI Long-Context Pricing Calculator
Some models charge a premium once a prompt passes 200,000 tokens — and reprice the whole request, not just the overage. This calculator shows that jump before you ship, with the surcharge over a naive flat-rate estimate in USD and Sri Lankan rupees. No signup, sources cited below.
How it works
A handful of long-context models — Gemini 2.5 Pro and the Claude Sonnet 4.5 1M-context beta among them — bill in two tiers. Below a 200,000-input-token threshold you pay the standard rate; above it, a higher long-context rate. The trap is that both Google and Anthropic apply the higher rate to the entire request, not only to the tokens beyond the threshold. There is no marginal, per-overage tier for long context at any listed vendor, so a prompt one token over the line reprices in full.
For a model with standard input/output rates stdIn / stdOut and long-context rates longIn / longOut (USD per 1M tokens), the calculator runs:
- Tier selection by input tokens:
tier = inputTokens > 200,000 ? long : standard. The test is strict — exactly 200,000 tokens stays on the standard tier. Flat models skip this step entirely. - Rate pick:
inRate = long ? longIn : stdInand likewise for output. The long tier changes both input and output pricing. - Per-request cost:
costIn = inputTokens ÷ 1e6 × inRate,costOut = outputTokens ÷ 1e6 × outRate, summed. - Monthly = per-request × requests per month. LKR = USD × your editable CBSL rate.
- Premium: the same tokens are priced again at the standard rate, and the difference is the surcharge —
surcharge = perReq − stdPerReq, as a percentage of the standard cost. It is $0 for standard-tier and flat models.
Every per-1M figure in the underlying data module carries an inline source URL, and the arithmetic is reconciled against an independent per-1,000-token formula so it can't drift. The comparison table reruns the whole calculation for every model on each input change and sorts cheapest-first — because a flat-rate model often undercuts a tiered one once the prompt is large enough.
Worked examples
Frequently asked questions
Sources & references
- Google — Gemini API pricing (≤200K vs >200K input tiers)
- Google — Gemini long context (200K threshold, whole-prompt tiering)
- Anthropic — pricing incl. Claude 1M-context beta (>200K premium)
- OpenAI — API pricing (GPT-4.1 / GPT-5 flat long-context rates)
- Central Bank of Sri Lanka — daily indicative exchange rates
Prices were last cross-checked against these sources on 2026-07-11. This tool is a calculator over a snapshotted price table, not a live feed — confirm the current rate on the official page before committing a budget.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Spotted a stale price, a new tier, or want another model added?
Email me at [email protected] — most fixes ship within 24 hours.