Markdown version

What a website costs to build with AI

Building this website with Claude Code and Codex has cost $4,909 at published API list rates, about $0.12 for an average Claude Code request, and prompt caching saved $30,882. Most answers to what a website costs to build with AI are guesses, and this one is not. I counted the AI requests made while building this site from the logs on the machine that built it, then priced them at the rates the providers publish. You can download the same data as JSON or CSV and get the same totals.

Covering to .

Key findings

  1. Across Claude Code and Codex, 85% of the cost of building a website with AI went on storing and re-reading earlier context. An average Claude Code request cost $0.12 at API list rates and carried about 180,000 tokens.
  2. Re-reading earlier context took 51% of the cost of an AI-built website, while writing the actual output took 15%.
  3. Claude Code and Codex re-read 220 tokens of earlier context for every token they wrote, so in AI coding the length of a conversation, not of an answer, sets the cost.
  4. 97% of the tokens used to build a website with AI coding assistants were earlier context read again, so they averaged $0.68 per million at API list rates, against $4.96 without prompt caching.
  5. Prompt caching saved $30,882 on a website built with Claude Code and Codex, about 6.3 times what the work cost at API list rates.
  6. In AI coding, storing context for reuse was 3% of the tokens but 34% of the cost, and each stored token was read back about 34 times.
  7. The instructions and files you give an AI coding assistant came to 1% of the cost of building a website with it.

Covering to .

Spend over time

I show the same spending three ways, because each one answers a different question about how the cost of an AI-built website accumulates. The weekly columns show how the spending moved, the calendar shows each individual day, and the running total shows how it added up. If you want the exact figures, they sit in the two tables underneath.

By week

Cost per ISO week at published API list rates. Each column is labelled with the Monday that starts its week. The first week covers only 3 days and the last week 2 days, because the records start on 31 Jul and end on 24 Nov.

By day

  • No usage
  • Under $5
  • $5 to $20
  • $20 to $50
  • $50 to $150
  • $150 and over
Each square is one calendar day, weeks running left to right and Monday at the top. A brighter square means more was spent that day, and an outlined square means no usage was recorded.

Running total

The cumulative cost at the end of each week, at published API list rates.
Every week, as a table
Cost and tokens per week, with the running total. The first week covers only 3 days and the last week 2 days, because the records start on 31 Jul and end on 24 Nov.
Week ofISO weekCost (USD)TokensRunning total
(3 days)2026-W31114.52100,808,169114.52
2026-W32347.65413,304,990462.17
2026-W33511.47721,418,906973.64
2026-W34483.50769,332,2221457.14
2026-W351007.15700,763,7072464.29
2026-W36378.13249,018,4142842.42
2026-W37110.0784,538,0642952.49
2026-W381.813,921,4372954.30
2026-W3910.7816,902,7012965.08
2026-W40148.10270,280,7133113.18
2026-W4110.2421,854,7323123.42
2026-W4214.2337,174,5963137.65
2026-W4394.35253,581,2483232.00
2026-W4440.9478,361,4223272.94
2026-W4537.2359,672,3503310.17
2026-W46674.341,465,759,3773984.51
2026-W47755.031,561,461,9264739.54
(2 days)2026-W48169.46410,829,4994909.00
Total4909.007,218,984,4734909.00
Every day, as a table
Cost and tokens per day. Days missing from this table had no recorded usage.
DateCost (USD)Tokens
100.0184,086,659
14.5116,721,510
14.9012,954,527
120.29141,927,279
37.1744,084,335
69.3388,003,652
105.96126,335,197
139.18194,125,711
236.52349,883,072
135.77177,410,123
135.81218,395,967
166.17344,191,526
90.96135,929,552
90.5670,815,177
336.04206,896,480
308.63190,312,025
266.22196,816,824
47.7855,519,898
48.4851,218,480
19.7023,989,668
137.7084,584,607
103.2259,816,485
51.3036,021,259
18.5316,147,590
47.6828,458,805
102.2665,455,640
5.4211,384,974
2.397,697,450
1.813,921,437
3.713,117,113
7.0713,785,588
2.212,563,641
64.19147,671,779
18.8946,469,556
62.8173,575,737
6.6614,116,927
3.166,134,380
0.421,603,425
0.921,298,509
13.3135,876,087
12.6524,901,363
18.5133,215,207
6.248,374,861
51.28179,728,657
5.677,361,160
1.122,005,498
6.889,807,836
17.7738,645,940
7.6312,529,280
7.5415,372,868
2.403,458,189
12.6825,351,447
4.938,617,905
3.004,233,622
10.6314,898,001
2.122,187,332
1.47925,854
3.895,072,724
7.4711,822,549
4.746,784,572
135.88310,874,505
381.09840,948,611
47.2589,640,499
94.02200,615,917
42.9772,940,647
260.91526,972,835
428.72929,590,077
7.4811,411,960
4.986,582,250
9.9713,964,157
16.2038,349,929
153.26372,479,570

Re-reading old context is 51% of the token cost

The ring and the bars split the same total by what the tokens were doing when I spent them.

Share of cost by what the tokens were doing. Re-reading earlier context, 51%. Storing context for reuse, 34%. Writing answers and code, 15%. New instructions and files, 1%. 51%34%15%1%
Re-reading earlier context$2,48251%$0.36 per M
Storing context for reuse$1,67434%$8.09 per M
Writing answers and code$71315%$22.47 per M
New instructions and files$39.221%$7.97 per M

Writing the actual output is 15%. Whenever an assistant continues a conversation it re-reads everything that came before, so most of the money buys memory, not new work. Did that surprise me? Yes. I had assumed the writing was the expensive part, and it is the part most cost estimates price, because the re-reading is invisible from the outside. Long conversations are expensive for the same reason long meetings are.

Here is why the cheap part wins. A token of output cost $22.47 per million, about 63 times a re-read token at $0.36. But the model re-read 220 tokens for every token it wrote, and volume beats price. Storing context for reuse is the other big slice, 3% of the tokens and 34% of the money, because a stored token bills at $8.09 per million. The instructions and files you add yourself came to 1%. For your own work it means the cheapest habit is a fresh conversation, started more often than feels natural.

Prompt caching saved 6.3 times what the build cost

The three figures compare the cost I measured with what the same work would have cost without caching.

Actually paid$4,909
Without caching$35,791
Saved$30,882
Re-read, per million input tokens$0.36
Sent fresh, per million input tokens$4.88
Stored, per million input tokens$8.09

All per-million rates on this page are blended across the models I used, the same limit as the model rates below.

97% of the tokens were context being read again, not written fresh, and across the models I used a re-read cost 7% of what the same token cost sent fresh. That is the whole mechanism behind the saving. I did nothing clever to earn it. Caching is on by default in both tools, yet it is the largest number on this page and most conversations about AI cost leave it out. If you are comparing tools on price, the cached input rate is the line I would read first.

Storing is the expensive step. Here it cost 1.7 times the fresh rate, and the cheap re-reads above earn that back fast. A stored token paid for itself on its first re-read, and the average one was read back 34 times. That is why I would leave caching on even when the storing line looks large. If your sessions are short and you rarely come back to the same context, you will read each stored token far fewer times, and save less.

Spread over all tokens, output included, the work came to $0.68 per million, and the same tokens without caching would have cost $4.96 per million. Output cost $22.47 per million here, so these two do not match the input prices above, and should not.

Cost by tool and model

By tool

Claude Code$4,72196%
Codex$1884%

Claude Code did most of the work here, so it carries most of the cost, $4,721 of $4,909, while Codex, which I used far less, came to $188. That split tells you how much I used each tool, not what either one charges per token. I would not compare them per record either, because Claude Code logs each individual request as a record while Codex logs a whole session as one.

Cost by tool. Codex records are whole sessions, not single requests.
ToolCost (USD)ShareTokensRecords
Claude Code4720.5996%7,061,533,77039,245
Codex188.414%157,450,70317

By model

Each bar shows what one model cost in total. The second figure divides that cost by the tokens the model processed, which gives its effective cost per million tokens.

Claude Opus 5.5$1,801$0.46 per M
Claude Opus 5$1,436$0.76 per M
Claude Fable 5$961$1.74 per M
Claude Fable 5.1$343$1.47 per M
GPT-5.6 Sol$188$1.20 per M
Claude Sonnet 5$92.80$0.33 per M
Claude Sonnet 5.5$85.63$0.43 per M
Claude Fable 5.2$1.67$2.23 per M
Claude Haiku 4.5under $1
Claude Haiku 5.5under $1

Cost per million tokens is the fairest way I have found to line the models up, but several things set it. One is the model's own list prices. The other is how its tokens split between cached re-reading, storing context for reuse, new input and output, because each of those bills at a different rate, and re-reading bills at a small fraction of the normal input rate. The longer a session runs, the more of it is re-reading, so the same model can average out very differently on two projects. Read these rates as a record of how I used each model, not a verdict on it. Your own mix would give you different numbers.

Cost by model, with the cost per million tokens. A model that cost under $1 has no rate here, because its cost is too small to divide reliably once rounded to the cent.
ModelCost (USD)TokensPer million tokens (USD)
Claude Opus 5.51800.733,898,645,3000.46
Claude Opus 51435.831,896,495,4430.76
Claude Fable 5961.07552,949,0211.74
Claude Fable 5.1342.61232,498,3291.47
GPT-5.6 Sol188.41157,450,7031.20
Claude Sonnet 592.80280,181,7570.33
Claude Sonnet 5.585.63198,702,5530.43
Claude Fable 5.21.67748,8792.23
Claude Haiku 4.50.18464,092not shown
Claude Haiku 5.50.07848,396not shown

I publish the same figures as JSON and CSV, so you can check them or reuse them.

Is that what I actually paid?

No. Two different numbers answer what a website costs to build with AI, and they are often confused for each other. The $4,909 above is what this work would have cost billed per token at published list rates. It is the only figure I can measure request by request, which makes it the right one for comparing ways of working with AI.

Both tools ran on monthly subscriptions, which charge the same flat fee whether you send one request or a thousand. On a project this size the subscription is the cheaper of the two, so I read the per token figure as a measure of how much work happened, not as a bill. If you are pricing a build of your own, a monthly seat is the number I would budget for, not $4,909.

Which claims about AI build cost hold up here?

These are claims you will often read about what AI coding costs. I checked them against the tokens I count here, priced at API list rates. Where a claim compares models, I price the same tokens at each model's rates, so only the price changes. Where the logs cannot settle a claim, I say so in the verdict and link the test. In the last column you can open a page with the claim. Some of those pages argue against it. So the link shows the claim is common, not that it holds.

Common claims about what AI coding costs, with the verdict, the evidence and a page where each claim appears.
ClaimVerdictEvidenceWhere it appears
Prompt caching cuts the cost a lotHoldsWithout caching, the same work would have cost 7.3 times as much at list prices.Prompt caching with Claude
Caching only pays in long sessionsContradicted Test E2 · One long conversation against fresh onesStoring a token for re-use costs more than sending it fresh, but one re-read paid the difference back here, so a conversation pays from its second request. Each stored token was re-read 34 times on average.Prompt caching pays on the second call
Output is most of the billContradictedWriting output was 15% of the cost. Re-reading and storing the conversation was 85%.LLM Cost Calculation Guide for Enterprise AI Teams in 2026
Shorter prompts save moneyDepends Test E2 · One long conversation against fresh onesText sent for the first time was 1% of the cost. Each request then re-reads the conversation so far, and re-reading was 51%, so a prompt costs most by staying in a long conversation, not by being long.Prompt Cost Engineering: How to Cut LLM Token Spend Without Degrading Quality
The cheaper model costs half as much for the same workContradicted Test E1 · Model swap on matched tasksPriced at Claude Sonnet 5.5, the same tokens cost 29% less than at Claude Opus 5.5, not 50% less, because both charge $0.20 a million tokens to re-read the conversation, and re-reading is most of the bill.Claude Sonnet vs Opus: Which to Use in 2026
The most capable model is too expensive for everyday workDepends Test E1 · Model swap on matched tasksPriced at Claude Fable 5.2, the same tokens cost 1.58 times as much as at Claude Opus 5.5, less than the twice its list prices suggest. Whether that is too much depends on the second attempts it saves.Sonnet 4.6 vs Opus 4.6: When to Pay 5x More (March 2026)
AI coding keeps getting cheaperHolds, in stepsThe same tokens cost 43% less at Claude Opus 5.5 than at Claude Opus 4.5. Of the five steps from one release to the next, the price per token fell at one and held at the others.Welcome to LLMflation – LLM inference cost is going down fast
Long context costs extraDepends on the providerClaude charges no long-context rate on any model priced here. OpenAI does, past a boundary it does not publish. Assuming 128,000 tokens, it added 61% to the Codex cost.Claude Sonnet 4 now supports 1M tokens of context
Reasoning tokens blow up the billToo small to call Test E4 · Reasoning effortReasoning was 38% of Codex's output tokens and 5% of its cost, over only 17 sessions. Claude Code's logs do not report reasoning separately.Input vs. Output Tokens
A subscription is cheaper than paying per tokenDepends on volumeAn average Claude Code request here cost $0.12 at API prices, so a $20 plan matches the API bill at about 170 requests a month, a $100 plan at about 830 and a $200 plan at about 1,700. Below that, paying per token is cheaper.Claude Max vs API Pricing: Which One Should You Pay For in 2026?
Sub-agents multiply token useCan't tell yet Test E3 · Sub-agents against one threadThe logs this page reads do not mark which requests a sub-agent made, so they cannot be counted apart yet.How we built our multi-agent research system

Tests for what the cost logs cannot answer

Some claims need a test, not more logs, because the logs show what each request cost, but not what the same task would have cost done another way. These are the tests I have written up, with what counts as a result and how long each must run before I publish one. None has started yet, so none has a result. Better counting (E5) would change what I collect, and three of the other tests need it first.

The figures and verdicts update with each data refresh. If a verdict stops matching its evidence, nothing new is published until I rewrite it. A test starts only when I decide to run it, and until then it is listed as not started.

E1 · Model swap on matched tasks, Not started, needs E5 first
What E1 does, what counts as a result, how long it runs, how I will publish it and what it would settle.
StatusNot started, needs E5 first
Waits forE5 · Better counting
How it worksPairs of website tasks of the same kind, such as a page fix or a data step change, done once on the everyday model and once on the cheaper one, alternating which goes first.
What counts as a resultEach task's API price at list rates, and whether it passed its checks without a second attempt.
Minimum run10 matched pairs
How I will publish itThe cheaper model saves money if its task costs less in at least 7 of 10 pairs with no more second attempts. Too small to call under 10 pairs.
Would settleThe cheaper model costs half as much for the same workThe most capable model is too expensive for everyday work
E2 · One long conversation against fresh ones, Not started, needs E5 first
What E2 does, what counts as a result, how long it runs, how I will publish it and what it would settle.
StatusNot started, needs E5 first
Waits forE5 · Better counting
How it worksRuns of related small tasks, done either all in one conversation or each in a fresh conversation that starts from a short written handoff.
What counts as a resultThe API price of each task at list rates.
Minimum run8 runs of each kind
How I will publish itFresh conversations are cheaper if their median task costs at least a quarter less. Too small to call under 8 runs of each kind.
Would settleCaching only pays in long sessionsShorter prompts save money
E3 · Sub-agents against one thread, Not started, needs E5 first
What E3 does, what counts as a result, how long it runs, how I will publish it and what it would settle.
StatusNot started, needs E5 first
Waits forE5 · Better counting
How it worksTasks that need a lot of reading, done either by one conversation reading the files itself or by handing the reading to sub-agents.
What counts as a resultTokens and API price per task, with sub-agent requests counted from the flag E5 would add.
Minimum run10 tasks each way
How I will publish itSub-agents multiply use if their tasks take at least twice the tokens in 7 of 10 pairs. Too small to call under 10 tasks each way.
Would settleSub-agents multiply token use
E4 · Reasoning effort, Not started
What E4 does, what counts as a result, how long it runs, how I will publish it and what it would settle.
StatusNot started
How it worksThe same kind of task done in Codex at low and at high reasoning effort.
What counts as a resultReasoning tokens, their share of the session's API price, and whether the task passed its checks.
Minimum run10 tasks at each effort
How I will publish itReasoning drives the bill if its share of the price is above half at high effort. Too small to call under 10 tasks at each effort.
Would settleReasoning tokens blow up the bill
E5 · Better counting, Not started
What E5 does, what counts as a result, how long it runs, how I will publish it and what it would settle.
StatusNot started
How it worksThe collector would also record a scrambled session key and whether a request came from a sub-agent. Both would stay private; only totals would be published.
What counts as a resultNew rows carrying both fields.
Minimum run30 days of collection
How I will publish itReady when 30 days of rows carry both fields. Nothing would be published from it alone; E1 to E3 would read from it.
Would settleNo claim in the table above

Questions about AI build cost

How much does a website cost to build with AI?
This one has cost $4,909 so far at API list rates, across 39,262 logged requests and sessions, and an average Claude Code request cost $0.12. That splits into Claude Code at $4,721 and Codex at $188. The figure covers all of the design, content, code, SEO and release work I have done with AI assistance on this site.
Did Claude Code or Codex cost more?
Claude Code, at $4,721 of the $4,909 total, about 96%. Codex came to $188. The split mostly reflects how much I used each tool, because Claude Code handled 7.1 billion tokens and Codex 157 million. Per token, Codex worked out at $1.20 per million and Claude Code at $0.67 per million. I would not compare them per record, since Claude Code logs one record per request and Codex one per session.
Is that an actual bill?
No. Both tools ran on monthly subscriptions, which charge a flat fee, not a price per token. The figure is what the same work would have cost at the published pay as you go rates. I use it to compare ways of working with AI, not as an invoice.
Why is the token count so much larger than the cost suggests?
Because 97% of the tokens are context being read again, not written fresh. Whenever an assistant continues a conversation it re-reads everything that came before. Across the models I used, a cached re-read cost 7% of the normal input rate, so a very large token count can still carry a modest cost. Averaged over every token, the work came to $0.68 per million.
What did caching actually save?
$30,882. Without caching the same work would have cost $35,791 instead of $4,909, roughly 6.3 times more. It is the single largest cost decision in the project, and I did not have to make it, because caching is on by default.
How can I keep the cost of AI coding down?
Shorter conversations, more than shorter prompts. Here 51% of the money went on re-reading earlier context and 1% on the instructions and files themselves. So trimming a prompt saves almost nothing, while a fresh conversation stops every later request from carrying the old context. I would also leave caching on. A stored token paid for itself on its first re-read here, and the average one was read back 34 times.
Which tools and models are counted?
Claude Opus 5.5, Claude Opus 5, Claude Fable 5, Claude Fable 5.1, GPT-5.6 Sol, Claude Sonnet 5, Claude Sonnet 5.5, Claude Fable 5.2, Claude Haiku 4.5 and Claude Haiku 5.5, used through Claude Code and Codex. I do not count work done in the Claude or ChatGPT web apps, because those apps do not record token usage on my machine.
How accurate is this?
The token counts are exact. They are what each service reported for each request, not an estimate worked back from the text. I take prices from the official published rate cards for each provider and review them regularly, so the totals follow any change. One figure is an assumption. OpenAI charges more past a context size it does not publish, so I assume a boundary of 128,000 tokens. Claude has no such surcharge.
Can I reuse these numbers?
Yes. I publish the full dataset as JSON and CSV at stable addresses under a Creative Commons Attribution licence. Attribution to eduarddziak.com is all I ask.

How this is measured

The figures come from the session logs that Claude Code and Codex write on the machine this site is built on. A request records what it used, so the token counts are measured, not estimated. The same request appears in several log files when a session is resumed, so I match records on their request identifier and count it once. Without that step the totals roughly double. I would be quietly reporting twice the work that happened, and I nearly did. Codex reports a running total for a whole session instead of one figure per turn, so I take only the final figure of a session. I read no prompt, no message, no file name and no file path, so only counts, model names and timestamps leave the collector. If you rebuild the totals from the download and land on my numbers, that is the whole method working.

I price every request at the rates on Anthropic's pricing page and OpenAI's pricing page, last checked 17 November 2026.

OpenAI charges a higher rate past a context boundary it does not publish. This figure is an assumption. I assume a boundary of 128,000 tokens, and I classify a Codex turn on its own size, so a session blends across both rates instead of being forced onto one of them. If your own logs sit near that boundary, this assumption is the one figure of mine you should not copy without checking. Claude has no long-context surcharge. Models 4.6 and later bill the full context window at standard rates. Every figure is priced at published API list rates, even though the subscription plans the tools ran on do not bill per token.

Covering to . Last updated .