AI agent costs: how to estimate and control your spend
July 2026 · 9 min read
AI agent costs have three components: model inference, tool calls, and human time at gates. Here's how to estimate each and the levers that bring spend down.
AI agent cost: estimate and control your spend
"How much will this cost?" is one of the first questions teams ask when evaluating AI agents — and one of the hardest to find a straight answer to. The honest answer is: it depends, but it's usually far less than people expect, and far more controllable than people assume.
AI agent costs are not a fixed subscription. They are a function of what your agents do, how often they run, and which models you use. All three are design decisions.
Quick answer
AI agent costs have three components: model inference (token volume × model price per token), tool calls (API costs from the services your agents connect to), and human time at approval gates. The biggest single lever is model selection — using a fast, cheap model for routine steps and a capable model only where judgement is needed can reduce inference costs by 80–90% without reducing output quality. Most well-designed agents cost pennies per run.
What drives AI agent costs
Three factors determine what an agent run costs.
Token volume. Every call to a language model has an input cost (what you send) and an output cost (what it returns). Input tokens include the system prompt, retrieved context, tool outputs, and conversation history. Output tokens are the model's response. Both accumulate quickly if prompts are verbose or context windows are padded with unnecessary information.
Model price. There is a 100× price difference between the cheapest capable models and the most powerful frontier models. Frontier models are priced for tasks that genuinely require them — complex reasoning, ambiguous judgment calls, high-stakes decisions. Routing simpler steps to cheaper models is the highest-leverage cost reduction available.
Tool call frequency. Every time an agent calls an external API — reading a CRM record, querying a database, writing to a spreadsheet — it may incur an API cost. Most tools are free at low volume; costs appear when run frequency is high or when an agent makes more calls than necessary.
Model costs: the range from cheap to capable
The market now has distinct tiers:
- Fast and cheap — models like Claude Haiku or GPT-4o Mini cost under $1 per million tokens. Fast, capable for structured tasks, classification, summarisation, and routing.
- Mid-tier — models like Claude Sonnet or GPT-4o sit at $3–15 per million tokens. Good balance of capability and cost for most production agent steps.
- Frontier — models like Claude Opus or o3 cost $15–75+ per million tokens. Reserved for tasks requiring deep reasoning or high-stakes judgment.
A common mistake is using a frontier model for every step because "it's the best." Most agent steps don't need it. A step that formats data, classifies an input, or drafts a routine summary performs identically on a cheap model and a frontier model — at 50× the cost difference.
The right question for each agent step is: what is the minimum model capability this step requires? Design to that, not to the ceiling.
Tool costs: API calls and third-party services
Tool costs are often overlooked in initial estimates because individual calls are cheap. They compound at scale.
Common tool costs:
- CRM reads/writes — usually free within plan limits; costs appear at high volume
- Web search — typically $0.002–$0.005 per search
- External data APIs — varies; some charge per call, others per seat
- Storage writes — negligible for most agents
The place to watch is tool call frequency per run. An agent that reads a customer record once is cheap. An agent that iterates — searching, reading, retrying — can make 20 calls where 3 were needed. Poorly scoped tools lead to over-calling. A well-defined tool list with clear input and output contracts keeps calls tight.
Human gate costs: the hidden component
Approval gates — where a human reviews an agent's output before the next step proceeds — have a cost that rarely appears in infrastructure estimates: analyst time.
If a finance agent runs weekly and a senior analyst spends 15 minutes reviewing each output, that's 13 hours per year. At typical analyst rates, that exceeds the model inference cost by an order of magnitude. It's not a reason to remove gates — gates catch errors that would cost far more to fix downstream — but it is a reason to design them deliberately.
Well-designed gates are targeted: they sit at decision points where human judgment adds value, not at every step as a default. An agent that requires approval for every action is not an agent — it's a form with extra steps.
The cost of a gate is proportional to the frequency of the run and the complexity of the review. Monthly runs with a 5-minute review are negligible. Daily runs with a 30-minute review are a significant staffing decision.
The cost of getting it wrong
Error costs are the most underestimated component of agent spend — and they're usually larger than inference costs.
When an agent produces bad output, the cost isn't just the tokens that generated it. It's the downstream work: a human catching the error, correcting it, re-running the step, reviewing again. If the error propagates before it's caught — a bad summary fed to the next agent, a wrong CRM update sent to a downstream workflow — the correction cost multiplies.
Three failure modes drive most error costs:
Hallucination on structured data. Agents given vague tool access or insufficient context sometimes generate plausible-looking but incorrect values. Caught at a gate: one correction cycle. Missed at a gate: downstream data corruption.
Retry loops. An agent that hits a tool error and retries blindly can make dozens of API calls before failing. Retry logic without backoff or exit conditions is a cost multiplier.
Scope creep. An agent with access to more tools than it needs will occasionally use the wrong one. A data-read step that can also write is a liability.
A well-designed agent spec — clear role, explicit tool permissions, defined failure modes — eliminates most of these. The spec is the cost control document as much as it is the design document.
How to reduce costs without reducing quality
Route by task complexity. Use cheap models for classification, formatting, and structured extraction. Reserve capable models for judgment, synthesis, and anything customer-facing. Model routing — assigning different models to different steps based on what each step requires — is the single highest-leverage cost reduction for multi-step agents.
Cache repeated context. If every run of an agent loads the same knowledge base or product documentation into context, that's redundant token spend. Cache the stable context and retrieve only what changes per run.
Tighten prompts. Verbose system prompts that explain context the model doesn't need for this specific step inflate input tokens on every call. Audit prompt length regularly.
Scope tool access strictly. An agent with five tools will try to use all five. An agent with two tools that match its actual task will be cheaper and more reliable. Narrow tool access reduces both cost and error rate.
Batch where possible. Sequential agents that wait for each other add latency and compound per-step costs. Where tasks are independent, parallel execution reduces wall-clock time and often reduces total cost by eliminating repeated context loads.
A worked estimate: finance report agent
A useful way to make this concrete. Consider a finance report agent that runs weekly, pulls variance data from a spreadsheet and an accounting API, and produces a commentary for analyst review.
Inputs and outputs:
- 3 tool calls (spreadsheet read, accounting API read, output write)
- ~6,000 input tokens per run (system prompt + retrieved data)
- ~1,200 output tokens per run (commentary)
Model choice:
- Data retrieval and formatting step: Claude Haiku (~$0.25/M input, $1.25/M output)
- Commentary generation step: Claude Sonnet (~$3/M input, $15/M output)
Per-run cost:
- Haiku step: (3,000 × $0.25 + 500 × $1.25) / 1,000,000 ≈ $0.002
- Sonnet step: (3,000 × $3 + 700 × $15) / 1,000,000 ≈ $0.020
- Tool calls: negligible at this volume
- Total per run: ~$0.022
Monthly (4 runs): ~$0.09
Human gate: 10-minute analyst review per run × 4 runs = 40 minutes per month. That's the real cost line.
The point of the exercise is not the specific numbers — model prices move. It's the structure: inference is cheap, tool calls are manageable, and human time at gates is usually the dominant cost. Design around that.
Where Envelope fits
When you design an agent in Envelope, the spec defines each agent's model, tool access, and gate placement before you build anything. That means cost decisions are made at the design stage — not discovered after the first production invoice.
Explicit tool lists prevent over-calling. Defined gate placement lets you size the human review time upfront. And because the spec is versioned and portable, you can iterate on model assignments without rebuilding the agent from scratch.
→ Model routing: how to assign the right model to every agent step → One AI agent vs many: when to split and when to keep it simple → Parallel vs sequential agents: how to structure multi-agent workflows → How to design AI agents: a practical guide
Frequently asked questions
How much does an AI agent cost to run?
Most well-designed agents cost between $0.01 and $0.50 per run depending on model choice, step count, and tool call frequency. A simple single-step agent using a cheap model costs fractions of a cent. A complex multi-step agent using frontier models for every step can cost several dollars per run. The range is wide — which is why estimating by component (inference, tools, gates) is more reliable than benchmarking against a single number.
What is the biggest cost driver for AI agents?
Model selection. There is a 100× price difference between the cheapest capable models and frontier models. Using a frontier model for every step — regardless of what the step actually requires — is the fastest way to inflate inference costs. Model routing, which assigns cheap models to routine steps and capable models to judgment-heavy steps, typically reduces inference costs by 60–90%.
Do tool calls cost money?
Sometimes, but usually not at low volume. Most SaaS APIs include generous free tiers — CRM reads, spreadsheet writes, and internal database calls are typically free within normal usage. Costs appear when agents make more calls than necessary (retry loops, over-broad tool access) or when run frequency is high enough to hit commercial API limits. The design fix is explicit tool scoping: each agent should have access only to the tools its role actually requires.
How do I estimate AI agent costs before building?
Walk through each step: how many tokens will the input be (system prompt + context + tool outputs)? How many tokens will the output be? Which model is appropriate for this step? How many times will this agent run per month? Multiply out and sum across steps. Add a 30% buffer for retries and edge cases. The finance report example above shows the structure — the specific numbers change as model prices move, but the method stays the same.
Are human approval gates expensive?
They can be, and they're often the largest cost component for agents running frequently. A weekly agent with a 15-minute review adds 13 hours of analyst time per year. That's not a reason to remove gates — errors caught at a gate are far cheaper than errors that propagate — but it is a reason to design gates deliberately. Gates should sit at genuine decision points, not at every step as a default. Well-scoped agents need fewer gates.
How do I know if my agent is costing more than it should?
Compare actual costs against your initial estimate by component: inference, tool calls, and gate time. A cost that's higher than estimated usually means one of three things — token volume is higher than expected (verbose prompts or large context windows), tool call frequency is higher than expected (retry loops or over-broad access), or run frequency is higher than planned. Structured traces that log token usage and tool calls per run make this diagnosis fast.