Token Economics: What You’re Actually Paying For With AI APIs
Most people don’t understand what they’re paying for with the Claude API. They know it’s “$3 per million input tokens, $15 per million output tokens.” They know that sounds cheap. And compared to hiring someone to do the work manually, it is. But they don’t understand the actual mechanics or how to estimate costs, so they end up spending 2-3x more than they need to.
I'm going to change that.
The Basics: What's a Token?
A token is roughly a word, or a few characters. The exact count varies depending on the text.
Claude's tokenizer is conservative. Complex words, numbers, and special characters count more. Spaces count less.
For most text, assume 1 token per 1.3 words. So a 1000-word article is about 750 tokens. For code, it's similar: 1 token per ~4 characters.
When you call Claude's API, you pay for two things:
- Input tokens. Everything you send to Claude (the prompt, the document, the context).
- Output tokens. Everything Claude returns (the response).
You're charged separately for each.
Claude Pricing: The Current Rates
As of mid-2026:
Claude Sonnet 5:
- Input: $3 per million tokens
- Output: $15 per million tokens
- Cache write: $3.75 per million tokens (inputs only)
- Cache read: $0.30 per million tokens (inputs only)
(Sonnet 5 launched with introductory pricing of $2/$10 through August 31, 2026. The examples below use the standard rates.)
Claude Opus 5:
- Input: $5 per million tokens
- Output: $25 per million tokens
Claude Haiku 4.5:
- Input: $1 per million tokens
- Output: $5 per million tokens
Sonnet 5 is the best value for most use cases. Haiku is cheaper but less capable.
Cost Estimation: Real Examples
Let's calculate costs for common tasks.
Example 1: Invoice extraction. You upload a 3-page PDF invoice (~2000 tokens of text). Your prompt: "Extract vendor, total, and due date" (~50 tokens). Claude's response: JSON with extracted data (~100 tokens).
Per-invoice cost: (2000 input + 50 prompt) × $3/M + 100 output × $15/M = $0.0062 + $0.0015 = about $0.008 per invoice.
For 1,000 invoices per month: about $7.65. For 100,000: about $765.
Example 2: Customer support classification. Customer message: ~100 tokens. Context (company policies): ~500 tokens. Claude's response (classification + suggested reply): ~150 tokens.
Per message: (100 + 500) × $3/M + 150 × $15/M = $0.0018 + $0.0023 = about $0.004.
For 1,000 messages per month: about $4.
Example 3: Document analysis (10-page contract). 10-page contract: ~7,000 tokens. Prompt: "Analyze and extract key terms": ~50 tokens. Response: ~200 tokens.
Per contract: (7000 + 50) × $3/M + 200 × $15/M = $0.0212 + $0.0030 = about $0.024.
For 100 contracts per month: about $2.42.
The Hidden Cost: Context
Here's where people overspend.
You're building a chatbot. For each user question, you send:
- The user's message: 50 tokens
- The conversation history (last 10 messages): 500 tokens
- System instructions (how the bot should behave): 100 tokens
- Company documentation (for context): 2,000 tokens
Total input per request: 2,650 tokens. At $3/M, that's about $0.008 per request.
Now imagine you process 1,000 requests per month. That's about $8 in input costs.
But you're sending the same 2,100 tokens (system instructions + documentation) for every request. That's 2.1M tokens per month ($6.30) that never change.
This is where prompt caching comes in.
Prompt Caching: Cut Your Input Costs by 90%
Prompt caching is magical. It reduces the cost of repeated context.
Here's how it works. You send a request with a cache_control parameter on certain blocks:
The first request pays full price for the system prompt + documentation.
Subsequent requests in the same conversation (within 5 minutes) pay only $0.30 per million cached tokens — 90% cheaper.
Real cost reduction. Input costs with caching:
- System + docs (first request): 2,100 × $3/M = $0.0063
- System + docs (next 99 requests): 2,100 × $0.30/M = $0.0006 each
- User messages (100 × 50 tokens): 5,000 × $3/M = $0.015
Total for 100 requests: about $0.08. Without caching: (100 × 2,650) × $3/M = about $0.80.
Savings: roughly 90%. Small numbers per conversation, but the ratio holds at any scale. At 2.65B input tokens a month, that's $7,950 vs. about $800.
Use caching whenever you have long system prompts or shared context that repeats across requests.
Batch Processing: 50% Discount for Off-Peak Work
If you're processing documents in bulk and don't need real-time responses, use Claude's batch API.
Batch processing costs 50% of standard rates:
- Input: $1.50 per million tokens (instead of $3)
- Output: $7.50 per million tokens (instead of $15)
You submit a batch of requests, Claude processes them in the background (usually within a few hours), and you retrieve the results.
Example: 100,000 invoices overnight. Standard API: about $765. Batch API: about $383. Savings: 50%.
Batch processing doesn't work for customer-facing, low-latency work. But for overnight processing, data analysis, or bulk extraction, it's a huge win.
Reducing Token Spend: Practical Techniques
1. Shorter prompts
Don't say:
Say:
First prompt: ~35 tokens. Second: ~15 tokens. 57% reduction.
2. Structured outputs, not natural language
Don't ask Claude to write a narrative summary. Ask for JSON. Summaries are verbose. JSON is dense.
Instead of "Summarize this document in 2-3 paragraphs," try "Extract summary, key risks, and action items as JSON." You'll reduce output tokens by 30-40%.
3. Few-shot examples, carefully
Showing Claude an example is helpful. But don't show 10 examples. One or two is usually enough. More examples = more tokens = higher cost.
4. Remove unnecessary context
If you're extracting data from an invoice, you don't need the user's entire account history. Just the invoice.
Audit your prompts. Remove anything Claude doesn't need to answer the question.
5. Use cheaper models for simple tasks
Haiku is a third the price of Sonnet for straightforward tasks (classification, simple extraction).
Don't reach for Opus unless you really need its capabilities. It's nearly double the price of Sonnet, and for routine work the quality difference doesn't show.
Token Optimization Checklist
Before you deploy any AI system, review:
- Is caching enabled for repeated context? (90% saving if applicable)
- Are you using batch processing for bulk work? (50% saving if applicable)
- Is the prompt as short as possible? (eliminate 20-30% of tokens)
- Are you asking for structured output instead of prose? (30-40% saving on output)
- Are you using the right model for the task? (3-5x cost difference between tiers)
- Is there unnecessary context in the request? (audit and remove)
Most systems can cut token spend by 40-60% with these optimizations.
Monitoring Costs
Set up cost tracking:
Log every API call. Aggregate by model, by task, by hour. You'll spot inefficiencies quickly.
For example, if customer support is costing $0.015 per request, but it should cost $0.004, you have a problem. Find it. Fix it.
Comparing Models: Is Cheaper Always Better?
Sometimes. Haiku costs a third as much as Sonnet. But it's also less capable.
For invoice extraction, Haiku and Sonnet are equivalent. Use Haiku.
For contract analysis with edge cases, Sonnet is worth the 3x cost. Haiku might miss nuances. For deep reasoning or high-stakes analysis, Opus is worth the premium.
Test with your actual use case. Run 100 samples through both models. Compare quality. Calculate the cost-to-quality ratio.
Usually, Sonnet is the sweet spot.
The Dollar Impact
Optimize tokens properly, and a $2,000/month Claude bill becomes $800/month.
For an SMB doing document processing, that's the difference between AI being a cool side project and AI being a core business system.
Start measuring. Watch the costs drop.
Ready to optimize your token spend? Book a call and I'll audit your API usage and show you where to cut costs by 40-60% without sacrificing quality.
Get the free AI Readiness Checklist
15 questions to diagnose your team’s AI readiness, where you’ll see ROI fastest, and what to tackle first.
No spam. Unsubscribe anytime.
Ready to build AI that actually works?
Let’s talk about how SRE discipline transforms AI from a risky experiment into a reliable business system.
Book Your Free Discovery Call