Three costs that hide in the bill
Three smaller follow-ups come up too: retries, billing each customer, and long prompts.
Failed and retried requests still cost tokens
A request that times out after 200 tokens has still been billed for them, and a retry pays the input again. Count the tokens of failed requests in the cost per conversation, and cap retries, as the batch-inference lesson does for its workers.
Bill each customer for their own tokens
A business selling an LLM feature records the input, cached and output tokens of every request against the customer who sent it. Then a per-customer budget can cut off one customer's runaway loop before it costs the business a month's margin.
A longer prompt can cost more per token
Haiku 5.5's price page lists $0.10 per million input tokens for prompts up to 100,000 tokens. Above that line the price is higher, so a feature that stuffs whole order histories into the prompt can cross into a pricier tier. Retrieve what the question needs instead.