Choosing and Using the ToolsLesson 32 of 76

Module 4 · What it actually costs

Costing a job before you run it

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 4 of 10 in this chapter

This chapter’s goalEstimate the cost of a job from a measured sample before running it, cut that cost with prefix caching, batching and model routing without lowering quality, choose between a subscription, prepaid credit and pay-as-you-go for your own pattern of use, and set an enforced cap so the worst case is bounded.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Costing a job in fifteen minutesRun twenty realitemsReal ones,including onelong and oneshort, andrecord the tokenusage theresponse reportsfor each.Take theaverageIn this example,1,850 tokens inand 240 out peritem.Multiply by thewhole jobFifty thousanditems: 92.5million tokensin, 12 millionout.Add a thirdRetries, secondpasses, the runyou abandonhalfway.Anything under afifth isoptimism.Run the sametwenty on asmaller modelScore both. Nowthe price of theextra accuracyis a numberrather than anassumption.Precision is not the point. Knowing whether the answer is twenty dollars or five hundred is, and theper-item figure (twelve paise an invoice, a fifth of a cent a ticket) is the number that ends mostarguments about whether to do this at all.
Precision is not the point. Knowing whether the answer is twenty dollars or five hundred is, and the per-item figure (twelve paise an invoice, a fifth of a cent a ticket) is the number that ends most arguments about whether to do this at all.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Measure twenty, multiply by the rest

The reliable method has three steps and takes fifteen minutes. It is worth doing before anything that runs more than a few hundred times, and it converts an anxious guess into a number.

1. Run twenty real items. Not made-up ones: real ones, including a long one and a short one. Record the token usage for each.

Python
tot_in = tot_out = 0
for item in sample_of_20:
    r = client.chat.completions.create(model=M, messages=build(item))
    tot_in  += r.usage.prompt_tokens
    tot_out += r.usage.completion_tokens
print(tot_in/20, tot_out/20)      # average per item

2. Multiply.

Text
per item:   1,850 in, 240 out
50,000 items:
    input   92,500,000 tokens
    output  12,000,000 tokens
at $0.15 / $0.60 per million:
    $13.88 + $7.20 = $21.08
at $3.00 / $15.00 per million:
    $277.50 + $180.00 = $457.50

3. Add a third. Retries after failures, items that need a second pass, the run you abandon halfway and restart. A third is a realistic allowance; anything under a fifth is optimism.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI at Work exam.

Stuck on something?Ask Rukmini, your AI tutor

How to cite: Addaly (2026) ‘Costing a job before you run it’, in Choosing and Using the Tools. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/choosing-your-tools/estimating-a-job (Accessed: 29 November 2026).