opyebCloudCostCal

Unit economics of an AI agent: from cost per task to a monthly budget

An agent is not one request. It is a loop, and the loop is what makes the bill compound.

2026-11-28 · OPYEB

A chat product bills one request per user action. An agent bills one request per step — plan, call a tool, read the result, retry, answer — and every step resends the conversation so far. The cost model is therefore a loop, not a multiplication.

The shape of the bill

Take a modest agent: 5,000 tasks a month, 20 model calls per task, 4,000 input tokens and 300 output tokens per call. That is 100,000 requests, 400 million input tokens and 30 million output tokens a month.

ConfigurationMonthly costPer taskPer step
Claude Sonnet 5.5, no caching$1,100$0.220$0.011
Claude Sonnet 5.5, 70% cache hit$568$0.114$0.0057
Claude Haiku 5.5, 70% cache hit$30$0.006$0.0003

Two facts dominate. First, caching halves an agent's bill because 90% of each step's prompt is the same instructions and history. Second, the model tier changes the price by 19× — far more than any amount of prompt engineering.

Why the loop compounds

Each step appends the previous tool result to the context, so input tokens grow roughly linearly with step count: step 10 sends everything steps 1–9 produced. That is why an agent with a 30-step budget can cost three times a 10-step agent that solves the same task. Cap the steps, summarise the history, and drop tool outputs you no longer need.

The most expensive token in an agent is the one you resend forty times because it is easier than writing a summary.

Pricing the product

Once you have the per-task cost, the rest is ordinary unit economics:

  • Price per task at 5–10× the model cost, which covers retries, failures, free users and the infrastructure around the call.
  • Cap the tail. A per-task token ceiling prevents one pathological loop from costing more than the subscription.
  • Watch the mixture, not the average. A 20-step median with a 60-step 5% tail can add 30% to a budget that assumed the median.

A budget that survives contact

Add 30% to the model cost for retries and failed calls, 10% for logging and evaluation runs during development, and a fixed monthly allowance for the tools the agent calls. On the Sonnet-with-caching case that turns $568 into roughly $800 — a number you can price against, instead of a bill you discover.

Model your step count and cache rate · The model price table →

Guides →
Rate library About Contact