Open Calculator →

Anthropic API
Cost Calculator 2025

Estimate Claude API billing by model, token count, and cache hit ratio — or paste your actual Claude Code session log for exact costs down to the tool call.

Calculate My API Costs →

Claude API Pricing by Model

Claude Haiku 3.5 Cheapest

Input$0.80/M
Output$4.00/M
Cache write$1.00/M
Cache read$0.08/M

Claude Sonnet 4.5 Balanced

Input$3.00/M
Output$15.00/M
Cache write$3.75/M
Cache read$0.30/M

Claude Opus 4 Most Capable

Input$15.00/M
Output$75.00/M
Cache write$18.75/M
Cache read$1.50/M
Cost-optimization tip: Route simple tasks to Haiku and hard tasks to Sonnet. A typical Claude Code session that mixes models sees 40–70% lower average cost than Sonnet-only, because the majority of sub-task calls (tool routing, brief reads) need only Haiku-level reasoning.

How Anthropic API Billing Works

Anthropic charges per token — there are no seat fees or monthly minimums on the API. Your bill for each request is:

cost = (input_tokens × input_rate) + (output_tokens × output_rate)
+ (cache_write_tokens × write_rate) + (cache_read_tokens × read_rate)

Prompt caching (supported on Haiku 3.5 and Sonnet 4.5) stores frequently repeated context — system prompts, tool definitions, long documents — so subsequent requests skip re-encoding it. Cache reads cost 10× less than standard input, which makes caching one of the highest-ROI optimizations available before writing a single line of business logic.

Frequently Asked Questions

How does Anthropic API billing work?

Anthropic charges separately for input tokens, output tokens, cache write tokens, and cache read tokens. Input includes your system prompt, conversation history, and tool definitions. Output is the model's generated response. Prompt caching (write once, read many times at 90% discount) makes repeated-context workloads significantly cheaper.

Which Claude model is cheapest for production?

Claude Haiku 3.5 is Anthropic's cheapest model ($0.80/M input, $4/M output). A common pattern is model routing: send classification, routing, and simple reads to Haiku; send complex code generation and multi-step reasoning to Sonnet. This typically cuts average per-request cost by 40–70% without quality regression on hard tasks.

How much does prompt caching save on Anthropic API costs?

Cache reads cost $0.08/M for Haiku and $0.30/M for Sonnet — a 10× reduction vs standard input. For a 10,000-token system prompt called 1,000 times/day, caching saves ~$7/day on Haiku or ~$27/day on Sonnet. Cache write calls cost slightly more than standard input, but the break-even point is the second request for any cached block.

How do I see exactly what my Claude Code session cost?

Claude Code logs every API call to ~/.claude/projects/<name>/*.jsonl. Each line records model, input tokens, output tokens, cache writes, and cache reads. Drop this file into the Claude Code Cost Calculator — it applies per-model pricing and renders a breakdown by model, tool, and hour. Fully client-side; nothing leaves your browser.