Explainer

Claude API Pricing, Explained

The Claude API is billed per token, not by subscription: you pay for the tokens you send (input) and the tokens Claude generates (output), at a per-model rate. This page lays out the current per-million-token rates, why output costs more than input, and the built-in ways to cut your bill — caching and batch.

By DK, Editor  ·  Last verified: 2026-06-23  ·  How we test  ·  Facts only — no hands-on score

01 / Definition

Claude API pricing is usage-based. Every request is charged on two counters — input tokens (your prompt, system message, tools and any conversation history) and output tokens (Claude's reply, including reasoning) — and each is priced per million tokens (MTok). The rate depends on which model you call: the more capable the model, the higher the rate. There is no seat fee or subscription to access the API; you pay only for what you use.

Output is the expensive side — on every current model it costs several times more per token than input — so long replies, not long prompts, usually dominate a bill. The headline rates below are current as of 2026-06-23; Anthropic can change them, so confirm on the official pricing page before you budget. Note this is API (pay-per-token) pricing, which is separate from Claude Code's subscription cost — see our Claude Code pricing explainer for that.

02 / What it does

  • Per-model rates (per million tokens)

    As of 2026-06-23: Claude Opus 4.8 — $5 input / $25 output. Claude Sonnet 4.6 — $3 / $15. Claude Haiku 4.5 — $1 / $5. Claude Fable 5 (most capable) — $10 / $50. Older Opus 4.7 / 4.6 match 4.8 at $5 / $25. Always confirm current rates on Anthropic's pricing page.

  • Input vs output

    Output tokens cost roughly 5× input on every tier, so a short prompt with a long answer can cost more than a long prompt with a short answer. Cap runaway replies with max_tokens, and pick a cheaper model when you do not need the top tier.

  • Prompt caching cuts repeat costs

    Reusing a large, stable prefix (a long system prompt, a document, tool definitions) across requests is much cheaper with prompt caching: cache reads bill at about 0.1× the input rate. Cache writes cost a little more up front (about 1.25× for the 5-minute cache, 2× for the 1-hour), so it pays off when the prefix is reused.

  • Batch API halves it; counting is free

    Non-urgent work submitted through the Message Batches API is billed at 50% of standard rates (it returns within ~24 hours). The token-counting endpoint is free, so you can measure a prompt's size before you send it and estimate cost up front.

03 / How it works

A request's cost is (input tokens × the model's input rate) + (output tokens × the model's output rate), summed per million tokens. The response's usage object breaks input into uncached input, cache reads (~0.1× rate) and cache writes (~1.25–2× rate), which is how caching savings show up. Opus 4.8, Sonnet 4.6 and Fable 5 offer a 1M-token context window (Opus 4.8 with no long-context premium); Haiku 4.5 is 200K. Pick the model by the intelligence you need, then use caching, batching and max_tokens to control spend.

API pricing vs Claude Code / subscription

This page is raw API pay-per-token pricing. If you run Claude Code under a Claude Pro / Max / Team plan, that is billed differently — see the Claude Code pricing explainer for the subscription model (Claude Code is included with those plans).

04 / Who it's for

  • Developers estimating what a feature or agent will cost before they ship it.
  • Anyone choosing a model by cost — for example, Haiku for high-volume simple calls, Opus for the hardest reasoning.
  • Teams deciding between paying per token via the API and using a Claude subscription.

05 / Getting started

Estimate before you build: use the free token-counting endpoint to size a representative prompt, multiply by the model rate above, and add an output estimate. Then trim with a smaller model, prompt caching, or the Batch API. For agent workloads, the Claude Agent SDK uses these same rates; see install Claude Code to start in the terminal.

FAQ

How much does the Claude API cost per token?
Rates are quoted per million tokens (MTok). As of 2026-06-23: Opus 4.8 is $5/MTok input and $25/MTok output (so $0.000005 and $0.000025 per token); Sonnet 4.6 is $3/$15; Haiku 4.5 is $1/$5; Fable 5 is $10/$50. Confirm current rates on Anthropic's pricing page.
Which Claude model is cheapest?
Claude Haiku 4.5 is the cheapest current model at $1/MTok input and $5/MTok output, and the fastest — best for high-volume, simpler tasks. Sonnet 4.6 ($3/$15) balances cost and capability; Opus 4.8 ($5/$25) is for the hardest work.
Is Claude API output more expensive than input?
Yes. On every current model, output tokens cost about 5× input tokens. Because of that, long generations drive cost more than long prompts — cap output with max_tokens and reuse input via prompt caching.
How can I reduce Claude API costs?
Four levers: use a smaller model where it is good enough; enable prompt caching for repeated context (reads bill at ~0.1×); send non-urgent work through the Batch API (50% off); and cap max_tokens so replies do not run long. Measure first with the free token-counting endpoint.
Does the Claude API need a subscription?
No. API access is pay-per-token with no subscription — you add credit or a payment method in the Anthropic Console and pay for usage. Claude.ai chat subscriptions (Pro/Max/Team) are a separate product from API billing.