Claude API Cost Calculator — Interactive Tool

You don’t need a spreadsheet plugin to price a Claude project — you need the current rate card, one formula, and honest token estimates. This claude api cost calculator walks through all three: the full 2026 pricing tables, the tokens-to-dollars math, and six worked scenarios (chatbot, RAG, coding agent, batch pipeline, and more) you can adapt to your own numbers in a couple of minutes.

TL;DR: Cost = (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price). Current prices run from $1/$5 per million tokens on Haiku 4.5 to $10/$50 on Fable 5. English text averages ~4 characters per token. Output tokens cost 5× input, so verbose responses dominate most bills. Caching (~0.1× input for reads) and the Batches API (50% off) are the two biggest levers.

Claude API Pricing in 2026: The Full Table

All Claude API billing is per million tokens (MTok), with separate rates for input (what you send) and output (what the model generates). Verified as of July 2026:

ModelAPI IDInput / MTokOutput / MTokContext
Claude Fable 5claude-fable-5$10$501M
Claude Opus 4.8claude-opus-4-8$5$251M
Claude Opus 4.7claude-opus-4-7$5$251M
Claude Sonnet 5claude-sonnet-5$3 (intro $2)$15 (intro $10)1M
Claude Sonnet 4.6claude-sonnet-4-6$3$151M
Claude Haiku 4.5claude-haiku-4-5$1$5200K

Sonnet 5’s introductory $2/$10 pricing runs through August 31, 2026. Three modifiers matter on top of the base rates: prompt cache reads bill at roughly 0.1× the input price, cache writes at 1.25× (5-minute TTL) or 2× (1-hour TTL), and the Message Batches API takes 50% off for asynchronous workloads. The per-feature fine print lives in the Claude API pricing guide; Anthropic’s official pricing page is the canonical source if rates change after publication.

The Formula: Turning Tokens into Dollars

Every estimate reduces to one line:

cost = (input_tokens / 1_000_000) * input_price
     + (output_tokens / 1_000_000) * output_price

Worked once by hand: a request to Sonnet 5 (standard $3/$15) with 8,000 input tokens and 1,000 output tokens costs (8,000 ÷ 1M × $3) + (1,000 ÷ 1M × $15) = $0.024 + $0.015 = $0.039. Multiply by monthly volume and you have your budget. If caching is in play, split the input term into three parts:

input_cost = uncached_tokens  * (P / 1_000_000)
           + cache_writes     * (P * 1.25 / 1_000_000)   # 2x for 1-hour TTL
           + cache_reads      * (P * 0.10 / 1_000_000)

Note the asymmetry: output tokens cost five times input on every model. In my own billing dashboards, response verbosity — not prompt size — is what usually blows up a forecast. Cap max_tokens sensibly and prompt for concise answers before optimizing anything else.

Estimating Tokens: Rules of Thumb

  • English prose: ~4 characters per token, or ~0.75 words per token. A 1,000-word document is roughly 1,300–1,400 tokens.
  • Code: denser — closer to 3–3.5 characters per token thanks to symbols and indentation.
  • Non-English text: often 1.5–2× more tokens per word than English.
  • Conversation history: counts as input on every turn — a 10-turn chat re-sends everything, so multi-turn costs grow quadratically without caching.

For exact numbers, skip the heuristics and ask the API — the count is free and model-specific:

count = client.messages.count_tokens(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": document_text}],
)
print(count.input_tokens)

(Don’t use tiktoken — it’s OpenAI’s tokenizer and undercounts Claude tokens. Client setup for the snippet above is in the Claude API Python guide.)

Six Worked Cost Scenarios

ScenarioModelPer call (in / out)Monthly volumeEst. monthly cost
Support chatbotHaiku 4.52,000 / 250150,000 calls~$490
RAG assistantSonnet 512,000 / 50060,000 queries~$2,610 (~$1,450 cached)
Coding agentOpus 4.8200,000 / 20,0001,000 tasks~$780 (with caching)
Batch document pipelineHaiku 4.5 + Batches1,000 / 3001,000,000 docs~$1,250
Premium report analysisFable 580,000 / 5,000500 reports~$525
Prototype / side projectSonnet 5 (intro)5M in / 1M out total~$20

