AGENSPHERE/ JOURNAL
← JOURNAL
J-040NOTE3 MIN READ

The cost of an AI agent is mostly not the model

AI agent development cost is driven less by model fees than by integration, evaluation and the work of running the agent safely. How to estimate each part, and how to keep the running cost per task under control.

IN SHORT
  • AI agent development cost has two parts: the one-time cost to build it and the running cost per task. Most teams underestimate the first and mis-measure the second.
  • Building cost is dominated by integration with your systems, evaluation on real cases and the safety work for actions, not by prompt writing or the model.
  • Running cost is model tokens times task volume, plus infrastructure and the people who review and improve the agent. Measure it per completed task, not per call.
  • The cheapest way to control cost is to prove value on a narrow task first, then route routine steps to small models and cache what repeats.

AI agent development cost is one of the first questions a buyer asks, and the usual answers ("it depends", or a single number) do not help. The useful answer is a breakdown: what you pay once to build the agent, what you pay every time it runs, and which of those parts you can control.

01What does AI agent development cost consist of?

Two budgets, which behave very differently.

BudgetWhat it pays forHow it scales
Build costDiscovery, integration with your systems, the agent loop, tools and permissions, evaluation set, deploymentGrows with the number of systems the agent touches and how risky its actions are
Running costModel tokens, infrastructure, tracing and storage, human review, ongoing improvementGrows with task volume and with how much context each task needs

A demo can be built cheaply because it skips most of the build column. That is why demos are a poor guide to what the production agent will cost (see why AI pilots never reach production).

02Where does the build cost actually go?

In our experience of building agents, the effort lands in roughly this order, largest first:

  1. Integration. Connecting to the CRM, ticketing system, database or ERP: authentication, rate limits, data mapping and the edge cases in each API. Every extra system adds real work.
  2. Evaluation. Collecting real cases, defining what a correct outcome is and building the harness that checks it (see how to evaluate AI agents). Without it, nobody can say whether the agent is good enough.
  3. Safety for actions. Classifying each tool by its effect, adding idempotency, approval steps and an audit trail (see every agent tool needs an effect class).
  4. The agent itself. Prompts, the loop, memory and error handling. Usually the smallest of the four.

If a quote for an agent is mostly prompt engineering, the integration and evaluation work has not been priced yet.

03How do you estimate the running cost per task?

Start from one completed task, not one model call. An agent may call the model five or fifteen times to finish one task.

estimate/cost_per_task.py
# Illustrative estimate. Replace every number with your own measurements and current provider prices.
calls_per_task      = 8        # model calls to finish one task, measured from traces
input_tokens_call   = 3_000    # prompt + retrieved context + tool results
output_tokens_call  = 300
price_in_per_m      = P_IN     # your provider's price per million input tokens
price_out_per_m     = P_OUT    # per million output tokens

model_cost = calls_per_task * (input_tokens_call * price_in_per_m + output_tokens_call * price_out_per_m) / 1_000_000
review_cost = share_reviewed_by_a_person * minutes_per_review * cost_per_minute
cost_per_task = model_cost + infra_cost_per_task + review_cost

Then multiply by monthly volume and compare against the current cost of the same task done by hand. That comparison, not the model price, decides whether the agent is worth building.

Two numbers usually surprise people. Input tokens dominate, because every call re-sends the context. And the human review share matters more than the model: an agent that needs a person to check half its work saves far less than one that needs a check on one task in twenty.

04What makes AI agents expensive to run?

  • Too much context per call. Sending whole documents when three passages would do (see context engineering).
  • One frontier model for everything. Routine steps such as classification or extraction rarely need the most capable model (see LLM routing).
  • Retries without limits. A loop that retries failed tool calls indefinitely multiplies cost silently.
  • No tracing. If cost is not recorded per task, nobody notices the slow drift upward (see trace and cost every model call).

05How do you keep AI agent development cost under control?

Spend in the order that reduces risk:

  1. Prove one narrow task first. Pick a task with high volume and an outcome you can check. Build the agent for that task only, measure accuracy and cost per task on real cases, and decide from evidence.
  2. Build the evaluation before scaling. It is what lets you change models and prompts later without paying for regressions.
  3. Then optimize running cost in the order cache, route, batch, trim (see cut LLM cost in the right order).
  4. Own the parts that keep paying off: the evaluation set, the integrations and the traces. They carry over to the next agent, so the second one costs less (see build vs buy AI).

06Where to go next

For how agents work end to end, read how AI agents work. For what we build and how we scope it, see AI agent development.

Have this problem, but no system for it yet?DESCRIBE YOUR SYSTEM →