Claude API Pricing: Cost per Request Calculator

Published · 1 views
Claude API Pricing: Cost per Request Calculator

Claude API pricing is charged per million tokens, with separate rates for input and output, and the model you pick changes the bill by a factor of 100. On Anthropic's pricing page as of November 2, 2026, Haiku 5.5 costs $0.10 per million input tokens and Fable 5.1 costs $10. A typical request of 2,000 input tokens and 500 output tokens costs about $0.00045 on Haiku 5.5 and $0.045 on Fable 5.1. This post gives you the current numbers and a short script that turns your own request size into dollars, so you can work out your Claude API cost before you ship.

My angle: a price table goes out of date, but a script with the prices in one dict does not. You change the numbers when the page changes and everything else stays correct.

Claude API pricing by model

These are the rates for the current models, in US dollars per million tokens (MTok), copied from Anthropic's pricing page. The page itself shows no update date and points to claude.com/pricing for the latest figures, so check there before you commit to a budget.

Model Input Output Cache read
Haiku 5.5 (prompts up to 100k tokens) $0.10 $0.50 $0.01
Sonnet 5.5 $2 $10 $0.10
Opus 5.5 $4 $20 $0.20
Fable 5.1 $10 $50 $0.25

Output tokens cost five times as much as input tokens on every model in that table. That ratio is the first thing to remember when you estimate cost, because a long answer costs far more than a long prompt.

Calculate your Claude API cost per request

Here is the script I used. The prices come from the table above, and nothing else is assumed:

# claude_cost.py - USD per million tokens, from Anthropic's pricing page on 2026-11-02
PRICES = {  # input, output, cache_read
    "Haiku 5.5":  (0.10, 0.50, 0.01),
    "Sonnet 5.5": (2.00, 10.00, 0.10),
    "Opus 5.5":   (4.00, 20.00, 0.20),
    "Fable 5.1":  (10.00, 50.00, 0.25),
}
M = 1_000_000

def cost(model, fresh_in, out, cached_in=0, batch=False, us_only=False):
    i, o, cr = PRICES[model]
    total = (fresh_in * i + out * o + cached_in * cr) / M
    if batch:   total *= 0.5   # batch API: 50% off input and output
    if us_only: total *= 1.1   # inference_geo "us": 1.1x on all token types
    return total

I ran it for 10,000 requests a month, each with 2,000 input tokens and 500 output tokens. This is the real output:

model         1 request   10k / month   batch 10k   cached 10k
Haiku 5.5       0.00045          4.50        2.25         3.15
Sonnet 5.5      0.00900         90.00       45.00        61.50
Opus 5.5        0.01800        180.00       90.00       123.00
Fable 5.1       0.04500        450.00      225.00       303.75

I also checked the Sonnet 5.5 single request by hand: 2,000 input tokens at $2 per million plus 500 output tokens at $10 per million is $0.004 + $0.005 = $0.009. It matched the script.

What changes the number

Batch API. Batch requests get a 50% discount on input and output. That is the "batch 10k" column. The catch is that batch is for work that can wait, not for a chat reply a user is staring at.

Prompt caching. In the "cached 10k" column, I assumed 1,500 of the 2,000 input tokens are a prefix that is already cached, so they are billed at the cache-read rate. On Sonnet 5.5 that took the month from $90.00 to $61.50. This number is optimistic in one way: it leaves out the cost of writing the cache. According to the pricing page, a 5-minute cache write costs 1.25 times the base input price, and an hour-long write costs 2 times. If your prefix changes often or the cache expires between requests, you will pay the write cost again and save less.

Data residency. Setting inference_geo: "us" adds a 1.1 multiplier to all token types on Claude 4.6 and newer models. For the same Sonnet 5.5 workload, my script gives $99.00 instead of $90.00.

Long prompts on Haiku 5.5. Haiku 5.5 is priced by prompt length. Above 100,000 prompt tokens, which includes cache reads and writes, it moves to $0.50 input and $2.50 output. My script only uses the lower rate, so it would underestimate a long-prompt Haiku workload.

Tools. Tool use adds hidden input tokens to every request. The pricing page lists 286 extra tokens for Opus 5.5, Sonnet 5.5 and Haiku 5.5 with automatic tool choice, and web search costs $10 per 1,000 searches on top of tokens. My script does not include either, so add them if your app calls tools.

When this calculator does not apply

It is an estimate of API token cost only. It does not cover Claude Code or Claude subscription plans, which are billed differently. It also does not apply if you call Claude through Amazon Bedrock or Google Cloud, which have their own pricing, and the pricing page says their regional endpoints carry a 10% premium over global ones. If you only want to cut your Claude Code usage, see my post on reducing Claude Code token usage.

Check your tokens before you trust the estimate

The calculator is only as good as your token counts. Context size and input size are different things, and a model's window limits what you can send. My notes on Claude context window size by model cover the limits. If a request starts failing after an SDK upgrade, see the Claude API 400 error with temperature, top_p and top_k.

Frequently Asked Questions

How much does the Claude API cost per request?

It depends on the model and the token count. With 2,000 input tokens and 500 output tokens, my script gives $0.00045 on Haiku 5.5, $0.009 on Sonnet 5.5, $0.018 on Opus 5.5 and $0.045 on Fable 5.1.

Is there a cheaper way to run Claude?

Two ways in the pricing page: the Batch API for work that can wait, and prompt caching for repeated prefixes. A smaller model helps most, because the gap between Haiku 5.5 and Fable 5.1 is the largest lever in the table.

Are the older models cheaper?

Not necessarily. On the same page, Haiku 4.5 is listed at $1 input and $5 output, which is ten times the Haiku 5.5 rates for prompts up to 100k tokens.

Why does my bill not match the estimate?

The usual causes are output length, tool overhead, cache writes you did not count, and long prompts that move Haiku 5.5 into its higher rate. Compare the token counts the API reports against the numbers you assumed.

Next step

Copy the script, replace the 2,000 and 500 with the real input and output tokens from one of your own requests, and run it for your model. Then set batch and cached tokens to match what your app actually does.

Last checked: November 2, 2026, against Anthropic's pricing page. Prices change, so confirm on claude.com/pricing before you budget.

#anthropic #claude-api #claude-api-pricing #claude-api-cost #prompt-caching #batch-api
Aliyan Faisal

Written by

Aliyan Faisal

Software engineer and AI developer. I build LLM-powered products, RAG pipelines and automations, and the web apps behind them.

Get new posts in your inbox

The best new articles, daily, twice a week or weekly. Choose your topics. No spam, unsubscribe anytime.

Prefer an app? Get posts as they go live.

0 Comments

No comments yet — be the first to share your thoughts.

Leave a comment

Never published.