Anthropic API cost estimator

Claude Cost Calculator

Estimate Claude API pricing for chat, document analysis, RAG workflows, software agents, and automation. Model base input, cached input, output tokens, and request volume before shipping.

Default model Claude Sonnet 4
Input / 1M $3
Output / 1M $15

Anthropic pricing rule

Claude Sonnet 4 Token Cost Calculator

Updated 2026-05-29

Estimated API cost

$0.18
Input
$0.12
Cached input
$0.00
Output
$0.06
Per 1,000 requests
$180.00

Cost Per Million Tokens

Model Input Cached input Output Context
Claude Sonnet 4 $3 $0.3 $15 200,000 tokens
Claude Opus 4 $15 $1.5 $75 200,000 tokens
Claude Haiku 3.5 $0.8 $0.08 $4 200,000 tokens

GPT vs Claude Pricing Snapshot

Claude Sonnet 4 $3 in / $15 out
Claude Opus 4 $15 in / $75 out
Claude Haiku 3.5 $0.8 in / $4 out

How Claude Pricing Works

Claude API pricing separates base input tokens, cache-related tokens, and generated output tokens. Long prompts can make input cost meaningful, while long answers, code, and analysis reports can make output cost dominate.

For long-document and agent workloads, estimate both the first call and repeated calls. Reused system context, schemas, repository context, or policy text can change the cost profile when caching applies.

Claude Workloads To Model

  • Long-context document analysis
  • Enterprise support and policy agents
  • RAG over knowledge bases
  • Code review and engineering assistants
  • Structured extraction from large files

Claude Cost Example

A Claude workflow with 40,000 input tokens and 4,000 output tokens may be reasonable for one analysis request, but agent retries and multi-step tasks can multiply the cost quickly. Use per-1,000-request output to estimate production scale.

Pricing source: Anthropic pricing page. Last local rule update: 2026-05-29. Estimates exclude taxes, discounts, long-context beta premiums, and tool-specific charges.

FAQ

How do I calculate Claude API cost?

Enter input tokens, output tokens, and any cached input tokens. The calculator applies Claude pricing per million tokens to estimate per-request and per-1,000-request cost.

Which Claude model should I estimate first?

Claude Sonnet is a useful default for many developer workloads. Claude Opus is more expensive and should be modeled when quality or reasoning depth may reduce retries.

Why does Claude caching matter?

Claude workloads often reuse long instructions, policies, schemas, or context. Cache hits can reduce repeated input cost, while cache writes may have a separate price.

How do I estimate Claude cost for long documents?

Estimate the number of document tokens included in the prompt, add the user question, then add expected output tokens. Long document context usually makes input cost the main driver.

How do agent loops affect Claude cost?

Each agent step can trigger another model call. Multiply the per-step estimate by the average number of steps and expected task volume.