← Blog

Anthropic API Pricing Per Million Tokens Explained

2026-11-15 · 5 min read · SubToAPI Team

Anthropic prices the Claude API per million tokens, with separate rates for input tokens (what you send) and output tokens (what Claude generates). Output tokens cost significantly more than input tokens — typically 4-5x — because generation is more computationally expensive than processing a prompt. Rates also vary a lot by model tier: the fastest, cheapest models cost a fraction of the flagship reasoning models.

If you're trying to estimate your bill, the two numbers that matter are: which model you're calling, and the ratio of input to output tokens in your actual workload. A summarization tool that reads 10,000 tokens and writes 200 has a very different cost profile than a chatbot that reads 500 tokens and writes 1,500. Below is a practical breakdown of how the pricing works, what drives cost in real applications, and how to keep it under control.

How Claude's per-million-token pricing works

Anthropic publishes prices as dollars per million tokens (MTok), split into:

As a general pattern across Anthropic's model lineup:

Because pricing changes as Anthropic ships new model versions, always check the current rate card on Anthropic's pricing page before finalizing cost estimates — don't rely on numbers from older blog posts or cached screenshots.

Why the input/output split matters

Most real applications are asymmetric. A few examples:

| Use case | Typical input | Typical output | Cost driver | |---|---|---|---| | Document Q&A | High (full doc in context) | Low | Input tokens | | Chatbot/assistant | Medium | Medium-high | Both | | Code generation | Medium | High | Output tokens | | Classification/tagging | Medium | Very low | Input tokens |

If your workload is input-heavy (e.g., RAG pipelines stuffing retrieved context into the prompt), your bill is dominated by input pricing, and prompt caching or context trimming saves you the most. If it's output-heavy (long-form generation, code), output pricing dominates, and capping max_tokens or truncating verbose responses matters more.

Calculating your actual cost

The formula is straightforward:

cost = (input_tokens / 1_000_000 * input_price_per_mtok)
     + (output_tokens / 1_000_000 * output_price_per_mtok)

For example, with a hypothetical rate of $3/MTok input and $15/MTok output, a request with 2,000 input tokens and 500 output tokens costs:

(2000/1_000_000 * 3) + (500/1_000_000 * 15)
= 0.006 + 0.0075
= $0.0135 per request

That looks tiny per call, but at 100,000 requests a day it's $1,350/day. This is why token accounting at the application level — not just trusting the invoice at month-end — matters for anyone shipping an LLM feature at scale.

Every Claude response includes usage metadata (input_tokens and output_tokens) so you can log actual cost per request rather than estimating. If you're building this yourself, you need to persist that metadata somewhere queryable; if you're using a layer like SubToAPI in front of Claude, that per-request usage is already captured and surfaced in the dashboard without extra instrumentation — see /docs/messages for the response shape.

Practical ways to reduce per-token cost

  1. Pick the cheapest model that meets your quality bar. Don't default to the flagship model for classification, extraction, or routing tasks — a lightweight model is often indistinguishable in quality for narrow tasks and costs far less per million tokens.
  2. Cap max_tokens. Uncapped generation on verbose models can balloon output cost. Set a sane ceiling based on what the task actually needs.
  3. Trim context aggressively. Don't send entire conversation histories or full documents if a summary or the last N turns would do. Input token cost scales linearly with what you send.
  4. Use prompt caching where supported. If you're repeatedly sending the same large system prompt or reference document, caching avoids paying full input price on every call.
  5. Batch and monitor. Track cost per request type so you know which features are expensive before the invoice tells you. A dashboard that breaks down usage by endpoint, key, or team member makes this visible — SubToAPI's dashboard does this automatically for every application key issued, so you can see cost per feature without building custom logging (see /docs).

Turning Claude into a billable API in your own product

If you're building a product on top of Claude and need to issue your own API keys, track usage per customer, and bill accordingly, you generally have two paths: build the key management, rate limiting, and usage-metering layer yourself, or sit a thin API gateway in front of Claude that already does this.

SubToAPI exists for the second path — it converts your Claude access into application API keys (sub_live_...) with per-key usage tracking, streaming support, tool use, and team seats, so you're not rebuilding billing infrastructure around raw token counts. Pricing starts at €9/month for solo use, with team plans at €19/seat and scale plans at €49/seat — see /pricing. There's a free trial at /signup, and the request/response format mirrors Claude's own API closely, documented at /docs/quickstart.

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet",
    "max_tokens": 500,
    "messages": [{"role": "user", "content": "Summarize this report."}]
  }'

Every response includes the same token usage fields so you can reconcile cost against what you charge your own customers.

questions

Does Anthropic charge the same price for input and output tokens? No. Output tokens cost roughly 4-5x more per million than input tokens because generation is computationally heavier than reading a prompt. Always budget separately for each.

Which Claude model is cheapest per million tokens? Anthropic's lightweight, fast-tier models are the cheapest, aimed at high-volume simple tasks like classification or short completions. Flagship reasoning models cost substantially more per million tokens on both input and output.

How can I track per-million-token cost without checking the Anthropic dashboard manually? Log the input_tokens and output_tokens returned with every API response and multiply by current rates, or use a gateway like SubToAPI that surfaces per-key usage and cost automatically in a dashboard — see /docs/messages for the usage fields included in every response.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →