---
title: "Claude API pricing: caching, batch, and real bills"
type: "guide"
url: "https://aifordevs.org/articles/claude-api-pricing"
markdown: "https://aifordevs.org/articles/claude-api-pricing.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/articles/claude-api-pricing"
description: "Claude API pricing for every current model as of November 8, 2026, with cache break-even math, batch stacking, tool fees, and a tested cost calculator."
author: "AI for Devs"
published: "2026-11-08"
level: "Intermediate"
topics: ["apis", "models"]
---

# Claude API pricing: caching, batch, and real bills

Claude API pricing for every current model as of November 8, 2026, with cache break-even math, batch stacking, tool fees, and a tested cost calculator.

> **TL;DR**
>
> - Claude API pricing as of November 8, 2026: Opus 5.5 costs $4 input and $20 output per million tokens, Sonnet 5.5 costs $2 and $10, and Haiku 5.5 costs $0.10 and $0.50 for prompts up to 100,000 tokens.
> - A 5-minute cache write pays for itself after 1 cache read, and a 1-hour write after 2 reads, on every current model.
> - Batch halves token prices and stacks with caching, so a batched cache read on Opus 5.5 costs $0.10 per million tokens.
> - Anthropic says models from Claude 4.7 onward count about 30% more tokens for the same text, which turns Opus 4.6 to Opus 5.5 from a 20% price cut into a rise of about 4%.
> - The TypeScript calculator in this guide ran on Node 26.12.1 with no API calls. It prices a 30-call Opus 5.5 agent session at $8.97 uncached and $1.49 with the 5-minute cache.

