SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor · Updated 2026-08-13

Why Claude Expensive? Token Math Wey Explain Am

Output tokens cost 5x input, and Claude bills the full chat history every turn. See one session's arithmetic plus 4 ways to cut the bill.

Why Claude dey expensive? The short answer

Claude dey expensive for four reasons wey dey add on top each other. Output tokens dey cost five times the rate of input tokens. The API no dey keep memory of your conversation, so e go send the complete history again and bill am again for every turn. Agent fit turn one question into dozens of API calls, and every call carry that history wey dey grow. Apart from all this, dem price the frontier model based on how difficult the work wey e dey do be, no be based on the cost to run small model.

Token na piece of text. As rough guide, one token na about four characters, or about 0.75 words for English. Dem dey quote rates per million tokens, and dem write am as MTok (million tokens). Every rate below na the published Claude API rate as of August 2026.

Most surprise bills dey come from the second and third reasons for that list. People usually think say na the answers wey Claude write dey cost money. For agent session, the writing often dey less than one tenth of the bill.

Rates wey dem publish, so we agree on the numbers

ChartPublished Claude API rates, US dollars per million tokens, August 2026
The data behind this chart
[
  {
    "label": "Haiku 4.5",
    "input_usd": 1,
    "output_usd": 5,
    "cache_read_usd": "0.10"
  },
  {
    "label": "Sonnet 5, to Aug 31 2026",
    "input_usd": 2,
    "output_usd": 10,
    "cache_read_usd": "0.20"
  },
  {
    "label": "Sonnet 5, from Sep 1 2026",
    "input_usd": 3,
    "output_usd": 15,
    "cache_read_usd": "0.30"
  },
  {
    "label": "Opus 5",
    "input_usd": 5,
    "output_usd": 25,
    "cache_read_usd": "0.50"
  }
]

Look the pattern, no be the exact numbers. Every model dey charge exactly five times more for output than for input. Opus 5 cost 5 dollars for every million input tokens and 25 dollars for every million output tokens. Haiku 4.5 cost 1 and 5. So, the difference between the cheapest model and the most expensive one na five times, and the difference between reading and writing na also five times.

Sonnet 5 dey use introductory pricing of 2 and 10 dollars for every million through August 31, 2026. From September 1, 2026, e go change to 3 and 15. Rates dey change when model releases come out, so check the current ones before you use dem plan budget. No free tier dey below this table too, although new accounts dey start with small credit and some parts of the API no cost anything at all.

The last column na the cache read rate. E dey decide most bills. Come back to am after the arithmetic.

Wetin make output tokens cost five times pass input tokens?

Reading and writing no be the same amount of work. Dem process input tokens for one pass. The model read the whole prompt at once, and the work run in parallel across am. Na why 60,000 token prompt no take 60,000 times longer to read pass 1,000 token prompt.

Dem produce output tokens one after another. Every new token need im own pass through the model, and e need every token wey come before am as context. To write 1,000 tokens mean 1,000 passes, one after another. You no fit spread this serial work the way you fit spread reading, so every output token hold the hardware for longer.

Na why “make the answer shorter” no dey reduce cost as much as people expect. E only affect the smaller half of agent bill.

Why dem dey bill my whole conversation again for every turn?

Claude API no dey keep state. No conversation dey sit for Anthropic side wey you dey add one message to. Every request carry the complete message history, and the model read everything before e write anything. So turn 30 get bill for turns 1 reach 29 too.

This mean say cost of one conversation dey grow pass the length. Turn 1 bill small context. Turn 40 bill large context. If you add all the forty turns, you don pay for tokens wey pass the total number of tokens wey anybody ever write many times.

ChartContext size at each turn of a 40 turn agent session
The data behind this chart
[
  {
    "turn": 1,
    "context_tokens": "20,000"
  },
  {
    "turn": 5,
    "context_tokens": "32,000"
  },
  {
    "turn": 10,
    "context_tokens": "45,000"
  },
  {
    "turn": 15,
    "context_tokens": "55,000"
  },
  {
    "turn": 20,
    "context_tokens": "64,000"
  },
  {
    "turn": 25,
    "context_tokens": "74,000"
  },
  {
    "turn": 30,
    "context_tokens": "84,000"
  },
  {
    "turn": 35,
    "context_tokens": "92,000"
  },
  {
    "turn": 40,
    "context_tokens": "100,000"
  }
]

The session above start with 20,000 tokens. This one include the system prompt, the tool definitions, and the first files wey the agent open. By turn 40, the context don reach 100,000 tokens. If you average am across all forty turns, you go get about 60,000 tokens wey each request read.

Why agent dey cost pass chat?

Chat na one request for each question. Agent na one request for each step. Reading one file na one step. Running one test na one step. Reading test output na one step. Editing the file na one step. Forty steps to finish one task dey normal for coding agent.

Two extra costs dey come with tool use. Tool definitions na input tokens for every single request, because model need know which tools dey available each time. Anthropic publish the overhead: tool use system prompt na 286 tokens for Opus 5 when tool_choice set to auto, plus the tokens for your own tool schemas. Some server-side tools get separate fee too. Web search cost $10 for every 1,000 searches, on top of the tokens wey the results use.

