GuideUpdated 5 October 2026

AI API Pricing Explained

Short answer

AI APIs charge per million tokens, with separate prices for input (what you send) and output (what the model writes); output usually costs several times more. Cached input, batch processing and service tiers can change the real price a lot. Example: Claude Sonnet 5.5 costs $2 per million input tokens, $10 per million output tokens and $0.20 per million cached input tokens.

Verified example prices (per 1M tokens)

Evidence: Verified
Source: claude.com/pricing and Anthropic announcements, checked 5 October 2026. Other vendors' prices could not be confirmed and are not shown.
ModelInputOutputCache reads
Claude Fable 5.1$10$50—
Claude Opus 5.5$4$20$0.20
Claude Sonnet 5.5$2$10$0.20
Claude Haiku 4.5$1$5—

Tokens, roughly

A token is a chunk of text, often part of a word. Providers publish their own tokenisers, and the same text can produce different token counts on different models, so compare costs on your own prompts rather than on word counts.

Worked example

A request with 10,000 input tokens and 1,000 output tokens on Sonnet 5.5 costs (10,000 ÷ 1,000,000 × $2) + (1,000 ÷ 1,000,000 × $10) = $0.02 + $0.01 = $0.03. The same request on Opus 5.5 costs $0.04 + $0.02 = $0.06. If 8,000 of the input tokens are a repeated system prompt served from cache, Sonnet's input cost falls to (2,000 × $2 + 8,000 × $0.20) ÷ 1,000,000 = $0.0056.

What changes the real price

  • Output length: output costs more per token than input on every model listed above.
  • Caching: repeated prompt prefixes can be billed at a much lower cached rate (cache writes may cost extra).
  • Batch processing: many providers discount non-urgent jobs processed asynchronously; check each provider's docs.
  • Long-context surcharges: some providers charge more once input passes a threshold; check before sending very long documents.
  • Agents: one task can make dozens of model calls, so estimate cost per task, not per call.

Common questions

Why is output more expensive than input?

Generating each output token takes more computation than reading input. Prices reflect that: Claude Sonnet 5.5 charges $10 per million output tokens versus $2 for input.

How do I estimate my monthly API bill?

Log tokens per request in a pilot, multiply by expected requests per month, and apply input, output and cache prices separately. Add a margin for retries and agent loops.

Are subscription plans cheaper than the API?

For one person's interactive use, a $20 subscription is usually simpler. For products serving many users, API pricing is the only option and scales with usage.

Sources