Pricing note: the worked examples below use legacy Anthropic list prices ($3 / $15 per 1M for Sonnet, etc.) for illustrative ratios only. codexkey's actual current rates are flat: Opus and GPT $0.50 / $0.50, Sonnet and gpt-5.6-luna $0.33 / $0.33 per 1M. Real bills are meaningfully lower than the dollar amounts in these examples, so check the live pricing page for the exact numbers.
Haiku is in the catalogue too: claude-haiku-5.5 and claude-haiku-4.5, with prices on the models page. They are available on the Premium channel and not on the Cheap channel.
"How much will Claude cost us?" An engineering lead asks that before greenlighting a feature, and a finance team asks it after the first invoice lands. What sits between those two moments is almost always a missing spreadsheet. This post is that spreadsheet, turned into worked examples you can copy, adapt and defend in a budget review. We price four common workloads end to end: a support chatbot, a coding agent, a RAG knowledge base and a batch classification job. Then we rank the cost levers by ROI, so you know which knob to turn first.
Token math: the basics
For prices to mean anything, you need a stable mental model of a token. A useful rule of thumb: 1 token ≈ 4 characters of English text, or roughly 0.75 words. A 500-word email comes to around 670 tokens. A typical 8K-context system prompt with tool definitions and few-shot examples lands between 6,000 and 8,000 input tokens. A long Markdown report of 2,000 words runs about 2,700 output tokens. Code is denser: 1,000 lines of TypeScript usually take 4,000 to 6,000 tokens, depending on identifier length and whitespace.
This matters because Claude is billed per million tokens, split between input and output, and output costs roughly 5× input at every tier. A workload that looks cheap on input alone can turn out five times more expensive once you count the response.
2026 prices per 1M tokens (illustrative)
The table below shows codexkey's actual retail rates in 2026: a flat rate per model tier, not a direct pass-through of Anthropic's list prices. Some worked examples further down use separate legacy Anthropic list prices for illustrative ratios only, and say so. Check the live pricing page for current rates. API access goes through https://api.codexkey.online/v1.
| Tier | Models (examples) | Input ($/1M tok) | Output ($/1M tok) | Cached input ($/1M tok) |
|---|---|---|---|---|
| Sonnet | Sonnet 5, Sonnet 4.6, gpt-5.6-luna | $0.33 | $0.33 | $0.05 |
| Opus / GPT | Opus 5, Opus 4.8, GPT 5.6 | $0.50 | $0.50 | $0.05 |
The flagship of the lineup, Opus 5, shipped on July 24, 2026. At Anthropic it lists for $5 per 1M input tokens and $25 per 1M output tokens, which is handy for comparison with the legacy numbers below. On codexkey, Opus 5 runs at the same flat Opus-tier rate as the rest of that tier.
Keep two things in mind: cached input is 10× cheaper than fresh input, and the Batch API gives a 50% discount on both input and output for jobs that can wait up to 24 hours. Most of the optimizations below rest on those two mechanisms.
Worked example 1: support chatbot
Workload: 10,000 conversations per month. Average 8,000 input tokens per turn (system prompt + tool definitions + retrieved context + user history) and 800 output tokens per response. Single-turn, for simplicity.
On Sonnet 4.6, without caching:
- Input: 10,000 × 8,000 = 80M tokens × $3.00 = $240
- Output: 10,000 × 800 = 8M tokens × $15.00 = $120
- Monthly total: $360
Now turn on prompt caching for the stable 6,000-token system prompt and tool definitions, which leaves 2,000 tokens of dynamic context per call:
- Cached input: 10,000 × 6,000 = 60M tokens × $0.30 = $18
- Fresh input: 10,000 × 2,000 = 20M tokens × $3.00 = $60
- Output unchanged at $120
- Monthly total: $198, a 45% reduction.
Cost per conversation falls from $0.036 to $0.020. At 100,000 conversations per month, that difference saves $1,800 every month, and it comes from one config flag.
Worked example 2: coding agent
Workload: 200 pull requests per day, each running an agent loop with roughly 30,000 input tokens (repo context, diffs, tool call history) and 5,000 output tokens (proposed patches, explanations, test code). It runs on Sonnet 4.6.
Daily math:
- Input: 200 × 30,000 = 6M tokens × $3.00 = $18
- Output: 200 × 5,000 = 1M tokens × $15.00 = $15
- Daily total: $33 → roughly $990/month
Coding agents are usually where Opus earns its price tag. If 20% of PRs escalate to Opus for hard reasoning, the blended cost rises:
- 80% Sonnet (160 PRs): $26.40/day
- 20% Opus (40 PRs): 40 × (30K × $15/1M + 5K × $75/1M) = 40 × $0.825 = $33/day
- Blended daily total: ~$59 → roughly $1,770/month
Caching the stable 20K tokens of repo context (tool definitions, conventions, package manifests) halves the input bill again. Most teams land around $1,100-$1,300/month after caching.
Worked example 3: RAG over a 10M-token knowledge base
Workload: 1,000 queries per day. Each query retrieves top-K chunks totaling about 5,000 tokens, adds a 1,500-token system prompt and generates a 600-token answer on Sonnet 4.6.
Daily math:
- Input: 1,000 × 6,500 = 6.5M tokens × $3.00 = $19.50
- Output: 1,000 × 600 = 0.6M tokens × $15.00 = $9.00
- Daily total: $28.50 → roughly $855/month
The interesting question is whether to load the whole 10M-token knowledge base into context with caching instead of running a retriever. Cached context of 10M tokens costs $3,000 to write once, then $300/day to read at $0.30/1M. That math only wins above about 30,000 queries/day for a knowledge base this size. Below that, retrieve-then-generate stays cheaper. Above it, full context with caching becomes a real architectural option, especially if the retriever's recall is poor.
Worked example 4: batch classification
Workload: 1,000,000 records to classify. Each record has 500 input tokens and produces a 50-token JSON label. The model is gpt-5.6-luna via the Batch API.
Without batching:
- Input: 1M × 500 = 500M tokens × $0.25 = $125
- Output: 1M × 50 = 50M tokens × $1.25 = $62.50
- Total: $187.50
With the Batch API (50% discount):
- Input: 500M × $0.125 = $62.50
- Output: 50M × $0.625 = $31.25
- Total: $93.75, exactly half.
For periodic backfills, moderation sweeps and overnight tagging jobs, the Batch API is the strongest lever you have, and it needs no code.
Cost levers ranked by ROI
We ran these four scenarios with dozens of teams on codexkey, and the order of the levers is the same everywhere:
- Cap output tokens. Output costs 5× input. A
max_tokensceiling plus a "be concise" instruction is the change with the best return, usually 30-50% savings with no loss in quality. - Cache the stable system prompt. Tool definitions, role instructions and few-shot examples rarely change. On the cached portion, caching cuts input cost by 90%.
- Move async work to the Batch API. A flat 50% off input and output for any job that tolerates a 24-hour SLA.
- Route to gpt-5.6-luna first. It handles classification, routing, extraction and "is this even worth escalating?" gates. Keep Sonnet for reasoning and Opus for the hard 5%.
- Compress retrieved context. Lower your top-K, summarize long chunks and drop redundant chat history. Every 1,000 input tokens saved per call compounds across millions of calls.
Cost per call and cost per active user
Two tables to keep in your roadmap doc.
Cost per call (Sonnet 4.6, with caching, 600 output tokens):
| Input tokens | Cost per call |
|---|---|
| 2,000 | $0.012 |
| 5,000 | $0.018 |
| 10,000 | $0.027 |
| 20,000 | $0.045 |
Cost per monthly active user (chatbot, Sonnet 4.6, with caching):
| Calls/user/month | Cost per MAU |
|---|---|
| 5 | $0.10 |
| 20 | $0.40 |
| 100 | $2.00 |
| 500 | $10.00 |
Together they let you draw a straight line from product metrics (MAU, calls per user) to a defensible cost line in your forecast.
Where codexkey fits
codexkey bills a flat rate per model tier: the rates in the table above are what you pay, whatever Anthropic's per-model list prices do. The dashboard tracks actual usage by model, by API key and by conversation. The moment a feature ships you can see whether the real numbers match the spreadsheet you built from this post. When they do not, the levers above usually hold the answer. Point your SDK at https://api.codexkey.online/v1 and the code you wrote against Anthropic keeps working, including caching headers and the Batch API.