Every tool result still remain inside context. Command wey print 3,000 lines go put those 3,000 lines inside every request for the rest of the session. The token usage per session wey Claude Code report dey show this clearly: watch how the input number dey increase immediately after noisy command.

The arithmetic for one real session

Dis na realistic one hour of agentic coding for Opus 5. E make forty API requests. The context dey grow from 20,000 reach 100,000 tokens, so e average around 60,000 tokens for each request. The model write around 700 tokens for each request. This one na mixture of short tool calls and some longer code blocks.

Requests in the session:      40
Average context per request:  60,000 tokens

Total input tokens billed:    40 x 60,000                    = 2,400,000
Input cost on Opus 5:         2,400,000 x $5 / 1,000,000     = $12.00

Total output tokens:          40 x 700                       =    28,000
Output cost on Opus 5:        28,000 x $25 / 1,000,000       =  $0.70

Session total                                                = $12.70
ChartWhere the money went in one 40 turn Opus 5 session, no caching
The data behind this chart
[
  {
    "label": "Input, context re-read",
    "billed_tokens": "2,400,000",
    "cost_usd": "12.00"
  },
  {
    "label": "Output, code and tool calls",
    "billed_tokens": "28,000",
    "cost_usd": "0.70"
  }
]

Check the split. Reading cost 12.00 dollars, while writing cost 0.70 dollars. So, the output wey you actually read na about five percent of the bill. The model write 28,000 tokens, but dem bill am for reading 2,400,000 tokens. Nobody type 2.4 million tokens. Na the same 100,000 tokens dem read again and again.

Lever 1: prompt caching, na di biggest one

Prompt caching dey store the processed form of one stable prefix for your prompt. For the next request, system go read that prefix from cache instead of processing am again. Writing to the cache cost 1.25 times the input rate for the five minute cache, or 2 times for the one hour cache. Reading from am cost 0.1 times the input rate. For Opus 5, that one na 0.50 dollars per million instead of 5 dollars.

Apply this to the session above. Each of the 100,000 tokens dey enter cache once as the conversation dey grow. The remaining 2,300,000 input tokens become cache reads.

Tokens written to cache:      100,000
Cache write at 1.25x input:   100,000 x $6.25 / 1,000,000    = $0.63

Tokens read from cache:       2,300,000
Cache read at 0.1x input:     2,300,000 x $0.50 / 1,000,000  = $1.15

Output cost, unchanged                                       = $0.70

Session total                                                = $2.48

You mark the part wey fit enter cache with a cache_control field. Put the breakpoint after the content wey no dey change between turns: the system prompt and the tool definitions. Any long document wey you dey refer to often belongs inside that same stable block.

{
  "model": "claude-opus-5",
  "system": [
    {
      "type": "text",
      "text": "<long, stable instructions>",
      "cache_control": {"type": "ephemeral"}
    }
  ],
  "messages": [{"role": "user", "content": "..."}]
}

The order of your prompt now dey decide cost. Cache hit need exact match from the very beginning of the prompt, so anything wey changes for every request must come after everything wey no dey change. If you put timestamp for the top of your system prompt, you go break the cache on every turn: the whole prefix go become a miss, and you go pay 1.25 times the input rate to write am again.

The response go tell you whether e work. Send one request and read the usage block.

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Every response get one usage object like this one:

{
  "usage": {
    "input_tokens": 105,
    "cache_creation_input_tokens": 7345,
    "cache_read_input_tokens": 7123,
    "output_tokens": 239
  }
}

If repeat request still show 0 inside cache_read_input_tokens, e mean say cache no dey get hit. The usual cause na say something before your breakpoint change. The five minute cache fit also expire, so request wey you send six minutes later go be a miss followed by fresh write.

Lever 2: send di easy turns go smaller model

Most turns for agent session no hard. Opening file, running formatter, reading diff. Dem no need frontier model. Route dem go Haiku 4.5 make input rate drop from 5 dollars per million go 1.

ChartThe same 40 turn session under four setups, US dollars
The data behind this chart
[
  {
    "label": "Opus 5, no caching",
    "session_cost_usd": "12.70"
  },
  {
    "label": "Opus 5, cached",
    "session_cost_usd": "2.48"
  },
  {
    "label": "Sonnet 5, cached",
    "session_cost_usd": "0.99"
  },
  {
    "label": "Haiku 4.5, cached",
    "session_cost_usd": "0.50"
  }
]

Same session cost 12.70 dollars for Opus 5 without caching, 2.48 with caching, 0.99 for Sonnet 5 with caching, and 0.50 for Haiku 4.5 with caching. Caching alone remove about eighty percent of the bill. Model choice remove most of wetin remain.

Na here be the honest warning. If cheaper model give wrong answer, e go cost you the whole session again, plus your own time. Route task based on how hard e be, no be based on price. This rule dey apply upward too: Claude Fable 5 list above Opus 5 for $10 and $50 per million, so read wetin those rates dey buy you before you send turn go there. How to choose between Opus, Sonnet and Haiku explain where each one dey perform well.

