Back

AI Engineering from Scratch – Part 2

In Part 1, we learned that AI models read text as tokens – small chunks of words, rather than individual letters. Those same tokens are also what you’re billed for. Before we ask an AI model to handle a task, our team always estimates how much it will cost. Below, we explain how we calculate those costs and what the numbers look like in four simple examples.

What You Pay For

  • The cost of each request to an AI model has two components:
  • Input – everything you send it: your question, instructions, a document, or the previous conversation.
  • Output – everything it writes in response.
  • These are priced differently: with Claude models, an output token costs five times as much as an input token.

Why Answers Cost More Than Questions

  • Think of a knitted scarf. You can look at a finished scarf in a second – the whole thing is right in front of you. But knitting one takes work, stitch by stitch.
  • An AI model works in a similar way. Your text is already complete, so the model can “read” it all at once. But it writes its response one token at a time, taking everything written so far into account as it generates each new token. That takes longer and costs more.

Prices

Prices are per 1 million tokens (that’s several thick novels). Claude rates as of October 2026, in US dollars:

Model Input Output Best for
Haiku 5.5 0.10 0.50 Simple high-volume tasks
Sonnet 5.5 2 10 Everyday work
Opus 5.5 4 20 Complex tasks
Fable 5.1 10 50 The most complex tasks

Prices change, so we always check the official website before estimating.

How to calculate

We divide by a million because the price is per million.

Example 1. Contract summaries: which model to choose

Lawyers need short summaries of contracts: 40 a day over 22 working days — 880 contracts a month. One contract is about 12,000 tokens, and a summary is about 1,200.

With Opus 5.5, one summary costs:

We calculated the cost of the same job for three models:

Model One contract Per month
Haiku 5.5 $0.0018 $1.58
Sonnet 5.5 $0.036 $31.68
Opus 5.5 $0.072 $63.36

Takeaway: A 40-fold difference. So we start with the cheapest model and move to a pricier one only if the cheap one can’t cope. But if the cheap model constantly needs fixing, the savings disappear — what matters is the cost of a finished result.

Example 2. A puzzle with “thinking”: invisible costs

Modern AI models can “think” before answering by writing themselves a draft solution. You usually don’t see it, but you pay for it at the same rate as the answer, i.e., at the highest price.

We asked Sonnet 5.5 to solve a puzzle: the question was 600 tokens, and the answer was 200.

  • Without thinking: $0.0032
  • With 5,000 tokens of thinking: $0.0532

Takeaway: The answer looks the same but costs 16 times more. You can adjust how deeply the model thinks with the effort setting: low for simple tasks, high for complex ones.

Example 3. A support bot: saving on repeats

A bot answers customers using a 20,000-token manual. With every question, the model receives this manual again – and we pay for it every time.

Caching solves this: the model remembers the manual, and reading it again costs 10 to 40 times less than usual (depending on the model). The first save costs a bit more than usual, and the cache lasts for 5 minutes and is renewed with every question.

We calculated the cost of 50 questions in a row with Opus 5.5:

  • Without caching: $4.00
  • With caching: $0.30

Takeaway: The manual became 13 times cheaper.

Example 4. Translating an archive: when it can wait

We need to translate 2,000 old blog posts, with no rush. For tasks like this, there is batch processing (the Batch API): you send everything at once, the results arrive within a day, and the price is halved.

  • The regular way: $42
  • As a batch: $21

Takeaway: Everything non-urgent goes in a batch.

What if you’re on a subscription?

With subscriptions such as Claude Pro or Max, you don’t pay per token, but tokens count toward your limits. Extended thinking, large files, and long conversations bring you closer to reaching your limit.

Checklist

Check current prices before estimating.

Count input and output separately.

Multiply the cost per request by the real monthly volume.

Start with the cheapest model.

Don’t set maximum thinking depth unless you need it.

Cache repeated instructions.

Send non-urgent work as a batch.

In short

  • You pay for input (what you send) and output (what you get back).
  • The answer costs 5 times more than the question.
  • Invisible thinking is billed at the same rate as the answer.
  • Model choice saved us up to 40×, caching 13×, and batching 2×.

Next in the series

The whole conversation is sent to the model every time. But how much text can it hold? We’ll look at the context window: what it is and why answers get worse in long conversations.

Back to all blogs