Claude API Pricing Per Million Tokens Explained
Claude API pricing is quoted per million tokens, split into two separate rates: one for input tokens (what you send) and one for output tokens (what Claude generates). Output tokens cost more than input tokens, usually by a factor of 4–5x, because generation is more compute-intensive than reading context. The exact rate depends on which model you use — Haiku, Sonnet, or Opus — with each tier offering a different balance of speed, quality, and cost.
If you're trying to estimate a monthly bill, the math is straightforward once you know three numbers: your input tokens per request, your output tokens per request, and your request volume. Multiply each by the per-million rate, add them together, then multiply by how many requests you expect per month. The tricky part isn't the arithmetic — it's that most teams underestimate input tokens because they forget to count system prompts, conversation history, and tool definitions that get sent with every single call.
How token-based pricing actually works
A "token" is roughly ¾ of a word in English, though it varies with punctuation, code, and non-English text. Anthropic (and any API built on top of Claude) bills you based on the exact number of tokens processed, not characters or API calls.
Two separate meters run on every request:
- Input tokens: your system prompt + conversation history + user message + any tool definitions or retrieved context
- Output tokens: everything Claude generates in response, including text inside tool calls
Because pricing is per million tokens, a single request rarely costs more than a fraction of a cent — but at scale, the per-million rate compounds fast, especially if you're running long conversations or sending large documents as context.
Why input and output rates differ
Output generation requires the model to run inference token-by-token, autoregressively, which is computationally heavier than processing a batch of input tokens in parallel. That's the core reason output pricing is several times higher than input pricing across every tier. Any app that generates long responses (summaries, code, reports) will see output cost dominate the bill, while chat-heavy apps with short replies but long context windows will see input cost dominate instead.
Model tiers and what they mean for cost
Claude is offered in multiple tiers, and picking the right one is the single biggest cost lever you have — bigger than any prompt optimization:
- Haiku-class models: cheapest per million tokens, fastest, best for high-volume simple tasks like classification, extraction, or short replies
- Sonnet-class models: mid-tier pricing, strong general-purpose reasoning, the default choice for most production apps
- Opus-class models: highest per-million rate, reserved for tasks that genuinely need the strongest reasoning — complex analysis, multi-step agents, hard coding tasks
A common mistake is defaulting every request to the most capable (and most expensive) model. Routing simple requests to a cheaper tier and reserving the expensive tier for genuinely hard tasks can cut spend by 60–80% without hurting output quality where it matters.
Estimating your real monthly cost
A rough formula:
monthly_cost =
(avg_input_tokens_per_request / 1,000,000 * input_rate +
avg_output_tokens_per_request / 1,000,000 * output_rate)
* requests_per_month
Three things inflate this number in practice:
- Conversation history. If you resend the full chat history on every turn (common in multi-turn apps), input tokens grow linearly with conversation length. A 20-turn conversation can cost far more in input tokens than the first message did.
- System prompts and tool definitions. These get sent on every single call. A 2,000-token system prompt across 100,000 requests a month is 200 million input tokens before a single user message is counted.
- Retries and errors. Failed requests that get retried still consume tokens. If your error rate is 5%, your effective cost is 5% higher than the happy-path estimate.
Where SubToAPI fits into cost planning
If you already have Claude access and want to turn it into an HTTPS API for your own apps without building billing, key management, and usage tracking yourself, SubToAPI wraps that access into application-level API keys (sub_live_...) with streaming, tool use, and per-key usage metadata in one dashboard.
This doesn't change Anthropic's per-million-token pricing, but it does make the cost side easier to manage day-to-day:
- Usage metadata per key means you can see which app, team, or feature is driving token spend instead of guessing
- Team seats on the Team (€19/seat) and Scale (€49/seat) plans let you separate usage by person or project without sharing one raw key
- A Solo plan (€9) covers individual developers who just want a clean key without team overhead
You can see full plan details on /pricing, try it with a free trial at /signup, and check request/response formats in the /docs before wiring it into your app. The /docs/quickstart page is the fastest way to send a first request and see real token counts in the response metadata, which is the most reliable way to validate your own cost estimates against actual usage.
Practical ways to reduce per-million-token spend
- Trim system prompts. Every token in a system prompt is billed on every single request — audit it for redundant instructions.
- Summarize long conversation history instead of resending it verbatim once it crosses a token threshold.
- Cap max output tokens for tasks that don't need long responses; runaway generations are a common source of unexpected output cost.
- Route by task complexity. Use a cheaper model tier for classification, extraction, and short replies; reserve the top tier for genuinely hard reasoning.
- Monitor token usage per endpoint, not just total spend, so you know which feature to optimize first.
Questions
Is Claude API pricing the same for every model? No. Each model tier (Haiku, Sonnet, Opus) has its own input and output rate per million tokens, with higher-capability models costing more on both meters.
Why is output more expensive than input? Generating tokens requires sequential, autoregressive inference, which is more compute-intensive than processing input tokens, so output rates are typically several times higher than input rates.
How can I estimate my monthly bill before launch? Measure average input and output tokens per request in a test run, multiply each by its per-million rate, then multiply by expected monthly request volume — and check real token counts via your /docs/messages response metadata to validate the estimate.