🧠 Claude API Cost Calculator
Calculate Anthropic Claude API costs for all models. Enable prompt caching to see how much you save when reusing large system prompts or documents across requests.
Cached tokens are charged at 10% of the normal input price. The remainder is charged at full price.
What is the Claude API Cost Calculator?
The Claude API — developed by Anthropic — provides programmatic access to Claude's language models for developers building AI-powered applications. The API is priced on a consumption basis: you are charged per million tokens processed, with separate rates for input tokens (what you send to the model) and output tokens (the text the model generates). This token-based pricing model allows businesses to scale costs directly with usage — but it also makes accurate cost forecasting essential for budgeting and product economics.
Anthropic offers three current model tiers — Opus 4.8 (most capable), Sonnet 4.6 (balanced performance and cost), and Haiku 4.5 (fastest and most affordable). Each tier has distinct input and output token pricing. In most applications, output tokens are priced at 5× the input token rate, reflecting the greater computational cost of generation versus reading and processing input context. Choosing the right model tier for each workload is one of the most impactful levers for AI cost optimisation.
Prompt caching is a powerful feature that allows developers to mark stable portions of their prompts — such as system instructions, large documents, or few-shot examples — to be cached server-side between requests. Cached tokens are charged at just 10% of the standard input price. For applications with a large, unchanging system prompt used in every request, prompt caching can reduce input token costs by 80–90%, substantially improving the unit economics of AI-powered products.
Claude Model Comparison
| Model | Input / 1M | Cached / 1M | Output / 1M | Context | Best For |
|---|---|---|---|---|---|
| Claude Opus 4.8 | $15.00 | $1.50 | $75.00 | 200K | Most capable, complex tasks |
| Claude Sonnet 4.6 | $3.00 | $0.30 | $15.00 | 200K | Balanced performance & cost |
| Claude Haiku 4.5 | $0.80 | $0.08 | $4.00 | 200K | Fast, lightweight tasks |
* Prices as of 2025. Check anthropic.com/pricing for the latest rates.
Frequently Asked Questions
Prompt caching allows you to mark portions of your prompt (like system prompts or large documents) to be cached server-side. Subsequent requests that reuse cached content are charged at just 10% of the normal input price, saving up to 90% on repeated context.
If you have a 10,000-token system prompt used in every request, without caching that costs $30/M tokens × 10K tokens = $0.30 per 1,000 requests on Sonnet. With caching, that drops to $0.03 per 1,000 requests — a 90% saving on that portion.
Use Haiku for high-volume, straightforward tasks like classification, extraction, summarization, and chatbot responses. Use Sonnet when you need higher quality reasoning, coding help, or nuanced analysis. Opus is for the most complex tasks where quality is paramount.
No — all input tokens (including system prompts, conversation history, and user messages) are charged at the same input token rate. However, prompt caching applies specifically to reusable portions you mark for caching.
All current Claude models support 200,000 token context windows — one of the largest available. This allows processing entire books, large codebases, or extensive documents in a single request.
Real-World Applications
Common Mistakes
Claude Model Selection Guide
| Model | Best Use Cases | Relative Cost | Avoid For |
|---|---|---|---|
| Opus 4.8 | Complex reasoning, coding, research, agentic tasks | Highest (1×) | High-volume simple tasks |
| Sonnet 4.6 | Balanced quality for most production apps | Mid (5× cheaper than Opus) | Tasks requiring only classification |
| Haiku 4.5 | Classification, extraction, summarisation, chat | Lowest (19× cheaper than Opus) | Complex multi-step reasoning |
References
- Anthropic. Claude API Pricing. anthropic.com/pricing.
- Anthropic. Prompt Caching Documentation. docs.anthropic.com.
- Anthropic. Claude Model Overview. docs.anthropic.com/claude/models.
- Anthropic. Token Usage in the API. docs.anthropic.com.
- Liang, P. et al. Holistic Evaluation of Language Models (HELM). Stanford CRFM, 2022.
Related Calculators
AI Token Calculator
Calculate token count and cost for AI language model API calls.
OpenAI Cost Calculator
Calculate and compare costs across all OpenAI GPT models for your usage.
API Pricing Calculator
Compare and calculate monthly costs across multiple AI and cloud APIs.