Lever 3: context hygiene

Every token wey you leave for context dey cost money for every remaining turn, so to remove token early dey worth much pass to remove am late. If you dump 5,000-token file for turn 5 of 40-turn session, system go read am 35 more times. That na 175,000 extra input tokens, wey nearly reach one dollar for Opus 5 because of one careless paste.

Four habits wey fit change the number:

  • Start fresh session for new task instead of continuing yesterday own.
  • Filter noisy commands before the output reach the model, with something like head -50, instead of filtering am after.
  • Ask for the one function wey you care about, no be the whole file.
  • When long session stop making progress, ask for summary and start again from there. Summary na few hundred tokens. Transcript na one hundred thousand.

Lever 4: batch anytin wey no be interactive

Batch API dey process requests asynchronously and e dey give 50 percent discount for both input and output. If job no need answer within the next second, batch am. This one cover classification, extraction, summarising backlog, and evaluation runs. Batch discount fit stack with prompt caching. E no apply to interactive session, because nothing dey wait for there.

Dem dey rip me off?

Na the real question wey dey under “why Claude dey cost plenty”, so make I answer am directly. Dem publish the rates, e dey the same for everybody for the standard tiers, and dem charge am per token. The exception na negotiated contract. Even for that case, Claude Enterprise pricing still put per-seat charge on top of the same metered tokens instead of replacing dem. Nothing for the bill dey discretionary. Wetin the rate card no fit tell you na whether you dey get value, because e dey price tokens while you care about results.

So price the result instead. The session above cost 12.70 dollars when e no use cache. If e deliver feature wey for take you one hour to build, that one cheap. If e spend forty turns dey go round and round, the same 12.70 dollars no buy anything, and the rate no be the problem.

Na this part you suppose remember. Your bill dey scale with tokens, not with value. Productive session and wasted session wey get the same length go cost the same. Na why the four levers matter pass the rate card: you no fit negotiate price per token, but na you dey decide how many tokens the job go take.

So track dollars per completed task, no be dollars per month. If that number dey fall as you tune caching and routing, your setup dey improve even when the monthly total dey rise, because the total dey rise from doing more work.

Wetin no go lower your bill

Some popular advice no dey do much. To tell the model make e “be concise” go reduce output, and output na only five percent of the example bill. If you make your own question shorter, you go save a few hundred tokens against 60,000 token context. To turn off extended thinking only help where thinking tokens really be meaningful part of your output. The usage block go show you that instead make you guess.

Bigger context window no be cost by itself. For Claude 4.6 and later, the full one million token window dey billed with the standard per-token rate. So, 900,000 token request costs the same per token as 9,000 token request. Window size no set the price. Na wetin you choose put inside the window dey set am.

Two other things belong for planning, no be inside one session. If you dey use am daily and interactively, compare pay per token with flat plan: the API and subscription cost comparison dey do that calculation. If flat plan better and you dey consider another vendor at the same time, the Claude and ChatGPT plans priced side by side dey run the same comparison for both. And if agent dey run unattended for server, set hard spend cap before you tune anything else. Na wetin cost controls for an AI agent on a VPS cover. For simple idea of the scale, what one million Claude tokens actually buys turn the rate card into pages of text.

FAQ

Why my Claude bill increase when I start use agent?

Because agent dey send plenty requests for one question, and every request carry the whole conversation wey don happen so far. Chat dey send one request for each question. Coding agent dey send one request for each step, and forty steps for one task na normal thing. Dem dey bill every one of these requests for the full context, so session wey end for 100,000 tokens fit cost over two million input tokens altogether. Read input_tokens and cache_read_input_tokens for the API response to see am directly.

Prompt caching really fit reduce the bill reach that level?

For the worked example, e reduce the session cost from 12.70 dollars to 2.48 dollars, because cache read cost one tenth of the input rate. The saving depend completely on your hit rate. With the five minute cache, e don pay for itself after one read, because the write cost 1.25 times input and the read cost 0.1 times. If your prompt dey change near the beginning for every request, you no go get any hit, and you go pay the write premium for nothing. Confirm with cache_read_input_tokens before you assume say e dey work.

I suppose use Haiku for everything?

No. Haiku 4.5 cost 1 dollars per million input tokens, compared with 5 for Opus 5, so the saving dey real for simple, high-volume work like classification and routing. Wrong answer for difficult work fit cost pass wetin the model save, because you go pay for the retry and your own time on top. The pattern wey dey work well na mixed: use the small model for mechanical turns, and the frontier model for the turn wey need judgement.

API cheaper pass Claude subscription?

E depend on how steady your usage dey. Subscription na fixed monthly price with usage limits attached. API na pay per token with no ceiling, so e cheaper when your usage light or e come in bursts, and more expensive when you use am heavily every working day. Take your average tokens per day from the usage block, calculate the price with your model rate, then compare the result with the plan price, wey for the entry tier dey explained for how much Claude Pro cost and where its usage limits stop you. If the total favour API, cancelling the plan or moving down one tier no waste the month wey you don already pay for, because your access go continue until the current billing period end.