How the headline numbers fall out. The chatbot: 150,000 calls × 2,000 input tokens = 300M input ($300) plus 37.5M output ($187.50) — about $488 at Haiku rates. The RAG assistant sends 720M input tokens a month ($2,160) and 30M output ($450) at standard Sonnet 5 rates; caching the shared 8K-token context prefix at a ~90% hit rate drops the input bill to roughly $1,000, for ~$1,450 all-in. The coding agent looks scary at 200K input tokens per task, but agent loops re-read the same context constantly — with ~80% of input served as cache reads, input costs ~$280 instead of $1,000, plus $500 of output. The batch pipeline pairs the cheapest model with the 50% batch discount: 1B input tokens bill $500 and 300M output tokens $750. The Fable 5 report job shows that premium models are affordable at low volume: $400 input + $125 output for 500 deep analyses. And the prototype line is the one I quote to hobbyists: at Sonnet 5’s introductory rates, a month of steady tinkering costs about as much as two coffees.

Five Levers That Cut Your Claude API Bill

  1. Prompt caching. Reads bill at ~10% of input price and don’t count against rate limits. Cache system prompts, tool definitions, and reference documents; a single reuse already pays for the write premium on the 5-minute TTL.
  2. Message Batches. 50% off both directions for anything that can wait — evaluations, backfills, nightly enrichment.
  3. Model routing. Send classification and extraction to Haiku 4.5 and reserve Opus or Fable for requests that need them. A 90/10 Haiku/Opus split routinely cuts bills by two-thirds versus all-Opus. The model comparison guide helps you draw that line.
  4. The effort parameter. output_config={"effort": "low"} (through "max") trims thinking and output tokens on routine work — one of the cheapest wins on current models.
  5. Tighter prompts and caps. Trim boilerplate, cap max_tokens, and instruct concise output — remember output tokens cost 5× input.

What People Get Wrong When Estimating Costs

  • Ignoring output pricing. Budgets built on input tokens alone miss the 5× output multiplier that usually dominates.
  • Forgetting history re-sends. Every turn re-submits the whole conversation as input. Long chats without caching get expensive fast.
  • Counting cache reads as full-price input. They’re ~0.1× — pessimistic models kill projects that would have been profitable.
  • Missing the write premium. Cache writes cost 1.25–2× input; content cached once and never re-read is a net loss.
  • Budgeting without a rate-limit check. Cost tells you if you can afford the volume; your tier decides if you can push it. Cross-check the rate limits guide.

FAQ

How much does the Claude API cost per request?

It depends on tokens and model. A typical request with 2,000 input and 300 output tokens costs about $0.0035 on Haiku 4.5, $0.0105 on Sonnet 5 at standard rates, and $0.0175 on Opus 4.8. Multiply your per-request cost by expected monthly volume for a budget.

How many tokens is 1,000 words of English text?

Roughly 1,300 to 1,400 tokens — English averages about 0.75 words or 4 characters per token. Code is denser and non-English languages often use more tokens per word. For exact counts, use the free count_tokens endpoint with the model you plan to run.

Is there a free tier for the Claude API?

There is no permanent free tier. New Console accounts typically receive a small one-time credit for testing, after which usage is pay-as-you-go. API billing is completely separate from claude.ai subscriptions — a Pro plan does not include API credits.

What is the cheapest way to run high-volume Claude workloads?

Combine Haiku 4.5 ($1 input / $5 output per million tokens) with the Message Batches API’s 50% discount and prompt caching at roughly 0.1 times input price for reads. That stack processes a million short documents for around $1,250 in the batch pipeline example above.

Does prompt caching always save money?

No. Cache writes cost 1.25 times input price (2 times for the 1-hour TTL), so you need the cached prefix to be read again — a single reuse already covers the premium on the 5-minute TTL. Cache stable content like system prompts and tool definitions, not text that changes every request.

Next Steps

Run your own numbers through the formula, sanity-check them with count_tokens, and revisit monthly — intro pricing windows and new models shift the math. For the line-item details behind every rate in this article, read the full Claude API pricing breakdown, and find the rest of the developer series in the Claude API hub.

ClaudeAI.Guide Editorial Team

ClaudeAI.Guide Editorial Team

Independent editorial team behind ClaudeAI.Guide — an unofficial, third-party reference that is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. We cover Anthropic’s Claude AI assistant from a practitioner’s perspective: hands-on tutorials, practical prompts, model comparisons (Claude Opus, Sonnet, Haiku), API walkthroughs, and honest reviews grounded in our own daily use. Everything we publish is tested in real workflows and verified at the time of writing, with no affiliate-driven hype. “Claude” and “Anthropic” are trademarks of Anthropic, PBC, used here for descriptive, nominative fair-use purposes only.

Articles: 72