
Claude API costs can easily spiral out of control—stronger models cost more per call, and longer context costs more. This post shares my approach to cost control.
Claude Model Pricing Comparison (2026)
| Model | Input $/MTok | Output $/MTok | Use case |
|---|---|---|---|
| claude-opus-4-6 | $15 | $75 | Complex reasoning, code generation |
| claude-sonnet-4-6 | $3 | $15 | General tasks, writing |
| claude-haiku-4-5 | $0.8 | $4 | Simple classification, summarization |
MTok = million tokens. 1 token ≈ 0.75 English words ≈ 0.5 Chinese characters.
For the same task, Haiku costs about 15–20x less than Opus.
The Most Effective Cost-Saving Tool: Prompt Cache
Anthropic’s Prompt Cache feature: for the same long system prompt, you pay full price the first time, then only 10% of the price on cache hits afterward.
# How to enable Prompt Cache
response = client.messages.create(
model="claude-sonnet-4-6",
system=[
{
"type": "text",
"text": "your long system prompt...",
"cache_control": {"type": "ephemeral"} # mark as cacheable
}
],
messages=[{"role": "user", "content": "user question"}]
)
Real impact: My quant ops Skill with about 2000 tokens of system prompt, called 50 times a day:
- Without cache: 50 × 2000 × $3/MTok = $0.30/day
- With cache (assuming 90% hit rate): initial $0.006 + hits $0.027 = $0.033/day
Saves about 90% on system prompt costs.
Pick the Right Model for the Task
The biggest mistake is using the strongest model for everything.
| Task type | Recommended model |
|---|---|
| Write code, complex analysis | Sonnet or Opus |
| Write articles, answer questions | Sonnet |
| Simple classification, judgment | Haiku |
| Format conversion, summarization | Haiku |
| Claude Code daily use | Sonnet (default) |
In Claude Code, you can use /model to switch models, and it takes effect mid-conversation.
Reduce Unnecessary Tokens
1. Compress system prompts
Remove redundant instructions and express the same information with fewer words. Compress from 3000 tokens to 1500 tokens, and costs are cut in half.
2. Control context window size
The longer your Claude Code conversation, the more input tokens per call (it includes all conversation history). After finishing complex tasks, use /clear to clear the context and start a new conversation.
3. Use tools to reduce back-and-forth
Rather than having AI guess what you want and then revise, it’s better to write your requirements clearly upfront. One successful attempt is cheaper than three revisions.
Claude Code’s Prompt Cache Effectiveness
Claude Code automatically caches system prompts. Measured results:
A session with complete Skill context (about 5000 tokens of system prompt) achieves near 100% cache hit rate on subsequent messages after the first one, reducing actual input costs by about 80–90%.
That’s why investing in good Skills is worthwhile—good Skills not only improve AI performance but also save money through cache hits.
Copilot Pro+ vs. Pure API
Comparing the two payment models:
Copilot Pro+ subscription (monthly)
- Fixed monthly fee, no worries about overspending
- Usage cap (may be rate-limited during peak times)
- Best for: moderate Claude Code users
Pure API pay-as-you-go
- Pay for what you use, no limits
- Best for: heavy users or enterprise use
- Set spending limits to avoid surprise overages
I use Copilot Pro+ myself—it covers my everyday Claude Code usage, though I occasionally hit limits when running large tasks (like analyzing hundreds of files).
Actual Monthly Bill Reference
My usage: about 20–30 Claude Code sessions per day, averaging 10 turns per session, mixed task types (writing code, ops, writing articles).
Copilot Pro+ at $19/month basically covers it. With pure API billing, I’d estimate $20–40/month (mostly Sonnet, occasionally Opus).
For questions about Claude API usage or billing, feel free to reach out on Telegram or follow X @panshi8848.
📷 Cover image · Generated with Flux Schnell AI · panshi.io brand style