Anthropic API rates at a glance
Anthropic lists prices in USD per million tokens (MTok). The standard input and output rates for the models below are Fable 5.2 at $8/$40, Opus 5.5 at $4/$20, Sonnet 5.5 at $2/$10, and Haiku 5.5 at $0.10/$0.50 for prompts up to 100,000 tokens. Haiku 5.5 has higher listed rates above that prompt length. These are API token prices, not subscription-plan prices. (Anthropic pricing)
| Claude model | Input / 1M tokens | Output / 1M tokens | Notes from Anthropic’s pricing page |
|---|---|---|---|
| Claude Fable 5.2 | $8 | $40 | Listed standard rates |
| Claude Opus 5.5 | $4 | $20 | Listed standard rates |
| Claude Sonnet 5.5 | $2 | $10 | Listed standard rates |
| Claude Haiku 5.5 | $0.10 up to 100K prompt tokens; $0.50 above 100K | $0.50 up to 100K; $2.50 above 100K | Separate rates apply by prompt length |
Anthropic’s pricing table also lists prompt-cache write and read rates; the applicable amount varies by model and, for Haiku 5.5, prompt length. For example, Sonnet 5.5 cache reads are listed at $0.10/MTok, five-minute writes at $2.50/MTok, and one-hour writes at $4/MTok. Check the row for your model and request conditions rather than applying one cache multiplier to every model. (Anthropic pricing)
The pricing page includes additional model versions. If you use an older model, select its exact model row and identifier instead of assuming it shares the rate of a similarly named newer model. Anthropic’s Models API can be used to check available models. (Anthropic pricing)
Estimate your API cost
For a simple estimate without caching or other price adjustments:
cost = (input tokens ÷ 1,000,000 × input rate)
+ (output tokens ÷ 1,000,000 × output rate)
Example — Sonnet 5.5: Suppose 1,000 requests each use 10,000 input tokens and 2,500 output tokens. That is 10 million input tokens and 2.5 million output tokens:
- Input: 10 × $2 = $20
- Output: 2.5 × $10 = $25
- Estimated total: $45
This estimate uses Anthropic’s listed Sonnet 5.5 rates and excludes caching, Batch processing, and other applicable adjustments. For budgeting, substitute actual token counts from your workload. A Messages API response includes usage.input_tokens and usage.output_tokens, which you can log to estimate token-based cost. (Anthropic Messages guide)
For asynchronous workloads, Anthropic describes its Message Batches API as offering a 50% cost reduction. Check the Batch API’s requirements and pricing conditions before applying that reduction to a particular workload. (Anthropic API overview)
Make a minimal Messages API call
You need a Claude Console account and API key. Anthropic’s REST API base URL is https://api.anthropic.com, and Messages requests use POST /v1/messages. The example below uses the documented Sonnet 5.5 API model ID, claude-sonnet-5-5. For direct HTTP requests, Anthropic’s migration guide instructs users upgrading to API version 2026-10-21 to set that value in the anthropic-version header; treat it as the version specified by that guide, not as a timeless version number. (API overview, Sonnet 5.5 model reference, API migration guide)
export ANTHROPIC_API_KEY="your-key"
curl https://api.anthropic.com/v1/messages \
-H "Authorization: Bearer $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 128,
"messages": [
{"role": "user", "content": "Reply with a short greeting."}
]
}'
This request follows Anthropic’s authentication guide, which documents API keys in the Authorization: Bearer header. Anthropic’s migration guide’s cURL example uses x-api-key instead; follow the authentication convention documented for the client and API version you adopt, and do not send a real key in source control. (Anthropic authentication, API migration guide)
A successful response includes the selected model, generated content, and a usage object. Check usage.input_tokens and usage.output_tokens to record token usage. (Messages guide)
Claude 4.7 and later models may produce approximately 30% more tokens for the same text than the previous tokenizer, though the difference depends on content and workload. Identical text does not necessarily mean identical token counts or cost when changing models; measure representative requests before forecasting a migration. (Anthropic pricing)
Sources
Pricing — Claude Platform Docs
API overview — Claude Platform Docs
Migrating to API version 2026-10-21 — Claude Platform Docs
Claude Sonnet 5.5 — Claude Platform Docs
