How much does an AI agent cost to build and run?
The model bill is rarely the expensive part. Here is what actually drives AI agent cost — to build and to run — and how to estimate whether one pays for itself.
“How much does an AI agent cost?” is the first question almost every client asks, and the honest answer is: less to run than you fear, more to build properly than a demo suggests. AI agent cost splits into two very different bills — the one-time work to build it and the ongoing cost to run it — and mixing them up is how budgets go wrong.
The build cost
The model is a commodity. What you are paying for when you build an agent is everything around it:
- Tools and integrations — the API endpoints or MCP server the agent uses to read and change your systems. This is usually the largest piece, and it depends entirely on how clean your existing APIs are.
- Permissions and safety — scoping every action to the right user or tenant, approval steps for anything risky, step limits.
- Knowledge — if the agent answers from documents, a RAG pipeline: ingestion, chunking, search, citations.
- Logging and evaluation — a record of every run and a test set, so you can tell whether it works.
- Interface — a chat widget, an inbox integration, a Slack bot, or no interface at all if it runs in the background.
A focused agent that does one workflow against systems with decent APIs is a matter of weeks, not months. It gets bigger when the integrations are messy, when there are many user roles, or when “one workflow” quietly becomes five.
The running cost
Running costs are mostly tokens. You can estimate them with simple arithmetic before writing any code:
monthly cost ≈ tasks per month × steps per task × tokens per step × price per token
Each step sends the conversation so far, the tool definitions and any retrieved context, and gets back a response. Agents that take many steps or pull in large documents cost more per task; agents that do one lookup and one answer cost very little. Check your provider’s current price list and plug in real numbers — prices move often, usually downward.
The other running costs are smaller: hosting for the agent service and vector database, monitoring, and someone reviewing the logs and approvals, especially early on.
What makes running costs blow up
- Unbounded loops — an agent that retries forever. Cap steps per run.
- Stuffing everything into context — sending whole documents instead of the relevant chunks.
- Using the biggest model for everything — route simple classification and extraction to a smaller, cheaper model; save the strong one for real reasoning.
- No caching — the same system prompt and tool definitions sent thousands of times. Most providers now support prompt caching; use it.
Maintenance is a real line item
Agents are software. APIs change, documents change, models get deprecated, and new edge cases appear in the logs. Budget for ongoing work — reviewing failures, updating tools and prompts, re-running evaluations. A maintenance retainer is usually the cleanest way to handle this.
Estimating ROI before you build
Before any code, I do this calculation with clients:
- How many times a month does the task happen?
- How many minutes does a person spend on it each time?
- What share of cases could the agent fully handle, and what share would it only prepare for a human?
- What is an hour of that person’s time worth?
Multiply it out and compare against build cost plus a year of running and maintenance. If the payback is under a year on conservative assumptions, it is worth building. If it only works with optimistic ones, it probably is not — or the task needs to be narrower.
Cheaper alternatives to check first
Sometimes the cheapest agent is no agent. If the rules are fully known, a script or a plain integration is cheaper and more reliable. If people mostly need answers from documents, a RAG assistant without actions is a smaller first step.
If you have a workflow in mind, send it over with rough volumes. I will give you a realistic build estimate, a running cost range and an honest view on whether it pays off. For how I approach these projects end to end, see agentic AI for business.
I take on a small number of projects at a time. Tell me what you are building and I will tell you honestly whether I am the right person for it.
Get in touch →
1 comment