Claude API pricing is metered per million tokens, with separate rates for input, output, cache writes, and cache reads. Anthropic publishes those rates on its [pricing page](https://platform.claude.com/docs/en/about-claude/pricing), and every figure here was read from that page on November 8, 2026. A price sheet shows each rate, and it stops short of what a 30-call [agent loop](https://aifordevs.org/glossary#agent-loop) or a [RAG](https://aifordevs.org/glossary#rag) request costs once caching, batch, and tool fees combine. This guide works out those bills with a calculator you can run on your own `usage` objects.

## Claude API pricing by model

Claude API pricing as of November 8, 2026 runs from $0.10 input per million tokens on Haiku 5.5 to $10 on the Fable and Mythos models. Output costs five times input on every model in the table. These are first-party rates in US dollars, taken from [Anthropic's pricing page](https://platform.claude.com/docs/en/about-claude/pricing).

> **Prices last checked**
>
> Prices last checked November 8, 2026. This table is stale if Anthropic's page adds a model row, changes a cache-read footnote, or moves the 100,000-token Haiku 5.5 threshold.
>
> It also goes stale when a model retires. [Sonnet 4.5 retires November 30, 2026](https://platform.claude.com/docs/en/about-claude/model-deprecations). Opus 4.5 and Haiku 4.5 list earliest retirement dates of November 24 and October 15, 2026.

| Model | Input | 5-min write | 1-hour write | Cache read | Output | Batch input | Batch output |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Fable 5.1 | $10 | $12.50 | $20 | $0.25 | $50 | $5 | $25 |
| Mythos 5.1 (limited access) | $10 | $12.50 | $20 | $0.25 | $50 | $5 | $25 |
| Fable 5 | $10 | $12.50 | $20 | $1 | $50 | $5 | $25 |
| Mythos 5 (limited access) | $10 | $12.50 | $20 | $1 | $50 | $5 | $25 |
| Opus 5.5 | $4 | $5 | $8 | $0.20 | $20 | $2 | $10 |
| Opus 5 | $5 | $6.25 | $10 | $0.50 | $25 | $2.50 | $12.50 |
| Opus 4.8 | $5 | $6.25 | $10 | $0.50 | $25 | $2.50 | $12.50 |
| Opus 4.7 | $5 | $6.25 | $10 | $0.50 | $25 | $2.50 | $12.50 |
| Opus 4.6 | $5 | $6.25 | $10 | $0.50 | $25 | $2.50 | $12.50 |
| Opus 4.5 | $5 | $6.25 | $10 | $0.50 | $25 | $2.50 | $12.50 |
| Sonnet 5.5 | $2 | $2.50 | $4 | $0.10 | $10 | $1 | $5 |
| Sonnet 5 | $2 | $2.50 | $4 | $0.20 | $10 | $1 | $5 |
| Sonnet 4.6 | $3 | $3.75 | $6 | $0.30 | $15 | $1.50 | $7.50 |
| Sonnet 4.5 (deprecated) | $3 | $3.75 | $6 | $0.30 | $15 | $1.50 | $7.50 |
| Haiku 5.5, prompts up to 100,000 tokens | $0.10 | $0.125 | $0.20 | $0.01 | $0.50 | $0.05 | $0.25 |
| Haiku 5.5, prompts over 100,000 tokens | $0.50 | $0.625 | $1 | $0.05 | $2.50 | $0.25 | $1.25 |
| Haiku 4.5 | $1 | $1.25 | $2 | $0.10 | $5 | $0.50 | $2.50 |

All prices are USD per million tokens, the unit Anthropic calls MTok, and Anthropic API pricing and Claude API pricing refer to this same rate card. The page also lists three retired models: Opus 4.1 and Opus 4 at $15 and $75, and Sonnet 4 at $3 and $15.

Amazon Bedrock and Google-managed Claude on Google Cloud set their own prices, and their regional endpoints carry a 10% premium over global ones. Current model IDs are in [Anthropic's models overview](https://platform.claude.com/docs/en/models/overview), and the [platforms directory](https://aifordevs.org/platforms) lists other providers.

### Claude Opus pricing

Claude Opus pricing dropped with Opus 5.5, which costs $4 input and $20 output against $5 and $25 for Opus 5 through 4.5. Its cache reads cost $0.20 against $0.50, because Anthropic prices them at 0.05x of input instead of 0.1x. [Fast mode](https://platform.claude.com/docs/en/about-claude/pricing#fast-mode-pricing) is a separate premium rate of $8 and $40 on Opus 5.5, and $10 and $50 on Opus 5 and 4.8.

### Claude Sonnet pricing

Claude Sonnet pricing is $2 input and $10 output on both Sonnet 5.5 and Sonnet 5, but Sonnet 5.5 reads cache at $0.10 against $0.20. Sonnet 5's rate began as an introductory price and is now standard, per a footnote on Anthropic's page. The increase to $3 and $15 once scheduled for September 1, 2026 will not happen.

## Cache write premiums and read discounts

A cache write costs more than normal input and a cache read costs far less, so [prompt caching](https://aifordevs.org/glossary#prompt-caching) pays only when reads follow. [Anthropic's multipliers](https://platform.claude.com/docs/en/about-claude/pricing#prompt-caching) are 1.25x input for a 5-minute write and 2x for a 1-hour write. Reads cost 0.1x on most models, 0.05x on Opus 5.5 and Sonnet 5.5, and 0.025x on Fable 5.1 and Mythos 5.1.

### The break-even number of cache reads

You need 1 read to recover a 5-minute write and 2 reads to recover a 1-hour write, at every read multiplier Anthropic sells today. Compare one write plus N reads against sending the prefix uncached N + 1 times:

```text
with cache:     W + N * R
without cache:  1 + N
cache wins when N > (W - 1) / (1 - R)
```

| Read multiplier | Applies to | 5-minute write (W = 1.25) | 1-hour write (W = 2) |
| --- | --- | --- | --- |
| 0.1x | Most models | 0.28, so 1 read | 1.11, so 2 reads |
| 0.05x | Opus 5.5, Sonnet 5.5 | 0.26, so 1 read | 1.05, so 2 reads |
| 0.025x | Fable 5.1, Mythos 5.1 | 0.26, so 1 read | 1.03, so 2 reads |

Anthropic's page states the 1 and 2 for the 0.1x case. The table above shows the same integers hold at the cheaper read rates, though the 1-hour write only just needs its second read.

**Figure 1.** On Opus 5.5 rates, the 5-minute cache is cheaper than no cache from the second request, and the 1-hour cache from the third.

### Five-minute or one-hour cache

Pick the cache duration by the gap between requests to the same prefix. A hit [refreshes the entry at no extra cost](https://platform.claude.com/docs/en/build-with-claude/prompt-caching), so traffic that arrives less than 5 minutes apart never needs the 1-hour write. Gaps of 5 to 60 minutes are where the 1-hour write earns its premium, because each 5-minute miss costs 1.25x, more than sending the prefix uncached at 1x.

The lifetime runs from the start of the request. A response that streams for 4 minutes leaves about 1 minute for the follow-up, which catches long agent turns.

**Figure 2.** Gaps of 13 and 21 minutes force the 5-minute cache to write three times for 3.90x. The 1-hour cache writes once for 2.25x, and no cache costs 6x. Read multiplier is 0.05x.

A third option is keeping a 5-minute entry warm with [`max_tokens: 0` requests](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache). Twelve pings across an idle hour cost 0.6x at 0.05x reads, below the 0.75x extra that a 1-hour write costs over a 5-minute write. At 0.1x reads the same pings cost 1.2x, so use the 1-hour cache on those models.

### Cache misses that return no error

Prompts below the model's minimum are [processed without caching and return no error](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations). The minimum is 512 tokens on Fable 5 and 5.1, Mythos 5 and 5.1, Opus 5.5 and 5, Sonnet 5.5, and Haiku 5.5. It is 1,024 on Opus 4.8, Sonnet 5, Sonnet 4.6, and Sonnet 4.5, then 2,048 on Opus 4.7, and 4,096 on Opus 4.6, Opus 4.5, and Haiku 4.5.

Any byte change in the prefix also forces a new write, and editing tool definitions invalidates the whole cache. Check that `usage.cache_read_input_tokens` is above zero, and follow the prefix ordering in this guide to [context engineering](https://aifordevs.org/articles/context-engineering). Anthropic says each entry holds [KV cache](https://aifordevs.org/articles/kv-cache-explained) representations and cryptographic hashes in memory, with no raw prompt text at rest.

## Batch discounts and how they stack

The Message Batches API takes 50% off input and output tokens, and that discount multiplies with the cache multipliers and the 1.1x US-only multiplier. A batched cache read on Opus 5.5 costs $0.10 per million tokens. [Anthropic's batch docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing) say most batches finish within an hour, and requests still unsent at 24 hours expire unbilled.

| Opus 5.5 line item, per MTok | Standard | Batch | Batch and US-only |
| --- | --- | --- | --- |
| Input | $4 | $2 | $2.20 |
| 5-minute write | $5 | $2.50 | $2.75 |
| 1-hour write | $8 | $4 | $4.40 |
| Cache read | $0.20 | $0.10 | $0.11 |
| Output | $20 | $10 | $11 |

A batch holds up to 100,000 requests or 256 MB, and results stay available for 29 days. The [batch API](https://aifordevs.org/glossary#batch-api) cannot use fast mode, and the discount does not apply to Managed Agents sessions.

Cache hits are best effort because requests run concurrently, and Anthropic reports hit rates from 30% to 98%. It suggests the 1-hour cache for batches with shared context, since a batch often outlasts 5 minutes.

## Long-context pricing and the Haiku 5.5 cliff

Haiku 5.5 is the only current model with a long-context tier: a prompt over 100,000 tokens pays five times the normal rate on every token in that request, output included. [Claude 4.6 and later models](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing) other than Haiku 5.5 bill the full 1M-token [context window](https://aifordevs.org/glossary#context-window) at standard rates.

The boundary is a cliff. With 1,000 output tokens, a 100,000-token prompt costs $0.0105 and a 100,001-token prompt costs $0.0525.

Cache reads and writes count toward the length, and each request is priced on its own, so one long turn does not reprice earlier ones. Models outside the 1M group, including Sonnet 4.5, have [200K-token windows](https://platform.claude.com/docs/en/build-with-claude/context-windows), and the pricing page lists no higher tier for them.

## Server-side tool fees and tool tokens

Web search is the only Claude tool with a per-use fee, at $10 per 1,000 searches plus tokens for the results. Web fetch is token-only, and code execution is free alongside current web tools. Every tool also adds input tokens through its definition, so tool calling has a cost on each request.

| Tool | Fee beyond tokens | Token overhead |
| --- | --- | --- |
| Web search | $10 per 1,000 searches; failed searches are free | Results count as input this turn and later |
| Web fetch | None | Fetched content counts as input |
| Code execution | Free with `web_search_20260209` or `web_fetch_20260209`; otherwise $0.05 per container hour after 1,550 free hours a month, 5-minute minimum | Standard tokens |
| Bash | None | 325 tokens on 4.7 and later, 244 earlier |
| Text editor | None | 974 tokens on 4.7 and later, 745 earlier |
| Computer use toolset | None | About 4,500 tokens with default members |
| Browser use toolset | None | About 6,600 tokens with default members |
| Any tool at all | None | 286 tokens on Opus 5.5, Sonnet 5.5, and Haiku 5.5 with `tool_choice` auto or none |
| Managed Agents session | $0.08 per session-hour while running | Standard tokens |

All figures come from [Anthropic's tool pricing section](https://platform.claude.com/docs/en/about-claude/pricing#tool-use-pricing) as of November 8, 2026. One $0.01 search equals 2,500 input tokens on Opus 5.5 and 100,000 on Haiku 5.5, so search fees matter most on cheap models. The 1,550 free hours cover 18,600 minimum-length runs a month, and a request with files bills execution time even if the tool is never called.

Tools you load from an [MCP server](https://aifordevs.org/articles/build-an-mcp-server) land in the same `tools` block, so their names, descriptions, and schemas bill on every call.

## Tokenizer differences change a Claude bill

Anthropic says Claude 4.7 and later models produce about 30% more tokens for the same text than Sonnet 4.6 and earlier, so per-token prices across that line are not comparable. Multiply the new price by 1.3 before comparing. The increase varies with content, and the [pricing page](https://platform.claude.com/docs/en/about-claude/pricing) gives no range for it.

| Migration | List price change | Effective change at 1.3x tokens |
| --- | --- | --- |
| Opus 4.6 to Opus 4.8 | 0% | +30% |
| Opus 4.6 to Opus 5.5 | -20% | +4% |
| Opus 4.8 to Opus 5.5 (same tokenizer) | -20% | -20% |
| Sonnet 4.6 to Sonnet 5.5 | -33% | -13% |
| Haiku 4.5 to Haiku 5.5, under 100,000 tokens | -90% | -87% |

The 30% is Anthropic's figure. This guide did not measure it, because no API key was available.

The newer [tokenizer](https://aifordevs.org/glossary#tokenizer) also moves limits that count tokens. [Anthropic says](https://platform.claude.com/docs/en/models/overview) 1M tokens holds about 555K words on the current tokenizer and about 750K on earlier ones.

A prompt near 100,000 tokens on Haiku 4.5 can land over the Haiku 5.5 threshold. Recount with the [token counting endpoint](https://platform.claude.com/docs/en/build-with-claude/token-counting), which is free, rate limited, and returns an estimate.

Thinking follows the same arithmetic. [Thinking tokens bill as output](https://platform.claude.com/docs/en/build-with-claude/thinking), even when the text is omitted from the response.

## A tested Claude API cost calculator

The calculator below takes token counts from the API's `usage` object and returns an itemized bill. It applies the published multipliers for cache writes, cache reads, batch, US-only inference, and the Haiku 5.5 long-context tier. It ran on Node 26.12.1 with no dependencies, and the file has no network code.

```ts title="claude-bill.ts"
// claude-bill.ts: turn token counts into a Claude API bill.
// Prices are USD per 1M tokens, read from Anthropic's pricing page on November 8, 2026.
type Rate = {
  input: number;
  output: number;
  read: number; // cache read multiplier on the input price
  longAt?: number; // prompt length above which a higher rate card applies
  longMult?: number; // multiplier on every token price above longAt
  noUsOnly?: boolean; // model rejects inference_geo
};

export const MODELS: Record<string, Rate> = {
  "claude-fable-5-1": { input: 10, output: 50, read: 0.025 },
  "claude-mythos-5-1": { input: 10, output: 50, read: 0.025 },
  "claude-fable-5": { input: 10, output: 50, read: 0.1 },
  "claude-mythos-5": { input: 10, output: 50, read: 0.1 },
  "claude-opus-5-5": { input: 4, output: 20, read: 0.05 },
  "claude-opus-5": { input: 5, output: 25, read: 0.1 },
  "claude-opus-4-8": { input: 5, output: 25, read: 0.1 },
  "claude-opus-4-7": { input: 5, output: 25, read: 0.1 },
  "claude-opus-4-6": { input: 5, output: 25, read: 0.1 },
  "claude-opus-4-5-20251101": { input: 5, output: 25, read: 0.1, noUsOnly: true },
  "claude-sonnet-5-5": { input: 2, output: 10, read: 0.05 },
  "claude-sonnet-5": { input: 2, output: 10, read: 0.1 },
  "claude-sonnet-4-6": { input: 3, output: 15, read: 0.1 },
  "claude-sonnet-4-5-20250929": { input: 3, output: 15, read: 0.1, noUsOnly: true },
  "claude-haiku-5-5": { input: 0.1, output: 0.5, read: 0.1, longAt: 100_000, longMult: 5 },
  "claude-haiku-4-5-20251001": { input: 1, output: 5, read: 0.1, noUsOnly: true },
};

export type Usage = {
  input: number; // usage.input_tokens
  output: number; // usage.output_tokens, thinking included
  cacheRead?: number; // usage.cache_read_input_tokens
  cacheWrite5m?: number; // usage.cache_creation.ephemeral_5m_input_tokens
  cacheWrite1h?: number; // usage.cache_creation.ephemeral_1h_input_tokens
  webSearches?: number; // usage.server_tool_use.web_search_requests
};

export type Options = { batch?: boolean; usOnly?: boolean };
export type Lines = Record<"input" | "write5m" | "write1h" | "read" | "output" | "search", number>;

export function bill(model: string, u: Usage, o: Options = {}) {
  const m = MODELS[model];
  if (!m) throw new Error(`Unknown model: ${model}`);
  if (o.usOnly && m.noUsOnly) throw new Error(`${model} rejects inference_geo`);
  const { cacheRead = 0, cacheWrite5m = 0, cacheWrite1h = 0, webSearches = 0 } = u;

  // Long-context pricing looks at the whole prompt, cached tokens included.
  const prompt = u.input + cacheRead + cacheWrite5m + cacheWrite1h;
  const tier = m.longAt && prompt > m.longAt ? m.longMult! : 1;
  const mod = tier * (o.batch ? 0.5 : 1) * (o.usOnly ? 1.1 : 1);
  const usd = (tokens: number, perMTok: number) => (tokens * perMTok * mod) / 1e6;

  const lines: Lines = {
    input: usd(u.input, m.input),
    write5m: usd(cacheWrite5m, m.input * 1.25),
    write1h: usd(cacheWrite1h, m.input * 2),
    read: usd(cacheRead, m.input * m.read),
    output: usd(u.output, m.output),
    search: (webSearches * 10) / 1000, // no token multipliers on the search fee
  };
  return { lines, total: Object.values(lines).reduce((a, b) => a + b, 0) };
}

// Cache reads needed before caching beats sending the prefix uncached.
export const breakEvenReads = (writeMult: number, readMult: number) =>
  Math.floor((writeMult - 1) / (1 - readMult)) + 1;

// An agent loop: each call resends the history, which grows by `delta` tokens.
export function agentSession(
  model: string,
  s: { calls: number; firstPrompt: number; delta: number; output: number; cache: "none" | "5m" | "1h" },
) {
  const sum: Lines = { input: 0, write5m: 0, write1h: 0, read: 0, output: 0, search: 0 };
  let prompt = s.firstPrompt;
  let cached = 0;
  for (let call = 1; call <= s.calls; call++) {
    const usage: Usage =
      s.cache === "none"
        ? { input: prompt, output: s.output }
        : {
            input: 0,
            output: s.output,
            cacheRead: cached,
            [s.cache === "5m" ? "cacheWrite5m" : "cacheWrite1h"]: prompt - cached,
          };
    const { lines } = bill(model, usage);
    for (const key of Object.keys(sum) as (keyof Lines)[]) sum[key] += lines[key];
    cached = prompt;
    prompt += s.delta;
  }
  return { lines: sum, total: Object.values(sum).reduce((a, b) => a + b, 0), finalPrompt: cached };
}

const $ = (n: number, digits = 4) => `$${n.toFixed(digits)}`;

if (import.meta.main) {
  console.log("Break-even cache reads");
  for (const read of [0.1, 0.05, 0.025]) {
    console.log(`  read at ${read}x: 5m write ${breakEvenReads(1.25, read)}, 1h write ${breakEvenReads(2, read)}`);
  }

  const session = { calls: 30, firstPrompt: 20_000, delta: 3_500, output: 800 };
  console.log("\nAgent session: 30 calls, 20K first prompt, +3.5K per call, 800 output per call");
  for (const [model, cache] of [
    ["claude-opus-5-5", "none"],
    ["claude-opus-5-5", "5m"],
    ["claude-opus-5-5", "1h"],
    ["claude-sonnet-5-5", "5m"],
    ["claude-haiku-5-5", "5m"],
  ] as const) {
    const r = agentSession(model, { ...session, cache });
    console.log(
      `  ${model.padEnd(18)} ${cache.padEnd(5)} total ${$(r.total)}  input ${$(r.lines.input)}  writes ${$(r.lines.write5m + r.lines.write1h)}  reads ${$(r.lines.read)}  output ${$(r.lines.output)}`,
    );
  }

  const rag = { prefix: 6_000, retrieved: 9_150, output: 500 };
  const uncached = { input: rag.prefix + rag.retrieved, output: rag.output };
  const cached = { input: rag.retrieved, cacheRead: rag.prefix, output: rag.output };
  console.log("\nRAG request: 6K shared prefix, 9.15K retrieved plus question, 500 output");
  const row = (label: string, model: string, u: Usage, o?: Options) =>
    console.log(`  ${label.padEnd(26)} ${$(bill(model, u, o).total, 6)}`);
  row("Sonnet 5.5, no cache", "claude-sonnet-5-5", uncached);
  row("Sonnet 5.5, cache hit", "claude-sonnet-5-5", cached);
  row("Sonnet 5.5, hit, 1 search", "claude-sonnet-5-5", { ...cached, webSearches: 1 });
  row("Sonnet 5.5, hit, batch", "claude-sonnet-5-5", cached, { batch: true });
  row("Haiku 5.5, cache hit", "claude-haiku-5-5", cached);
  row("Opus 5.5, cache hit", "claude-opus-5-5", cached);

  console.log("\nHaiku 5.5 prompt-length cliff, 1,000 output tokens");
  for (const input of [100_000, 100_001]) {
    console.log(`  ${input.toLocaleString("en-US")} prompt tokens: ${$(bill("claude-haiku-5-5", { input, output: 1_000 }).total)}`);
  }
}
```

Run it with `node claude-bill.ts`. This is the real output:

```text
Break-even cache reads
  read at 0.1x: 5m write 1, 1h write 2
  read at 0.05x: 5m write 1, 1h write 2
  read at 0.025x: 5m write 1, 1h write 2

Agent session: 30 calls, 20K first prompt, +3.5K per call, 800 output per call
  claude-opus-5-5    none  total $8.9700  input $8.4900  writes $0.0000  reads $0.0000  output $0.4800
  claude-opus-5-5    5m    total $1.4877  input $0.0000  writes $0.6075  reads $0.4002  output $0.4800
  claude-opus-5-5    1h    total $1.8522  input $0.0000  writes $0.9720  reads $0.4002  output $0.4800
  claude-sonnet-5-5  5m    total $0.7439  input $0.0000  writes $0.3038  reads $0.2001  output $0.2400
  claude-haiku-5-5   5m    total $0.1007  input $0.0000  writes $0.0274  reads $0.0501  output $0.0232

RAG request: 6K shared prefix, 9.15K retrieved plus question, 500 output
  Sonnet 5.5, no cache       $0.035300
  Sonnet 5.5, cache hit      $0.023900
  Sonnet 5.5, hit, 1 search  $0.033900
  Sonnet 5.5, hit, batch     $0.011950
  Haiku 5.5, cache hit       $0.001225
  Opus 5.5, cache hit        $0.047800

Haiku 5.5 prompt-length cliff, 1,000 output tokens
  100,000 prompt tokens: $0.0105
  100,001 prompt tokens: $0.0525
```

A separate script compared all 17 model rows and 17 batch rows above against the text of Anthropic's page, and every cell matched. The function also reproduces the token portion of Anthropic's own worked example, $0.50 and $0.348 for an Opus 5.5 session. No Claude request was sent, so the token counts below are assumptions and only the arithmetic is tested.

One figure is unclear on the source page. Anthropic applies the batch and US-only multipliers to token prices and does not say whether they touch the search fee, so the calculator leaves that fee alone.

## Worked example: a 30-call agent session

A 30-call Opus 5.5 agent session costs $8.97 without caching and $1.49 with the 5-minute cache, an 83% saving. The session starts at 20,000 prompt tokens and grows by 3,500 per call. The output line stays at $0.48 in both cases, because caching only changes what you pay for input.

Each call adds 800 output tokens, thinking included, and 2,700 tokens of tool results. Every call starts inside the cache lifetime, and each one reads the previous prompt and writes only the new tokens. An [AI agent](https://aifordevs.org/articles/what-is-an-ai-agent) built on the Messages API resends its history on each turn, which is why input dominates the uncached bill.

| Model and cache | Input | Cache writes | Cache reads | Output | Total |
| --- | --- | --- | --- | --- | --- |
| Opus 5.5, no cache | $8.49 | $0 | $0 | $0.48 | $8.97 |
| Opus 5.5, 5-minute | $0 | $0.61 | $0.40 | $0.48 | $1.49 |
| Opus 5.5, 1-hour | $0 | $0.97 | $0.40 | $0.48 | $1.85 |
| Sonnet 5.5, 5-minute | $0 | $0.30 | $0.20 | $0.24 | $0.74 |
| Haiku 5.5, 5-minute | $0 | $0.03 | $0.05 | $0.02 | $0.10 |

The 1-hour cache costs $0.36 more here because no gap outlasts 5 minutes, so its premium buys nothing. Haiku 5.5 crosses 100,000 prompt tokens at call 24, and the last 7 calls produce 66% of its bill. Without that tier the same session would cost $0.05, so keeping every prompt under the line is worth about half the bill.

## Worked example: a RAG request

A RAG request with a 6,000-token shared prefix costs $0.0353 on Sonnet 5.5 uncached and $0.0239 on a cache hit, a 32% saving. The other 9,150 prompt tokens are ten 900-token chunks and a 150-token question. RAG saves less than an agent session because those chunks change on each query and stay at the full input price.

| Configuration | Per request | Per 100,000 requests |
| --- | --- | --- |
| Sonnet 5.5, no cache | $0.035300 | $3,530 |
| Sonnet 5.5, cache hit | $0.023900 | $2,390 |
| Sonnet 5.5, cache hit, 1 web search | $0.033900 | $3,390 |
| Sonnet 5.5, cache hit, batch | $0.011950 | $1,195 |
| Haiku 5.5, cache hit | $0.001225 | $122.50 |
| Opus 5.5, cache hit | $0.047800 | $4,780 |

The request returns 500 output tokens, and the web search row excludes tokens for the search results. At $0.01, one search raises this request by 42% and costs twice the output line.

Retrieval size is the next lever, since each 900-token chunk costs $0.0018 on Sonnet 5.5. Dropping from 10 chunks to 5 with [reranking](https://aifordevs.org/glossary#reranking) saves $0.0090 per request. The [vector database guide](https://aifordevs.org/articles/what-is-a-vector-database) covers retrieving fewer, better chunks, and [RAG versus fine-tuning](https://aifordevs.org/articles/rag-vs-fine-tuning) covers whether to retrieve at all.

## Check your Claude API pricing against real usage

Take one day of production `usage` objects and run them through `bill()` before changing anything, then group the result by line item. The largest line tells you what to change first, because each lever acts on one line and leaves the rest alone. Apply these rules in order:

1. If `input` is the largest line and a prefix repeats, add `cache_control` and confirm `cache_read_input_tokens` rises above zero.
2. If `write5m` exceeds `read`, your gaps outlast 5 minutes, so move that prefix to the 1-hour cache.
3. If `output` is the largest line, caching will not help. Try a cheaper model or a lower thinking effort, and check quality with [LLM evaluation](https://aifordevs.org/articles/llm-evaluation) before you ship it.
4. If the work can wait up to 24 hours, move it to the Batch API and halve every token line.
5. If you run Haiku 5.5, alert when any prompt reaches 90,000 tokens, ahead of the 100,000-token cliff.

Rerun the numbers whenever Claude API pricing changes. Follow the [APIs and pricing topic](https://aifordevs.org/topics/apis) for new guides, [model release news](https://aifordevs.org/news) for price changes, and the [Gemini API pricing guide](https://aifordevs.org/articles/gemini-api-pricing) for how a storage-based cache changes the same math. Model choice is covered in [the best LLM for coding](https://aifordevs.org/articles/best-llm-for-coding) and the [models topic](https://aifordevs.org/topics/models).

## Questions

### How much does the Claude API cost?

As of November 8, 2026, the Claude API costs $4 input and $20 output per million tokens on Opus 5.5, $2 and $10 on Sonnet 5.5, $0.10 and $0.50 on Haiku 5.5 for prompts up to 100,000 tokens, and $10 and $50 on Fable 5.1. Cache writes, cache reads, batch, and tool fees change the final bill.

### Is the Claude API free?

No. The Claude API is pay-as-you-go, although Anthropic says new users receive a small amount of free credits to test it. The token counting endpoint is free to call, subject to rate limits, and web fetch adds no fee beyond tokens. Everything else bills per token, plus usage-based fees on some server-side tools.

### How much does Claude Opus cost per million tokens?

Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens as of November 8, 2026. Its 5-minute cache write costs $5, its 1-hour write costs $8, and a cache read costs $0.20. Opus 5, 4.8, 4.7, 4.6, and 4.5 each cost $5 and $25, with reads at $0.50.

### Do Claude thinking tokens cost extra?

Thinking tokens bill at the model's normal output rate, so there is no separate thinking price. Anthropic charges for the full thinking generated, even when the API returns only a summary or omits the text. On Opus 5.5, that means thinking bills at $20 per million tokens as of November 8, 2026.

### Can I combine prompt caching with the Batch API?

Yes. Anthropic says the batch discount and cache multipliers stack, so a batched cache read on Opus 5.5 costs $0.10 per million tokens as of November 8, 2026. Cache hits inside a batch are best effort, and Anthropic reports hit rates from 30 to 98 percent. It suggests the 1-hour cache for batches that share context.

### How can I estimate a Claude API bill before sending a request?

Call the token counting endpoint with the exact model ID, then multiply by the rates in the pricing table. Anthropic makes that endpoint free to use, subject to rate limits, and says the count is an estimate. It rejects requests that include most server tools, such as web search, so measure those from the usage object of a real response.

### Why did my Claude API bill go up after switching models?

Check the tokenizer first. Anthropic says Claude 4.7 and later models produce about 30 percent more tokens for the same text than Sonnet 4.6 and earlier. A newer model with the same list price can therefore bill about 30 percent more, and token counts or budgets measured on the older model no longer apply.

## Sources

1. [Anthropic docs, Pricing (read November 8, 2026)](https://platform.claude.com/docs/en/about-claude/pricing)
2. [Anthropic docs, Prompt caching (read November 8, 2026)](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)
3. [Anthropic docs, Batch processing (read November 8, 2026)](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
4. [Anthropic docs, Token counting (read November 8, 2026)](https://platform.claude.com/docs/en/build-with-claude/token-counting)
5. [Anthropic docs, Thinking (read November 8, 2026)](https://platform.claude.com/docs/en/build-with-claude/thinking)
6. [Anthropic docs, Context windows (read November 8, 2026)](https://platform.claude.com/docs/en/build-with-claude/context-windows)
7. [Anthropic docs, Models overview (read November 8, 2026)](https://platform.claude.com/docs/en/models/overview)
8. [Anthropic docs, Model deprecations (read November 8, 2026)](https://platform.claude.com/docs/en/about-claude/model-deprecations)

## Cite this guide

AI for Devs. "Claude API pricing: caching, batch, and real bills." Published November 8, 2026. https://aifordevs.org/articles/claude-api-pricing

- Page: https://aifordevs.org/articles/claude-api-pricing
- Markdown: https://aifordevs.org/articles/claude-api-pricing.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
- Published: 2026-11-08
