What a Production Claude App Actually Costs to Run
Understanding AI Token Costs: Input, Output, and Real-World Spend
If you're building with Claude, you need to understand how token pricing works and how it compounds across a real production system. This article walks through the mechanics of input and output token costs, shows what we actually spent running a three-service content pipeline over 76 days, and explains the levers you can pull to control spend.
The Two-Meter Model: Input and Output Tokens
Claude pricing has a single decisive rule: output tokens cost 5 times as much as input tokens on every current model tier.
For Claude Haiku 4.5, the published rates are:
- Input: $1.00 per million tokens
- Output: $5.00 per million tokens
This ratio holds across the entire model lineup. Claude Opus 4.8 charges $5 for input and $25 for output per million tokens—exactly 5x the Haiku rate. Claude Fable 5 charges $10 and $50 respectively. The gap between input and output is the constant.
Why? Output tokens are harder to generate. The model must compute one token at a time, maintaining state through the entire sequence. Input tokens are processed in parallel across the sequence, then tokenized once. This asymmetry shows up in every billing line.
What a Real Production Pipeline Actually Costs
We ran a three-service Claude-powered content pipeline for 76 days (May 2 through July 16, 2026). Every external API call was metered into an append-only cost log. The total spend was $74.31, roughly $0.98 per day.
That breaks down as:
- Claude API (LLM calls): $9.69 across 1,108 metered calls—13% of total spend. Average cost per call: $0.0087.
- Keyword and SERP data APIs: $64.62—87% of total spend.
The model is the cheap part. The data about what to write—keywords, search engine results, market validation—costs seven times more. This is the lesson most cost calculators miss: your LLM bill is often smaller than the operational data you're buying to feed it.
Breaking Down Per-Task Costs
Within that pipeline, we tracked three categories of work on Claude Haiku 4.5:
Generating one full article page (title, body HTML, FAQ section): approximately $0.005 per page. This represents 30 metered generation calls totaling about $0.15, averaged across a batch of 30 articles. The pipeline enforces precomputed numbers on the model—each article generation costs roughly $0.018, and drafts whose figures differ from verified inputs are rejected and retried. Quality control costs retries, not dollars, but the retries are real.
Building one interactive tool page: approximately $0.057 per build call. Tool pages are more stateful; they involve more structured reasoning over parameters.
Running market validation: The pipeline's validator made 1,828 metered calls for $2.29 total. Most were cheap—short classification and scoring tasks. But validation is where you catch errors before they scale.
Model Tier Multipliers
The same tokens cost different amounts depending on which model you choose. Our article generation at $0.018 on Haiku would cost:
- $0.09 on Claude Opus 4.8 (exactly 5x the Haiku rate)
- $0.18 on Claude Fable 5 (exactly 10x the Haiku rate)
Claude Sonnet 5 has introductory pricing of $2/$10 per million tokens through August 31, 2026, dropping to $3/$15 after. If you're evaluating model tiers, the cost multiplier is always linear: a model that publishes twice the input rate will cost twice as much for identical token usage.
The choice of model compounds across your entire system. If your pipeline runs 1,000 generation calls per day, switching from Haiku to Opus 4.8 multiplies that line item by 5. It's a legitimate choice if Opus 4.8 produces better output at lower error rates—your validation costs might drop faster than your model costs rise. But the multiplier is real, and it applies to every token.
Prompt Caching: An 89% Reduction on Repeated Context
If you send the same long context to Claude repeatedly, caching transforms the math. Here's a worked example at current rates:
Suppose you have a 20,000-token system prompt—think detailed API documentation, brand guidelines, or a code library. You send it on 100 API calls per day at Haiku rates.
Without caching: 20,000 tokens × 100 calls × $1 per million = $2.00 per day.
With caching: You write the cache once ($0.025, charged at 1.25x the input rate) and read it 99 times. Each cache read costs 0.1x the input price: 99 reads × 20,000 tokens × $0.10 per million = $0.198. Total: $0.025 + $0.198 = $0.223 per day.
That's an 89% reduction on the prompt token cost. The cache write is slightly more expensive, but the reads are so cheap that one write plus many reads always wins over repeated writes.
Note: output tokens are unaffected by caching. You still pay full output rate for every token the model generates. Caching only discounts input tokens that hit the cache.
Batch Processing: 50% Off, Asynchronous
Batch API runs your requests asynchronously and discounts both input and output tokens by 50%. If your $0.015 generation call normally breaks down as (for example) $0.003 input + $0.012 output, batch pricing makes it $0.0015 + $0.006 = $0.0075—half the cost, but you wait hours or days for results instead of seconds.
Batch is ideal for background work: bulk content generation, nightly data processing, any task that doesn't require real-time response. For interactive applications or user-facing features, you can't use batch. For batch-compatible work, the math is simple: divide your estimate by 2.
Context Window Size Does Not Meter per Window
You pay for tokens you actually use, not for the size of the context window you could use. Claude Opus 4.8 and Fable 5 support 200,000 tokens; Haiku and Sonnet 5 support 200,000 tokens as well. You don't pay more for accessing a larger window. You pay for the tokens that actually go into your request.
This matters for architecture. You can load a large file, conversation history, or knowledge base into a request without a per-kilobyte penalty. You only pay for the tokens that encode that data. If you load 50,000 tokens of context and the model generates 200 output tokens, you're charged for 50,000 input (at input rate) + 200 output (at 5x input rate).
The Zero-Cost Failure: The Most Expensive Incident in Our System
Our pipeline includes a learning component that trains on its own decisions—a validator that ranks candidate topics before any generation or data API call is made. During one incident, this component rejected 80 of 81 candidate topics in a single morning. Zero API calls were made. Zero marginal spend. Weeks of lost pipeline output.
This was the most expensive failure in our system's history, measured in lost throughput. No cost dashboard caught it, because no cost dashboard tracks internal decision loops that spend nothing.
The lesson: meter everything, but watch throughput and error rates alongside spend. A system that costs $1,000 and generates 1,000 outputs has better unit economics than a system that costs $100 and generates 10 outputs. Cost is one axis; output is the other. If you optimize cost alone, you'll miss the failures that cost nothing.
If you would rather not manually track token counts, compute rate multipliers, and run scenario analyses by hand, AI Token Cost Calculator runs the full calculation in one step: input your prompt tokens, expected output tokens, model choice, and discount strategy, and it returns your cost across every current Claude model with prompt-cache and batch pricing applied from a rate table verified against Anthropic's published pricing.
Building Your Cost Model
To estimate your own Claude costs:
- Measure tokens per task. Count input tokens (prompt + context) and expected output tokens (completion length). Use the tokenizer in the Anthropic console for accuracy.
- Count tasks per unit time. How many calls per day? Per second? Per month?
- Apply model rates. Multiply input tokens by input rate, output tokens by output rate.
- Apply discounts. If you use batch, multiply by 0.5. If you use prompt caching, reduce repeated input tokens by ~0.1x after paying the cache write cost once.
- Sum across your pipeline. Add all line items to get daily or monthly spend.
- Track unit cost. Divide total spend by total outputs. This is the number to optimize.
Our pipeline's unit cost is roughly $0.0087 per metered API call. For you, the target is whatever output matters: cost per article, per user session, per classification, per code review. The dollar cost is less important than the cost per unit of valuable work.
Frequently asked questions
Why do output tokens cost 5 times more than input tokens?
Output tokens require sequential computation—the model generates one token at a time while maintaining state through the entire sequence. Input tokens are processed in parallel and tokenized once. This computational asymmetry is why every Claude model charges 5x the input rate for output, whether you're on Haiku, Sonnet, Opus, or Fable.
Does prompt caching reduce my output token costs?
No. Caching only discounts input tokens that hit the cache, reducing them from $1 to $0.10 per million tokens (and charging 1.25x for the initial write). Output tokens always cost the full rate—$5 per million on Haiku, $25 on Opus, $50 on Fable—regardless of caching.
How much can I save by switching to batch processing?
Batch API discounts both input and output tokens by 50%. If your call costs $0.015, batch makes it $0.0075. The tradeoff is asynchronous execution—results arrive hours or days later, not in seconds. Batch is ideal for background work that doesn't require real-time response.
Do I pay more for using a larger context window?
No. You pay for tokens you actually use, not for the size of the window available to you. If you load 100,000 tokens of context but only 50,000 are included in your request, you're charged for 50,000 input tokens. The window size itself has no cost.
What's the real cost difference between Haiku and Opus 4.8?
Exactly 5x. Opus 4.8 charges $5 input and $25 output per million tokens; Haiku charges $1 and $5. Every token that costs $0.01 on Haiku costs $0.05 on Opus. Model choice is a linear multiplier across your entire pipeline's token usage.