⚡ 100% Offline App Works 100% Offline: Install CalcWorker as an App for instant calculations anywhere — zero internet or signup required.
🧠 Claude API Cost Calculator

🧠 Claude API Cost Calculator

Claude pricing rewards prompt caching — cached input tokens cost ~90% less. Model your real workload here.

%
Est. Monthly API Cost
$0
📥 Input Token Cost (after cache)$0
📤 Output Token Cost$0
💾 Cache Savings$0
📅 Projected Annual Cost$0
⚖️ vs. No Cache$0

How Claude API Pricing Works

Anthropic charges per million tokens with three tiers: Opus (flagship intelligence), Sonnet (balanced), Haiku (fast and cheap). Its killer feature is prompt caching: repeated prompt prefixes are billed at roughly 10% of the input price.

The Formula

Effective Input = Fresh + Cached × 0.10
Cost = (Effective Input ÷ 1M × Input Price) + (Output ÷ 1M × Output Price)

Agentic workloads with long system prompts and tool definitions routinely hit 70–90% cache rates, cutting input bills by more than half. Sonnet handles most production workloads; reserve Opus for the hardest reasoning; Haiku for classification and high-volume simple tasks. Prices change; verify on Anthropic's pricing page.

Worked Example

Sonnet 4.5 ($3 in / $15 out) with 5M input tokens at 50% cache hit rate and 2M output: effective input = 2.5M + 2.5M × 0.1 = 2.75M → $8.25 input + $30.00 output = $38.25/month. Without caching it would be $45.00 — caching saves $6.75. Annual cost ≈ $459.

Workload Placement Strategy

The Claude lineup is a routing problem: Haiku (~⅓ Sonnet's price) for high-volume simple tasks like classification and extraction; Sonnet as the production default for chat, coding assistance, and agents; Opus reserved for the hardest reasoning with fallback routing (try Sonnet, escalate to Opus on low confidence). Prompt caching is the economic superpower — agentic loops re-sending long tool definitions and system prompts routinely hit 80–90% cache rates, making effective input costs a fraction of sticker price. Watch extended thinking: thinking tokens bill as output (the expensive kind), so long reasoning chains on simple queries waste money — set thinking budgets per task difficulty. The Batch API (50% off, slower) suits offline evals and bulk processing. Re-run this calculator per workload with realistic cache rates; sticker-price comparisons without caching mislead.

Frequently Asked Questions (FAQs)

How does Claude prompt caching work?

Mark stable prompt prefixes (system prompt, few-shot examples, tool schemas) as cacheable; repeat requests hit the cache and bill at ~10% of input price. Cache writes cost extra but pay off within a few hits.

Sonnet vs Haiku — which should I use?

Sonnet for general production quality; Haiku for high-volume simple tasks (classification, extraction, moderation) at ~⅓ the price. Benchmark both on your evals before deciding.

When is Opus worth it?

For the hardest reasoning — complex agentic coding, deep research, difficult math. Most apps use Opus selectively (fallback tier) with Sonnet as the default.

How much can caching save?

With 80%+ cache hit rates on long prompts, input costs drop 70%+. Agentic loops re-sending tool definitions are the biggest winners.

Claude vs GPT-4o on cost?

Comparable flagships: Sonnet 4.5 ($3/$15) vs GPT-4o ($2.50/$10) — GPT-4o is slightly cheaper sticker-price, but Claude's deeper cache discount can flip the comparison on cacheable workloads.

Last updated: September 2026