Skip to content

AI spend · Explainer

Cents one day, dollars the next: what sets the price of an AI coding session

Two engineers run the same task with the same tool and get bills an order of magnitude apart. Here is what actually sets the price, using Anthropic’s published API rates as the worked example.

By Nythrex team3 min read

A vintage London taxi meter in a black metal case, showing fare, miles and extras counters.
The fare depends on the route, not just the destination. Photo: Everyman Films, CC0, via Wikimedia Commons.

Most teams first meet AI cost as a total: a monthly invoice, a usage limit, a budget alert. The total hides the mechanics. An AI coding session is a long conversation in which the model re-reads a growing context on every turn, writes code, calls tools and reads their results. Each of those steps is priced, and small choices change the price a lot.

gap in input price between Claude Haiku 5.5 and Claude Fable 5.1
100×
output price relative to input on current Claude models
5×
cheaper to read cached context than to send it fresh on Sonnet 5.5 and Opus 5.5
20×
the standard price of Opus 5.5 when run in fast mode
2×

1. The model

Anthropic’s list prices per million input tokens currently run from $0.10 for Claude Haiku 5.5 (on prompts up to 100,000 tokens) through $2 for Sonnet 5.5 and $4 for Opus 5.5 to $10 for Fable 5.1. Coding tools and agents often choose the model for you, or switch between models within a task. A session that moves to a larger model for one hard step pays that model’s rate for everything it reads and writes in that step.

2. Output is the expensive token

Every current Claude model charges five times more per output token than per input token: $10 against $2 per million on Sonnet 5.5, $20 against $4 on Opus 5.5. Long explanations, whole rewritten files and verbose plans all land on the expensive side of the bill.

Claude API list prices per million tokens, October 2026
ModelInputCache hitOutput
Haiku 5.5 (prompts up to 100K tokens)$0.10$0.01$0.50
Sonnet 5.5$2$0.10$10
Opus 5.5$4$0.20$20
Opus 5.5, fast mode$8$0.40$40
Fable 5.1$10$0.25$50

A coding agent pays to re-read its own conversation on every turn. Caching decides how much.

3. Caching, or paying to re-read

An agent sends its working context — instructions, files, earlier turns — with every request. Prompt caching lets the model read repeated context at a fraction of the price: on Sonnet 5.5 and Opus 5.5 a cache hit costs 5% of the normal input rate, while writing to the five-minute cache costs 1.25 times the input rate. Leave a session idle past the cache lifetime, or keep changing the start of the context, and the next turn pays to write it again.

A simplified example on Sonnet 5.5: 40 turns over a 120,000-token context, with 30,000 tokens of output. If every turn after the first hits the cache, that is about $0.30 to write it, $0.47 to read it and $0.30 for output — roughly $1.07. If every turn has to write the cache again, it is about $12.30. Same task, same model, more than ten times the price. (Arithmetic on list prices, not a measured session.)

An early 20th-century photo of a man in a white shirt inspecting a meter on a car while two colleagues watch.
Someone has to read the meter. Photo: Bain News Service, public domain (Library of Congress), via Wikimedia Commons.

4. Context size

Every token of context is paid for on every turn it is sent. Current Claude models other than Haiku 5.5 bill the full one-million-token window at standard rates, so a 900,000-token request costs the same per token as a 9,000-token one — but it is still a hundred times as many tokens. Haiku 5.5 works the other way: above 100,000 tokens, its prices rise fivefold.

5. Speed and where it runs

Fast mode for Opus 5.5 costs $8 per million input tokens and $40 per million output tokens, twice the standard rate. Pinning inference to the United States adds 10% to every token category. The Batch API halves prices for work that can wait — rarely an option for an interactive coding session.

What to do on Monday

  1. 1

    Know which models your tools use

    Check the model and speed settings of each coding tool and agent. Defaults change with releases.
  2. 2

    Watch cache behaviour in long sessions

    Long idle gaps and constantly rewritten context make sessions pay full price to re-read what they already had.
  3. 3

    Price the change, not the session

    Compare what a shipped change cost, including retries and CI, instead of judging single sessions.

Sources

Frequently asked questions

Why does the same AI coding task cost different amounts?

Because the price depends on the model, how much output is written, whether repeated context is read from cache, how large the context is and whether fast mode or regional inference is used. Together these can move the cost of one task more than tenfold.

How much does prompt caching save?

On Claude Sonnet 5.5 and Opus 5.5, reading cached context costs 5% of the normal input price; writing to the five-minute cache costs 1.25 times. How much a session saves depends on how often it hits the cache.

Is output or input more expensive?

Output. On current Claude models an output token costs five times as much as an input token.

Stop guessing.
Start seeing.

No card and no subscription: paid plans have not launched yet.

Create accountNo card, no subscription