If you want to use the Claude API for your work or product, it helps to understand what it is and how much it may cost. This guide explains the Claude API in simple terms and gives you an interactive calculator to estimate your usage cost in just a few seconds.
What is the Claude API?
The Claude API is a service from Anthropic that lets you use Claude AI models in your own apps and websites. You send a text request to the API and get a text reply from Claude. It can help with writing, answering questions, summarizing, coding, and many other tasks.
Types of Claude API
- Claude Opus: The most advanced model, best for complex reasoning and high quality outputs
- Claude Sonnet: Balanced speed and quality for everyday work
- Claude Haiku: Fastest and most affordable, good for simple or high volume requests
Claude API Pricing Overview
Here’s the current Claude API cost per million tokens for both input and output. Replace the placeholders with the latest official rates.
Model | Input/MTok | Output/MTok | Prompt caching/MTok |
---|---|---|---|
Claude Opus 4.1 | $15 | $75 | Write $18.75 Read $1.50 |
Claude Opus 4 | $15 | $75 | Write $18.75 Read $1.50 |
Claude Opus 3 | $15 | $75 | Write $18.75 Read $1.50 |
Claude Sonnet 4 | $3 | $15 | Write $3.75 Read $0.30 |
Claude Sonnet 3.7 | $3 | $15 | Write $3.75 Read $0.30 |
Claude Haiku 3.5 | $0.80 | $4 | Write $1 Read $0.08 |
Claude Haiku 3 | $0.25 | $1.25 | Write $0.30 Read $0.03 |
Claude API Pricing Calculator
FAQs
How is Claude API pricing structured?
Claude API pricing is based on the number of tokens processed, with separate rates for input tokens (text you send in) and output tokens (text the model returns). Prices differ per model — for example, Claude Opus costs $15 per million input tokens and $75 per million output tokens, while Claude Haiku is much cheaper at $0.25 input / $1.25 output per million tokens.
Are there extra costs for using prompt caching?
Yes. Prompt caching helps reduce cost if you’re reusing the same prompt repeatedly. There are two separate costs: one-time caching write (writing your prompt into the cache) and recurring caching read (retrieving from cache each call). For instance, Claude Opus charges $18.75 per million tokens for cache writes and $1.50 per million tokens for cache reads.
Which model should I choose based on pricing and performance?
Pick the model that best matches your needs:
- Claude Opus series — more expensive, best for tasks needing deep reasoning or high-quality output.
- Claude Sonnet series — mid-range in cost and performance, balanced choice for general use.
- Claude Haiku series — lowest cost, great for fast, high-volume, or less complex tasks.
How do I estimate my total cost from token usage?
Total Cost = (input_tokens ÷ 1 000 000 × input_rate) + (output_tokens ÷ 1 000 000 × output_rate) + (if caching) (write_tokens ÷ 1 000 000 × write_rate + read_tokens ÷ 1 000 000 × read_rate)
Is there a way to reduce costs when using Claude API?
Yes, several ways:
- Use a lower-cost model, like Sonnet or Haiku, whenever high-end reasoning isn’t essential.
- Leverage prompt caching, store static prompts once (write) and reuse them (read) to avoid repeating expensive input costs.
- Optimize token usage, avoid sending or requesting more tokens than necessary by trimming prompt text and targeting shorter outputs.