Skip to main content

01 - The 2026 AI Cost Map: hardware, API, engineer, opportunity cost

The seven cost items of an AI project, which ones appear on an invoice and which do not, with five listings run on example figures you replace with your own.

What do you think about this article?

01 - The 2026 AI Cost Map: hardware, API, engineer, opportunity cost
AI Cost OptimizationPhoto:Tara WinsteadPexels

At a Glance

The seven cost items of an AI project, which ones appear on an invoice and which do not, with five listings run on example figures you replace with your own.

A 12,000 euro yearly AI budget: what is really inside it

A 12,000 euro yearly AI budget looks like a number you check by reading an invoice. It is not: the invoice from your model provider contains tokens, and tokens are only a part of what it costs to run an AI feature. The rest sits in the hours of the people who write and evaluate prompts, in the machine that runs the model if you do not use an API, in the contracts you sign for personal data, and in the features the team did not build because it was busy elsewhere. This guide takes the number apart line by line, gives you five listings to rebuild it with your own data, and tells you, for each line, where the estimate is solid and where it is an opinion.

A note on the numbers before we start. Provider prices change from one quarter to the next, so you will not find price lists here: the listings use invented prices and volumes, declared as such in the code, which you replace with your own. Where a fact about how billing works is needed, I point to the provider's official page, with the date on which I read it. This is the first article of the series; the next ones cover caching, compression and routing, the threshold between self-hosting and APIs and spend forecasting. As prerequisites, basic Python and the idea that a language model is paid per token are enough.

The seven cost items

The criterion that separates the items is simple: does someone receive an invoice for this, or not? The items with an invoice are already being watched, and usually already optimized. The ones without an invoice appear in no spreadsheet, and that is why waste piles up there.

Item What it contains Appears on an invoice? How you measure it
Token spend Input and output tokens paid to the model provider Yes From the usage field returned by every response and from the invoice
Compute Rented servers or GPUs to run your own models, even when they sit idle Yes Infrastructure provider invoice, divided by the requests served
Monitoring and evaluation Metrics, tracing, test sets to check quality Often no (if it is your own software) Maintenance hours plus any subscriptions
Engineer: development Integration, testing, release of AI features No Timesheet, or an estimate per sprint
Engineer: prompts and evaluation Writing prompts, comparing outputs, chasing wrong answers No Hours declared per activity, not per project
Compliance Data processing agreements, impact assessments, audits No Legal and security hours spent
Opportunity cost What the team did not do because it was working on the other six items No An estimate, not a measurement

There is no typical percentage in the table, and that is not an oversight. The breakdowns like «token spend is 30-50% of the budget» that circulate have no primary source: they depend on the product, the size of the team and how many hours you count. What you can say without inventing anything is the share of cost that appears on an invoice in your case, and that is exactly what the first listing computes. The seventh item is different from the others: it is an estimate of value, not an expense. I treat it separately further down, because adding it to the real expenses distorts the margins.

# AI cost taxonomy: every figure is INVENTED, replace them with your own.
from dataclasses import dataclass

@dataclass(frozen=True)
class Item:
    name: str
    eur_month: float
    on_invoice: bool  # does it appear on an invoice that someone receives every month?

ITEMS = (
    Item("API token spend", 800, True),
    Item("Compute (VPS or rented GPU)", 420, True),
    Item("Monitoring and evaluation", 120, True),
    Item("Engineer: AI development", 900, False),
    Item("Engineer: prompts and evaluation", 450, False),
    Item("Compliance (DPA, audit)", 150, False),
    Item("Estimated opportunity cost", 400, False),
)

def summary(items):
    total = sum(i.eur_month for i in items)
    if total == 0:
        raise ValueError("zero budget: nothing to split")
    visible = sum(i.eur_month for i in items if i.on_invoice)
    return total, visible

total, visible = summary(ITEMS)
for i in ITEMS:
    tag = "invoice" if i.on_invoice else "hidden"
    print(f"{i.name:34s} {i.eur_month:7.0f}  {i.eur_month / total:6.1%}  {tag}")
print(f"monthly total {total:.0f}, yearly {total * 12:.0f}")
print(f"share that appears on an invoice: {visible / total:.1%}")

# Output:
# API token spend                        800   24.7%  invoice
# Compute (VPS or rented GPU)            420   13.0%  invoice
# Monitoring and evaluation              120    3.7%  invoice
# Engineer: AI development               900   27.8%  hidden
# Engineer: prompts and evaluation       450   13.9%  hidden
# Compliance (DPA, audit)                150    4.6%  hidden
# Estimated opportunity cost             400   12.3%  hidden
# monthly total 3240, yearly 38880
# share that appears on an invoice: 41.4%

The listing defines an immutable Item with an on_invoice field and computes two totals: the whole cost and the part that someone receives on paper. With the invented figures, 41.4% of the cost appears on an invoice, so a little more than half of the budget is watched by nobody. The number itself is worth nothing to you; the method is: list the items, mark the ones with an invoice, and look at the share. If you cannot put a figure on a line, leave the line at zero and write «not measured» next to it: a declared gap is information, a hidden gap is a risk. The ValueError on a zero total avoids a division by zero when the sheet is still empty.

Token spend: it grows with the square of the turns, not with the users

A widespread belief says that token cost «scales exponentially with users». It is wrong: for the same behavior, cost grows linearly with the number of requests. The growth that surprises people comes from somewhere else, inside the single conversation. A chat API does not remember the previous turns: with every request you send the model the whole history again, and the whole history is billed again. OpenAI's documentation on conversation state says it plainly: even when you use previous_response_id, all input tokens of the previous responses in the chain are billed as input tokens.

If every turn adds roughly the same number of tokens, the sum of input tokens over n turns grows like n squared. The second listing shows it with an invented price (1 euro per million input tokens, 4 per million output tokens) and fixed-length messages: 600 tokens of system instructions, 150 for each question, 250 for each answer.

# The cost of a conversation grows with the SQUARE of the turns, because
# every request sends the whole previous history back to the model.
# INVENTED prices: 1.00 EUR per million input tokens, 4.00 per million output tokens.
PRICE_IN, PRICE_OUT = 1.00 / 1_000_000, 4.00 / 1_000_000
SYSTEM, USER, REPLY = 600, 150, 250  # tokens per message, for illustration

def input_tokens(turn, window=None):
    """Tokens sent at turn `turn` (1, 2, ...). `window` = how many past turns are resent."""
    past = turn - 1 if window is None else min(turn - 1, window)
    return SYSTEM + past * (USER + REPLY) + USER

def conversation_cost(turns, window=None):
    inbound = sum(input_tokens(t, window) for t in range(1, turns + 1))
    outbound = turns * REPLY
    return inbound, inbound * PRICE_IN + outbound * PRICE_OUT

for turns in (1, 5, 10, 20):
    tok, eur = conversation_cost(turns)
    tok_w, eur_w = conversation_cost(turns, window=4)
    print(f"{turns:2d} turns: {tok:6d} input tokens, {eur * 1000:6.2f} milli-EUR"
          f" | 4-turn window: {tok_w:6d}, {eur_w * 1000:6.2f}")
print("ratio 20 turns / 10 turns (full history):",
      round(conversation_cost(20)[0] / conversation_cost(10)[0], 2))

# Output:
#  1 turns:    750 input tokens,   1.75 milli-EUR | 4-turn window:    750,   1.75
#  5 turns:   7750 input tokens,  12.75 milli-EUR | 4-turn window:   7750,  12.75
# 10 turns:  25500 input tokens,  35.50 milli-EUR | 4-turn window:  19500,  29.50
# 20 turns:  91000 input tokens, 111.00 milli-EUR | 4-turn window:  43000,  63.00
# ratio 20 turns / 10 turns (full history): 3.57

Doubling the turns from 10 to 20 multiplies the input tokens by 3.57, not by two: for very large n the ratio tends to four. The second column of the output shows the simplest countermeasure, resending only the last four turns, and its price: at 20 turns the input tokens drop from 91,000 to 43,000, but the model no longer sees the beginning of the conversation. It is a trade-off, not a free trick: if the user stated their goal in the first turn and you lose it, the answer gets worse and no counter tells you. That is why episode 2 picks the context window up again together with caching, and the article on agents, FinOps for agents, shows the same growth inside a tool loop.

Two other elements inflate the input without you writing them. Anthropic's pricing documentation states that tool use adds system tokens to every request, on top of the normal input and output tokens; the definitions of the functions you declare therefore travel with every call. And the price list separates input, output and the cache rates (more expensive to write, cheaper to read): whoever sums up «the cost per token» with a single number is already approximating. To know the exact input before spending, the same documentation offers a token counting endpoint, free but subject to request limits, which returns an estimate; the real count appears in the usage field of the response.

Compute: the cost that exists even when nobody asks for anything

If you run your own models, the machine is paid by the hour, not by the request. A rented GPU costs the same with a hundred requests per minute and with zero, so the cost per request depends on utilization: what you pay divided by what you use. This is why, in comparisons between self-hosting and APIs, the decisive number is not the hourly price but the percentage of time in which the machine really works; article 3 builds the calculation with all the items. Here it is enough to fix the difference in nature: the API is a variable cost, your own compute is a fixed cost with a variable part on top (energy, bandwidth), plus the time of whoever maintains it. I do not quote GPU prices: they change too fast, and an outdated price list is worse than none.

People's time: the largest and least tracked item

The cost of people can exceed that of tokens, and it appears nowhere because it is scattered across general timesheets: an hour of prompt iteration, half an hour working out why an answer is wrong, a morning of migration when the provider retires a model. The third listing turns weekly hours per activity into euros per month. The formula is yearly company cost divided by yearly productive hours (here 46 weeks of 40 hours), multiplied by the hours of the activity and by 4.3 weeks per month.

# Hourly cost of an engineer and weight of AI activities. INVENTED figures.
PRODUCTIVE_HOURS_YEAR = 46 * 40    # 46 working weeks of 40 hours
WEEKS_PER_MONTH = 4.3
ANNUAL_COSTS = {"senior A": 70_000, "mid B": 52_000, "senior C": 66_000}  # cost to the company
ACTIVITY_HOURS_WEEK = {             # per engineer
    "prompts and iterations": 4.0,
    "output evaluation": 2.5,
    "debugging wrong answers": 1.5,
    "AI infrastructure maintenance": 2.0,
}

def monthly_cost(annual_cost, hours_week):
    return annual_cost / PRODUCTIVE_HOURS_YEAR * hours_week * WEEKS_PER_MONTH

total = 0.0
for name, hours in ACTIVITY_HOURS_WEEK.items():
    row = sum(monthly_cost(c, hours) for c in ANNUAL_COSTS.values())
    total += row
    print(f"{name:32s} {row:8.0f} EUR/month")
total_hours = sum(ACTIVITY_HOURS_WEEK.values())
print(f"total: {total:.0f} EUR/month for {len(ANNUAL_COSTS)} people")
print(f"AI hours per person: {total_hours} out of 40 = {total_hours / 40:.1%} of the time")

# Output:
# prompts and iterations               1757 EUR/month
# output evaluation                    1098 EUR/month
# debugging wrong answers               659 EUR/month
# AI infrastructure maintenance         879 EUR/month
# total: 4393 EUR/month for 3 people
# AI hours per person: 10.0 out of 40 = 25.0% of the time

With three people each spending ten hours a week on AI activities, the time costs 4,393 euros a month, more than five times the invented token spend of the first listing. The hours and salaries are examples, but the order of magnitude is the lesson: with the invented prices above, one hour of work is worth tens of millions of input tokens. This does not mean tokens should not be optimized; it means an optimization that costs three days of work must save more than the three days. The hourly cost depends on the assumption about productive hours: if your contract or your data say otherwise, change the constant at the top of the file.

Opportunity cost: an estimate of value, not an expense

Opportunity cost is what you do not earn because resources are elsewhere. The formula is: features not delivered per month times the average value of a feature. The fragile part is the value of a feature, which nobody knows before release. That is why only capacity taken away by unplanned work counts: if a migration was on the roadmap, the time spent is a choice, not a loss. The fourth listing applies the rule to four capacity allocations, with invented figures.

# Opportunity cost: only capacity taken away by UNPLANNED work counts.
# INVENTED figures: 5 features per month, each with an estimated value of 3,000 EUR.
FEATURES_MONTH = 5.0
FEATURE_VALUE = 3_000.0
ALLOCATIONS = (  # (description, % of capacity absorbed, was it on the roadmap?)
    ("roadmap prompts and evaluation", 8.0, True),
    ("unplanned model migration", 6.0, False),
    ("debugging answers in production", 4.0, False),
    ("compliance audit request", 3.0, False),
)

total = sum(p for _, p, _ in ALLOCATIONS)
unplanned = sum(p for _, p, planned in ALLOCATIONS if not planned)
lost_features = FEATURES_MONTH * unplanned / 100
print(f"capacity absorbed: {total:.0f}%, of which unplanned: {unplanned:.0f}%")
print(f"features not delivered per month: {lost_features:.2f}")
print(f"opportunity cost: {lost_features * FEATURE_VALUE:.0f} EUR/month, "
      f"{lost_features * FEATURE_VALUE * 12:.0f} EUR/year")

# Output:
# capacity absorbed: 21%, of which unplanned: 13%
# features not delivered per month: 0.65
# opportunity cost: 1950 EUR/month, 23400 EUR/year

Of the four lines, only three count: the 13% of unplanned capacity makes 0.65 lost features per month, that is 1,950 euros a month with the invented value of 3,000 euros per feature. The result depends on a product of two uncertain estimates, so always show it with its band: repeat the calculation with the value halved and doubled and report both. Do not add it to the expenses when you compute the cash margin: the margin you publish to a board must contain money that went out, not missed earnings.

Cost per feature and per user

The absolute cost says little; two ratios say much more: euros per delivered feature and euros per active user. The first tells you whether the team is becoming more efficient, the second whether the product supports its own revenue. The last listing computes both, plus a margin, and raises warnings when an item exceeds a threshold. The thresholds in the code (half of the total in tokens, 35% for people, 8 euros per user) are examples to show the mechanism: yours must be chosen by looking at your revenue per user.

# Cost per feature and per user. INVENTED figures; the thresholds are examples, choose your own.
MONTH = {
    "token": 2100.0, "compute": 650.0, "monitoring": 180.0,
    "engineer": 3200.0, "compliance": 280.0, "opportunity": 900.0,
}
FEATURES, ACTIVE_USERS, REVENUE = 6, 420, 18_000.0

def report(items, features, users, revenue):
    if features <= 0 or users <= 0:
        raise ValueError("at least one feature and one user are required")
    total = sum(items.values())
    out = {
        "total": total,
        "per_feature": total / features,
        "per_user": total / users,
        "margin": (revenue - total) / revenue,
        "warnings": [],
    }
    if items["token"] / total > 0.5:
        out["warnings"].append("tokens above half of the total")
    if items["engineer"] / total > 0.35:
        out["warnings"].append("engineer time above 35% of the total")
    if out["per_user"] > 8.0:
        out["warnings"].append("above 8 EUR per user per month")
    return out

r = report(MONTH, FEATURES, ACTIVE_USERS, REVENUE)
print(f"total {r['total']:.0f} EUR | per feature {r['per_feature']:.0f} | "
      f"per user {r['per_user']:.2f} | margin {r['margin']:.1%}")
print("warnings:", r["warnings"] or "none")
without = {k: v for k, v in MONTH.items() if k != "opportunity"}
r2 = report(without, FEATURES, ACTIVE_USERS, REVENUE)
print(f"without opportunity cost: per feature {r2['per_feature']:.0f}, margin {r2['margin']:.1%}")

# Output:
# total 7310 EUR | per feature 1218 | per user 17.40 | margin 59.4%
# warnings: ['engineer time above 35% of the total', 'above 8 EUR per user per month']
# without opportunity cost: per feature 1068, margin 64.4%

The last two lines show why separating expenses from estimates matters: including opportunity cost the margin looks like 59.4%, excluding it 64.4%, and the cost per feature goes from 1,218 to 1,068 euros. Neither is «the real one»: the first is the economic cost, the second the cash cost, and an honest report shows both with their label. The warnings fire on people's time and on cost per user, not on tokens: with the invented data, the problem is not the model invoice.

Signs that the budget is being wasted

Before optimizing anything, look for these signs in your tracking system. Each one is a question you must be able to answer with a number.

  • Tokens per request rise month over month without the product having changed: prompts get longer, or conversations get longer.
  • Shared API keys with no spending cap in development environments: a wrong loop in a test spends like a customer.
  • No attribution per function: you know how much you spend in total but not which function consumes it.
  • One model for all tasks: the most capable model used to classify a short sentence.
  • Prompt and evaluation hours never declared: you cannot say how long it takes to make an AI feature work.

The list has an implicit order of priority: the first two signs cost real money right now and are fixed in an afternoon (a spending cap, a counter per request); the third is the condition for everything else, because without attribution per function you do not know where to optimize; the last two are structural. No numeric threshold is universal: «tokens up by 20%» was the rule you could read around, but without a source it is just an example, so you choose the change that makes you open an investigation, by looking at your own time series.

Frequently asked questions

What is the most underestimated cost item in an AI project?

People's time: it is the item that has no invoice and therefore is not compared with the others. In the article's listing, with invented figures, it exceeds token spend by more than five times. Measure hours per activity, not per project.

Does token cost grow exponentially with users?

No, it grows linearly with requests. It grows with the square of the turns inside a single conversation, because with every request you resend the whole history and pay for it again. With fixed-length messages, doubling the turns from 10 to 20 multiplies the input tokens by 3.57 in the listing.

How do I compute the cost per delivered feature?

Add up the month's expenses (tokens, compute, monitoring, people, compliance) and divide by the number of features released in the same month. Keep opportunity cost out of the sum and report it separately: it is an estimate of value, not an expense.

What you can do now

You can list the seven cost items of an AI project and tell those that have an invoice from those that do not, computing the share nobody looks at. You can explain why the cost of a conversation grows with the square of the turns and what it costs to limit the history. You can turn the team's hours into euros with a declared formula, treat opportunity cost as an estimate with a band and not as an expense, and produce a report with cost per feature and per user. All the figures in the listings are examples: replace them with your own measurements. The next step is to reduce the item you measured, starting from episode 2.

Sources

  • Pricing (Anthropic) - the price list separates input tokens, output tokens and cache write and read rates; tool use adds tokens to every request; consulted on 2026-11-12
  • Token counting (Anthropic) - free counting endpoint, subject to request limits, that returns an estimate; consulted on 2026-11-12
  • Conversation state (OpenAI) - with previous_response_id all input tokens of the previous responses are billed as input; consulted on 2026-11-12
  • Tests run locally: python3 -I on the five listings (standard library), each one twice with identical output; prices, hours and volumes invented for the example

Commenti

Caricamento commenti...

Sign in to comment

New articles and tools on Telegram too

The Telegram channel flags the site's new articles and tools.

Did you like this article?

Explore other content on the blog or discover my projects