Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder
Module 10Full course11 min read

Understanding Your AI Bill

Where AI spend actually comes from — input, output, thinking, cached, and tool tokens — and how to attribute every dollar to a feature and a customer.

The invoice says $3,180 for the month, up from $1,400. Someone asks which feature caused it, and the honest answer is a shrug. The provider's console shows tokens by model and by day, but your product doesn't have models. It has ticket summaries, drafted replies, a triage classifier, and a help-center assistant, used by customers on different plans. Until spend is broken down along those lines, you can't tell whether the jump is healthy growth, one customer's automation script, or a background job you forgot about.

This lesson takes the bill apart. You'll learn the kinds of tokens you actually pay for (including the ones you never see), compute the cost of any call from the usage data the API returns, and build a small cost ledger that attributes every dollar to a feature and a customer, so the next spike takes five minutes to explain.

The tokens you pay for

Tokens are the units models read and write; Tokens, Context Windows, and What They Cost covers how text becomes tokens. For billing, what matters is that not all tokens cost the same. A single Claude request can include up to five differently priced kinds:

Token typeWhat it isHow it's billed
Uncached inputEverything you send that wasn't read from the prompt cache: system prompt, tool definitions, retrieved documents, conversation history, the user's messageThe model's input price
Cache writesInput stored in the prompt cache for reuseAbout 1.25× the input price (5-minute cache) or 2× (1-hour cache)
Cache readsInput served from the prompt cacheA small fraction of the input price: between 2.5% and 10% of it on current Claude models
ThinkingThe model's internal reasoning before it answersOutput price. You pay for it even though the text isn't returned by default
Visible outputThe response your code actually receivesOutput price

At the time of writing (November 2026), Anthropic lists these prices per million tokens; check the current pricing page before relying on them:

ModelInputOutputCache reads
Claude Opus 5.5$4$20$0.20
Claude Sonnet 5.5$2$10$0.10
Claude Haiku 5.5$0.10 ($0.50 for prompts over 100K tokens)$0.50 ($2.50 over 100K)$0.01 ($0.05 over 100K)
Claude Fable 5.1$10$50$0.25

Three things about this table shape every AI bill:

  • Output costs five times input for every model listed. A feature that writes long answers is expensive even with short prompts.
  • Thinking is output. On a reasoning-heavy request, thinking tokens can outnumber the visible answer several times over. The effort setting is the main dial; Reasoning Models: When Thinking Is Worth Paying For covers when to turn it down.
  • The model choice dominates everything. Sonnet's input price is 20 times Haiku's. A classifier on Sonnet that would work on Haiku is the most common single source of waste.

Costs hiding inside "input"

Some input tokens don't look like input when you write the code:

  • Tool definitions. Every tool's name, description, and JSON schema is sent with every request, plus a small amount of provider-added instruction text whenever tools are present. Ten detailed tools can add thousands of tokens to each call.
  • Tool results. When the model calls a tool and you send back a 5,000-token database dump, that dump is input on the next request, and on every request after it in the same conversation.
  • Conversation history. A chat feature resends the whole history each turn. Turn 20 pays for turns 1 through 19 again.
  • Images and PDFs. They're converted to tokens, often many of them. Media Pipelines: Uploads, Storage, and Cost covers their costs.

Server-side tools such as Anthropic's web search also carry a per-use fee on top of the tokens their results add. The response's usage.server_tool_use field counts those requests.

Modifiers on the whole request

Finally, some choices change the price of everything in a request. Batch processing costs about half. Premium options such as a priority service tier or a faster inference mode cost more. And on Haiku 5.5, a prompt over 100K tokens moves the entire request to the higher long-prompt rate.