In this lesson
The bill has three lines.
An agent's bill has the model, the channel and people's hours. Here you learn to estimate the model and keep spending in check.
- Estimate the tokens in the instructions and in the conversation
- Understand why input dominates the bill
- Set up an alert, a limit and an error budget
What a token is
The model does not read words. It reads tokens, pieces of text: a whole word, part of one or a single character. To estimate, use about 4 characters per token. For the exact number, use the provider's free counter, with the model you are going to use. A typical customer message has some 12 to 15 tokens. Lean instructions of 1,200 words, some 1,900.
Who pays for the input
The model does not keep the conversation. With each reply, it receives the instructions, the excerpts from the knowledge base, the tools, the history and the new message all over again, and you pay for all of it again. That is why the fourth reply costs more than the first.
In the example bakery, each reply has 2,550 input tokens and only 80 output tokens. The input dominates the bill. What weighs most is the size of the instructions and the history, not the short reply.
The bakery math
The bakery has 400 conversations a month, with 4 replies each: 1,600 replies. The input adds up to 4.08 million tokens, and the output to 128 thousand. Now open the pricing page of the model you use, note the date and multiply:
Prices change, and so does the exchange rate. That is why this lesson does not fix any values: the right math is the one you redo with the page open and the date noted.
A model for each task, caching and batching
High volume and a simple task call for the small model: classifying, extracting data, routing. A delicate, rare task can take the bigger one. Start with the cheapest one that can do the job and move up only where the test shows it falls short.
Two discounts are worth the math. Batching, for work that can wait, costs half at Anthropic. And caching: the fixed part of the instructions, which repeats in every reply, is read for a fraction of the input price.
Alert, limit and error budget
Set up two defenses in your account with the provider. The alert, at half the monthly cap, only notifies you. Your own limit, below the provider's cap, cuts off the calls. Note who receives the alert.
Google's SRE book says that 100% is not the right target. Write down how many serious errors a week you accept, for example two. Went over? Pause without asking permission, fix the cause and turn it back on after the attack battery from lesson 12.
Scenario
Hypothetical: on a sale day, the bakery's alert goes off at noon. The owner pauses the agent at 1 p.m., lowers the cap on exchanges per conversation and turns it back on in the afternoon.
What is not in the price table
The WhatsApp channel is charged by Meta, per message delivered. And people's hours (confirming sessions, answering escalations, reading conversations) do not show up on any pricing page, but they are what weighs most in a small agent.
What the pros know
Cached reads cost a fraction. On Anthropic's pricing page, reading a stretch of text that is already in the cache costs a small fraction of the normal input price. Since the fixed instructions repeat in every reply, they can become much cheaper. People who design the agent around cost put what does not change (instructions, rules, knowledge base) at the start of the request and what changes (the customer's message) at the end, because the cache only reuses the opening part that repeats exactly the same.
Careful
Before using a model's free tier with real customer messages, read on the provider's page whether the data can be used to improve the product. Test with made-up data.
Practice · 10 min
- Count the tokens in your instructions with the 4-character yardstick and then with the provider's counter.
- Redo the bakery math with your own numbers and the price on the model's page, noting the date.
- Set up the alert at half the cap, note who receives it and write down the week's error budget.
Summary
- The model rereads everything with each reply: input dominates the bill.
- Estimate with 4 characters per token and check with the provider's counter.
- Prices change: redo the math with the page open and the date noted.
- Caching and batching bring the bill down; a small model for a simple task.
- Alert before the limit; error budget written down beforehand.
Sources
Read on October 30, 2026.
- Anthropic. Pricing: caching and batching.
- Anthropic. Batch processing.
- Google. Embracing Risk (SRE book): error budget.
- Meta. WhatsApp Pricing.
Lesson quiz
Three situations to apply what you learned.
Isaque Victor free courses