induwara.lk
induwara.lkDevelopers · AI

AI API Cost Calculator — OpenAI, Claude & Gemini

Work out the monthly bill before you ship an LLM feature. Pick a model, enter your tokens and request volume, and see the cost per request and per month in USD and Sri Lankan rupees — with a cheapest-first table of every model and optional batch and cache discounts. No signup, sources cited below.

By Induwara AshinsanaUpdated Jun 30, 2026
Estimate your monthly API billUSD & LKR
List prices · verified Jun 2026

Prices shown are input/output USD per 1M tokens.

req

How many API calls your app makes in a month.

tok

Average prompt size (system + user + context).

tok

Average completion length the model returns.

Rs

CBSL indicative rate — edit to today's value.

Monthly cost (USD)
$105.00
Claude Sonnet 4.6
Monthly cost (LKR)
Rs 31,500
Per 1,000 requests
$10.50
$0.0105 per request
Blended rate
$7.00/1M
Across this input/output mix

Where the money goes

Input tokens$30.0028.57%
Output tokens$75.0071.43%
Monthly total$105.00

Output tokens usually dominate the bill — they are priced 3–5× higher than input on every model here. Cache discounts only touch the input term; the one-time cache-write surcharge is excluded.

Compare every model (cheapest first)

Switching to the cheapest saves $102.50/mo (Rs 30,750)
ModelMonthly USDMonthly LKRvs selected
OpenAI
$2.50Rs 750-97.62%
Google
$3.00Rs 900-97.14%
OpenAI
$4.50Rs 1,350-95.71%
Meta (Together AI)
$4.75Rs 1,425-95.48%
Mistral
$5.00Rs 1,500-95.24%
Meta (Together AI)
$6.95Rs 2,085-93.38%
DeepSeek
$8.20Rs 2,460-92.19%
OpenAI
$12.50Rs 3,750-88.1%
Google
$15.50Rs 4,650-85.24%
DeepSeek
$16.45Rs 4,935-84.33%
OpenAI
$33.00Rs 9,900-68.57%
Anthropic
$35.00Rs 10,500-66.67%
Mistral
$50.00Rs 15,000-52.38%
OpenAI
$62.50Rs 18,750-40.48%
Google
$62.50Rs 18,750-40.48%
OpenAI
$75.00Rs 22,500-28.57%
Anthropic
$105.00Rs 31,500
Anthropic
$175.00Rs 52,500+66.67%
OpenAI
$450.00Rs 135,000+328.57%

Tap any row to recompute the headline for that model. Batch and cache toggles apply to every row that supports them.

Prices are vendor list prices snapshotted on 2026-06-30 — not a live feed.

How it works

Large-language-model APIs price input (prompt) tokens and output (completion) tokens separately, quoted in US dollars per 1,000,000 tokens. Output is always more expensive — 3–5× on every model in this table — because the model runs a full forward pass to generate each output token, whereas input tokens are read in one batched pass. That single fact is why your bill is usually driven by how much the model writes, not how much you send.

For a chosen model with input price Pin and output price Pout (USD per 1M tokens), the calculator runs:

  1. Monthly token volumes: inTokens = inputPerReq × requests and outTokens = outputPerReq × requests.
  2. Base cost: inputCost = inTokens ÷ 1e6 × Pin and outputCost = outTokens ÷ 1e6 × Pout.
  3. Cached input (if enabled): the cached fraction cof input tokens is billed at the provider's cache-read multiplier m instead of full price, so inputCost = inTokens ÷ 1e6 × Pin × ((1 − c) + c × m). Anthropic cache-read is 0.1×; OpenAI cached input is 0.25–0.5× by family; Google context-cache read ≈ 0.25×.
  4. Batch (if enabled): batch-eligible providers discount both input and output by 50% (× 0.5), applied after the cache adjustment.
  5. Monthly total = inputCost + outputCost; per request = total ÷ requests; LKR = USD × your editable CBSL rate.

Every per-1M figure in the underlying data module carries an inline source URL, and the math is reconciled against a second independent per-1,000-token formula so the arithmetic can't drift. The comparison table reruns this for all models on every input change and sorts cheapest-first, so a lower-cost substitute is always one glance away.

Worked examples

Support bot on Claude Sonnet 4.6

1,000 in · 500 out · 10,000 req/mo · no discounts

  1. inTokens = 1,000 × 10,000 = 10,000,000 → 10 × $3 = $30.00
  2. outTokens = 500 × 10,000 = 5,000,000 → 5 × $15 = $75.00
  3. Monthly = $30.00 + $75.00 = $105.00
  4. Per request = $0.0105 ; per 1,000 = $10.50
  5. At Rs 300/USD → Rs 31,500.00 / month

High-volume batch job on Claude Haiku 4.5

2,000 in · 800 out · 50,000 req/mo · batch on

  1. inTokens = 2,000 × 50,000 = 100,000,000 → 100 × $1 = $100.00
  2. outTokens = 800 × 50,000 = 40,000,000 → 40 × $5 = $200.00
  3. Subtotal = $300.00 ; batch −50% → $150.00 / month
  4. Per request = $0.003
  5. At Rs 300/USD → Rs 45,000.00 / month

Cached-prompt RAG app on Claude Sonnet 4.6

1,000 in (80% cached) · 500 out · 10,000 req/mo

  1. cacheFactor = (1 − 0.8) + 0.8 × 0.1 = 0.28
  2. inputCost = 10 × $3 × 0.28 = $8.40 (down from $30.00)
  3. outputCost unchanged = $75.00
  4. Monthly = $8.40 + $75.00 = $83.40
  5. Caching cuts the input term ~3.5×; output still dominates.

Frequently asked questions

Sources & references

Prices were last cross-checked against these sources on 2026-06-30. 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

Rate this tool
Be the first to rate

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, edge case, or want another model added?

Email me at [email protected] — most fixes ship within 24 hours.