Claude API

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.

The short version

Claude API pricing in six points

🪙Pay per tokenInput and output are priced separately, per million tokens. No monthly fee, no seats.
📏Output costs 5× inputOn every current model, so long answers cost more than long prompts.
♻️Caching cuts repeats by 95%Cache reads cost 5% of the input price on Opus 5.5 and Sonnet 5.5, and 2.5% on Fable 5.1.
📦Batch is half priceSend work that can wait through the Batch API for 50% off input and output.
📚Long context, same priceFable, Opus and Sonnet bill the full 1M-token window at standard rates. Only Haiku 5.5 charges more above 100k.
🎁Small free credit to startNew Console accounts get a little free credit to test with; then you prepay or add billing.
Model prices

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.

ModelInputCache write 5 minCache write 1 hCache readOutput
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.

Cost calculator

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.

Estimated monthly cost (30 days)
$0
$0 per request · $0 per day
Input $0
Output $0

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.

Ways to save

Five ways to cut your Claude API bill

1
Cache the parts that repeatPut system prompts, documents and tool definitions first and mark them for caching. Reads cost $0.20 per million on Opus 5.5 instead of $4. A 5-minute cache write costs 1.25× input; a 1-hour write costs 2×.
up to −95% on repeated input
2
Batch anything that can waitEvaluations, backfills, summaries of yesterday's tickets - the Batch API returns results asynchronously at half price.
−50%
3
Use the smallest model that worksHaiku 5.5 is 40× cheaper than Opus 5.5 per token. Route easy steps (classification, extraction, routing) to Haiku and save Opus for the hard ones.
up to −97%
4
Control output lengthOutput costs five times input. Set a sensible max_tokens, ask for concise formats and lower the thinking effort for routine requests.
output is 5× input
5
Keep Haiku prompts under 100k tokensAbove 100,000 prompt tokens Haiku 5.5 costs five times more. Split long jobs, or use Sonnet 5.5 if you need very long prompts.
avoid a 5× step
Tools & extras

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 searches

Plus tokens for the results. Failed searches aren't billed.

🌐

Web fetch

No extra charge

You pay only for the tokens of the fetched content; cap them with max_content_tokens.

🐍

Code execution

1,550 free hours / month

Per 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 / $40

Faster output at twice the price. Works with caching and data residency, not with Batch.

🇺🇸

US-only inference

×1.1 on everything

Set inference_geo: "us" on Claude 4.6 and later; older models return a 400 error.

Getting started

Make your first Claude API call

About ten minutes from sign-up to your first response.

  1. 1
    Create 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.
  2. 2
    Create an API keySettings → API keys → Create key. Copy it once - you won't see it again.
  3. 3
    Store it as an environment variable
    export ANTHROPIC_API_KEY="your-api-key-here"
    The SDKs read it automatically. Never commit it to Git.
  4. 4
    Install an SDK
    pip install anthropic
    npm install @anthropic-ai/sdk
    Official SDKs also exist for Java, Go and more, plus the ant command-line tool.
  5. 5
    Send a requestUse one of the examples on the right. A success returns the reply in content and the token counts in usage.
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."}
    ]
  }'
Rate limits

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.

Evaluation
Lower limits
Start
$500 / month
Build
$1,000 / month
Scale
$200,000 / month
Custom
No cap

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.

TierRequests / minInput tokens / minOutput tokens / min
Start4,0002,000,000400,000
Build10,0005,000,0001,000,000
Scale13,00010,000,0002,000,000

Example limits for Claude Sonnet 5.5. Other models have their own limits; your Console shows yours.

Got a 429?If it has a 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.
Errors

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.

StatusTypeUsually meansFix
400invalid_request_errorMalformed body, unknown parameter, wrong model ID - or inference_geo on an older modelCheck the request against the docs; read the error message
401authentication_errorMissing or wrong API keyCheck ANTHROPIC_API_KEY and the x-api-key header
403permission_errorYour key can't use that resource or modelCheck workspace and key permissions in the Console
404not_found_errorWrong endpoint or a resource that doesn't existCheck the URL and IDs
413request_too_largeRequest body over the size limitSend large files via the Files API or split the request
429rate_limit_errorRate limit or monthly spend cap reachedBack off and retry; see the 429 note above
500api_errorUnexpected error on Anthropic's sideRetry with backoff
529overloaded_errorThe API is temporarily overloadedRetry with backoff; check the Anthropic status page
API or subscription?

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

FAQ

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.