Claude API Pricing and Getting Started
The Claude API is pay-as-you-go: no subscription, just a price per million tokens in and out. This page sets out what every model costs, how caching and batching cut the bill, and what the rate limits are. It also lets you estimate your monthly spend and walks you through your first API call.
Claude API pricing in six points
Claude API prices per million tokens
Switch between standard, batch and US-only pricing. Cache writes are what you pay the first time a prompt prefix is stored; cache reads are what each reuse costs.
| Model | Input | Cache write 5 min | Cache write 1 h | Cache read | Output |
|---|---|---|---|---|---|
| Fable 5.1 top tier | $10 | $12.50 | $20 | $0.25 | $50 |
| Opus 5.5 flagship | $4 | $5 | $8 | $0.20 | $20 |
| Sonnet 5.5 everyday | $2 | $2.50 | $4 | $0.10 | $10 |
| Haiku 5.5 ≤100k prompt | $0.10 | $0.125 | $0.20 | $0.01 | $0.50 |
| Haiku 5.5 >100k prompt | $0.50 | $0.625 | $1 | $0.05 | $2.50 |
| Opus 5 previous | $5 | $6.25 | $10 | $0.50 | $25 |
| Sonnet 5 previous | $2 | $2.50 | $4 | $0.20 | $10 |
| Haiku 4.5 previous | $1 | $1.25 | $2 | $0.10 | $5 |
| Sonnet 4.5 retires 30 Nov 2026 | $3 | $3.75 | $6 | $0.30 | $15 |
Standard rates from Anthropic's pricing page. Batch halves input and output; US-only inference (inference_geo: "us") adds 10% to every category on Claude 4.6 and later. Model IDs: claude-fable-5-1, claude-opus-5-5, claude-sonnet-5-5, claude-haiku-5-5.
Estimate your monthly Claude API cost
Describe a typical request and how many you send. The estimate updates as you type, and compares every model on the same workload.
An estimate, not a quote: it ignores the one-time cost of writing to the cache, tool fees and tax. Token counts vary by language - roughly 750 English words is 1,000 tokens.
Five ways to cut your Claude API bill
max_tokens, ask for concise formats and lower the thinking effort for routine requests.Tool, fast mode and data residency pricing
Charges on top of tokens, and the options that change the per-token rate.
Web search
$10 / 1,000 searchesPlus tokens for the results. Failed searches aren't billed.
Web fetch
No extra chargeYou pay only for the tokens of the fetched content; cap them with max_content_tokens.
Code execution
1,550 free hours / monthPer organisation, then $0.05 per container-hour, 5-minute minimum. Free alongside the latest web search or fetch tools.
Fast mode
Opus 5.5: $8 / $40Faster output at twice the price. Works with caching and data residency, not with Batch.
US-only inference
×1.1 on everythingSet inference_geo: "us" on Claude 4.6 and later; older models return a 400 error.
Make your first Claude API call
About ten minutes from sign-up to your first response.
- 1Create a Console accountSign up at platform.claude.com (the old console.anthropic.com address redirects there). Add billing or credit when the free credit runs out.
- 2Create an API keySettings → API keys → Create key. Copy it once - you won't see it again.
- 3Store it as an environment variable
The SDKs read it automatically. Never commit it to Git.export ANTHROPIC_API_KEY="your-api-key-here" - 4Install an SDK
pip install anthropic
Official SDKs also exist for Java, Go and more, plus thenpm install @anthropic-ai/sdkantcommand-line tool. - 5Send a requestUse one of the examples on the right. A success returns the reply in
contentand the token counts inusage.
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain prompt caching in two sentences."}
]
}'
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
message = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain prompt caching in two sentences."}
],
)
print(message.content[0].text)
print(message.usage) # input_tokens, output_tokens
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic(); // reads ANTHROPIC_API_KEY
const message = await client.messages.create({
model: "claude-sonnet-5-5",
max_tokens: 1024,
messages: [
{ role: "user", content: "Explain prompt caching in two sentences." },
],
});
console.log(message.content[0].text);
console.log(message.usage); // input_tokens, output_tokens
Claude API rate limits and usage tiers
Every organisation sits in a tier that sets its monthly spend cap and per-minute limits. Anthropic assigns tiers automatically from your usage history and account standing.
Bars show the order of the tiers, not to scale. Cached reads (cache_read_input_tokens) don't count towards the input-token limit, so caching also raises your effective throughput.
| Tier | Requests / min | Input tokens / min | Output tokens / min |
|---|---|---|---|
| Start | 4,000 | 2,000,000 | 400,000 |
| Build | 10,000 | 5,000,000 | 1,000,000 |
| Scale | 13,000 | 10,000,000 | 2,000,000 |
Example limits for Claude Sonnet 5.5. Other models have their own limits; your Console shows yours.
retry-after header, wait that many seconds and retry - the SDKs do this for you. If the error code is enforced_spend_limit_reached, you've hit the tier's monthly cap: retries fail until 00:00 UTC on the 1st, or until your tier goes up.Common Claude API errors and fixes
Every error has an HTTP status and an error.type. Log the request_id; support will ask for it.
| Status | Type | Usually means | Fix |
|---|---|---|---|
| 400 | invalid_request_error | Malformed body, unknown parameter, wrong model ID - or inference_geo on an older model | Check the request against the docs; read the error message |
| 401 | authentication_error | Missing or wrong API key | Check ANTHROPIC_API_KEY and the x-api-key header |
| 403 | permission_error | Your key can't use that resource or model | Check workspace and key permissions in the Console |
| 404 | not_found_error | Wrong endpoint or a resource that doesn't exist | Check the URL and IDs |
| 413 | request_too_large | Request body over the size limit | Send large files via the Files API or split the request |
| 429 | rate_limit_error | Rate limit or monthly spend cap reached | Back off and retry; see the 429 note above |
| 500 | api_error | Unexpected error on Anthropic's side | Retry with backoff |
| 529 | overloaded_error | The API is temporarily overloaded | Retry with backoff; check the Anthropic status page |
Claude API vs a Claude plan
They're billed separately and suit different jobs.
Choose the API if you…
- Are building Claude into your own app, site or workflow
- Need automation, batch jobs or very high volume
- Want to pay only for what you use, with no weekly cap
- Need US-only inference or zero data retention options
Choose a plan if you…
- Want to use Claude yourself in the apps and Claude Code
- Prefer a fixed monthly price ($20-$200)
- Are fine with five-hour and weekly allowances
- Want features like Projects, Research and Claude in Chrome
Or both
- Max includes $100 and Ultra $200 of API credit each month
- Team plans include up to $500 of pooled API credit
- Claude Code can run on a plan or on a Console API key
More: Claude plans and pricing · Claude models compared · Claude Code setup
Claude API FAQ
Quick answers to the pricing and setup questions developers ask most.
How much does the Claude API cost?
You pay per million tokens. Opus 5.5 costs $4 input and $20 output, Sonnet 5.5 $2 and $10, Haiku 5.5 $0.10 and $0.50 for prompts up to 100,000 tokens, and Fable 5.1 $10 and $50. There is no monthly fee.
Is the Claude API free?
No, but new Console accounts get a small amount of free credit to test with. After that you add prepaid credit or billing and pay for the tokens you use.
Is the Claude API included in Claude Pro?
No. Claude Pro, Max and Ultra are subscriptions for the Claude apps and Claude Code. The API is billed separately in the Claude Console, although Max and Ultra include $100 and $200 a month of API credit, and Team plans up to $500 pooled.
How can I reduce Claude API costs?
Use prompt caching for repeated context (cache reads cost 5% of the input price on Opus 5.5 and Sonnet 5.5), the Batch API for anything that can wait (50% off), the smallest model that does the job, and a sensible max_tokens.
How do I get a Claude API key?
Sign in to the Claude Console at platform.claude.com, go to Settings, then API keys, and create a key. Store it in the ANTHROPIC_API_KEY environment variable and never commit it to code.
What are the Claude API rate limits?
Limits depend on your organisation's tier: Start, Build, Scale or Custom, with monthly spend caps of $500, $1,000 and $200,000 for the first three. On the Start tier, Sonnet 5.5 allows 4,000 requests, 2 million input tokens and 400,000 output tokens per minute. Cached reads don't count towards the input limit.
Does long context cost more on the Claude API?
Not on Fable 5.1, Opus 5.5 or Sonnet 5.5: the full 1 million token window is billed at the standard rate. Haiku 5.5 is the exception - prompts over 100,000 tokens cost $0.50 input and $2.50 output.
What does web search cost on the Claude API?
$10 per 1,000 searches plus the tokens for the results. Web fetch has no extra charge beyond tokens. Code execution includes 1,550 free hours per organisation per month, then $0.05 per container-hour, and is free when used alongside the latest web search or fetch tools.