Implementation & ROI

What AI Agents Cost to Run

Estimate an agent's monthly bill from four cost lines and compare it with the time the same work takes by hand.

People time build, review, maintain Platform Model usage Tools and APIs

The short answer

An AI agent has four running costs: model usage billed by input and output tokens, the platform or hosting, the tools and APIs it calls, and people time for building, reviewing and maintaining. Estimate model usage as runs per month × steps per run × tokens per step × price per token.

What are the four cost lines?

An AI agent costs money on four lines: model usage, the platform, the tools it calls and people time. An AI agent is a language model that works in a loop, choosing a tool and reading the result until the task is complete. Budget for all four lines, because the model bill is one part of the total.

  • Model usage. Model providers bill by the token, a unit of text about the size of a short word or part of a longer one. They count input tokens, the text you send, and output tokens, the text the model writes, and they list a separate price for each.
  • Platform or hosting. The workflow tool that runs the agent charges a subscription, or you pay for a server and run the tool on it.
  • Tools and APIs. An API is a connection that lets one program request data or an action from another. Some of the services an agent calls are free within limits, and others charge per request.
  • People time. Someone builds the agent, someone reviews its drafts and someone repairs it after a rule changes or a provider updates the model.

Budgets often list the first line and leave out the last. Count the hours with the same care as the tokens.

Why does an agent run cost more than a chat reply?

An agent run costs more because each step of the loop sends the whole context to the model again. The context is all the text the model reads on a call: the system prompt, the tool descriptions, the task and the results of earlier steps. A model keeps nothing between calls, so the platform resends that text each time.

A chat reply is one call. An agent that checks a form, looks up a value, writes a record and drafts an email makes several calls, and each call carries more than the one before, since earlier tool results join the context. How AI agents work describes that loop step by step.

The effect on the bill is larger than the step count suggests. With example figures, a single chat reply sends 2,000 input tokens. A five-step agent run with a context that grows by 1,000 tokens per step sends 2,000, then 3,000, 4,000, 5,000 and 6,000. That comes to 20,000 input tokens for one run, ten times the single reply.

Example figures, input tokens per call 2,000 2,000 3,000 4,000 5,000 6,000 one call step 1 step 2 step 3 step 4 step 5 Chat reply 2,000 tokens Five-step agent run 20,000 tokens, ten times the reply
The lighter part of each bar is the earlier results the platform resends, and it grows with each step.

How do you estimate the monthly model bill?

Multiply four numbers: runs per month × steps per run × tokens per step × price per token. Do the sum once for input tokens and once for output tokens, then add the two. The figures below are example figures, not current prices; look up the real ones on the provider pricing pages in the references.

Example figures, input tokens Runs per month × Steps per run × Tokens per step × Price per token = Cost per month 1,000 5 4,000 $1 per million $20
The four blocks multiply, so halving any one of them halves the bill.
Example figures, not current pricesInputOutput
Runs per month1,0001,000
Steps per run55
Average tokens per step4,000500
Tokens per month20,000,0002,500,000
Example price per million tokens$1$4
Example cost per month$20$10

Input: 1,000 runs × 5 steps × 4,000 tokens gives 20,000,000 tokens, and at the example price of $1 per million that is $20. Output: 1,000 × 5 × 500 gives 2,500,000 tokens, and at $4 per million that is $10. The example model bill is $30 a month.

Replace my figures with your own. Your platform's run history shows the token count for each step, so build the agent, run ten real cases and take the average. Your current volume by hand gives you the runs per month.

Which levers reduce the cost?

Four levers lower the model bill: a shorter context, a smaller model for simple steps, fewer steps and caching. Each one changes a number in the formula.

  • Shorter context. Trim the system prompt to the rules the agent needs, and set each tool to return the fields the task uses in place of a whole record. Cutting the example average from 4,000 to 3,000 tokens per step lowers the input cost from $20 to $15.
  • A smaller model for simple steps. Providers sell several models at different prices. Sorting a form into a category needs less capability than drafting a careful reply, so you can send the simple step to a cheaper model.
  • Fewer steps. Do fixed work outside the loop. If the workflow cleans the fields and writes the log itself, the model makes fewer calls. Dropping the example from five steps to four removes the largest call, the last one.
  • Caching. Caching lets a provider store the part of the prompt that repeats on each call, such as the system prompt and tool descriptions, and bill those tokens at a reduced rate. The Gemini caching documentation in the references describes one provider's version.

Test after each change. A shorter prompt that drops a rule saves tokens and produces wrong results, which cost review time. If you run more than one agent on a task, multiply the whole formula by the number of agents; multi-agent systems covers that trade.

How does the total compare with doing the work by hand?

Add the four lines for a month and set the total against the cost of the hours the process takes by hand now. Use hours you have measured. The comparison below continues the example, and each number in it is an example figure.

Example figures, not real dataBy handWith the agent
Staff time per case6 minutes1.2 minutes of review
Staff hours for 1,000 cases10020
Maintenance hours per month05
People cost at $30 an hour$3,000$750
Model usage$0$30
Platform$0$50
Tools and APIs$0$20
Total per month$3,000$850

In this example the agent saves $2,150 a month. A one-off build of 40 hours at $30 an hour costs $1,200, so the first month's saving covers it. People time is the largest line on both sides of the table, and the model bill is the smallest line on the agent's side.

By hand example figures, per month People $3,000 $3,000 With the agent People $750 saving $2,150 $850 People $750, then model $30, platform $50, tools $20
Both bars use one scale: the three thin slices after people time are the model, the platform and the tools.

Your numbers will differ, and the result can reverse. A process with 50 cases a month may not repay a 40-hour build within the year. A long review per case removes most of the saving. Measure time per case before you build, as choosing a process to automate describes, then fill in the table with your own figures. My own builds and their notes sit under experiments.

Common questions

What is a token?

A token is the unit of text a model provider counts for billing, about the size of a short word or part of a longer one. Providers count the tokens you send as input and the tokens the model writes as output, and list a separate price for each.

Where do I find current model prices?

On each provider's pricing page, listed in the references. Prices change, so check the page on the day you budget and note the date beside your estimate.

Is the model bill the largest cost of running an agent?

In the worked example here, people time is larger: the hours spent building, reviewing drafts and maintaining the agent. Work out all four lines for your own process before you assume which one dominates.

Sources and references

  1. Anthropic, Pricing
  2. OpenAI, API pricing
  3. Google, Understand and count tokens
  4. Google, Context caching

Concepts covered: AI agent, token, input and output tokens, context, prompt caching, running cost, review time.

Weekly newsletter

The AI Brief by Clarence Cheang

A weekly exploration of the developments, technologies and ideas shaping artificial intelligence.

One email a week. Unsubscribe in one click. What is in each issue