AI agent costs keep climbing even as token prices fall because a single agent task can trigger many model calls: reasoning loops, tool calls, retries and long contexts sent again on every step. The fix is cost engineering, not a cheaper model alone. Measure cost per completed task, attribute spend to each agent and workflow, route easy steps to smaller models, cache stable prompt prefixes, cap loops and budgets, batch work that can wait, and prove every cheaper option with evals before you switch.
Why AI agent costs rise while token prices fall
Budget season has surfaced an awkward pattern: per-token prices go down, yet the monthly AI invoice goes up.
Elastic's analysis, Why your AI bill tripled while token prices fell 75% (September 4, 2026), says the blended price per token has dropped roughly 75% over the past year, and that agentic workflows commonly run 5 to 30 times the tokens of a comparable chatbot task. Gartner made a similar forecast in August: as reported by The Register, it expects the cost of agentic AI workflows to increase more than fivefold by the end of 2028, even as foundation models become cheaper.
The mechanics are simple once you trace one task. A support agent that resolves a refund might:
- Plan the task with a reasoning model.
- Call three tools (CRM lookup, order history, policy search), each followed by another model call to read the result.
- Retry once when a tool times out.
- Re-send the system prompt, tool definitions and history on every call.
That is one conversation to the user and a dozen billable requests to you.
Next question: What will an agent cost per month at your call volume?
Measure cost per completed task, not cost per token
Tokens are an input. The number the business cares about is what it costs to finish one unit of work correctly: a resolved ticket, a reviewed contract, a qualified lead. IBM's guidance on AI agent token spend makes the same point, recommending teams evaluate models on total cost per successful task rather than price per token alone.
To get there, log a few fields on every agent run. Elastic suggests tokens in, tokens out, model used, retry count and task completion. Add two more of your own: the workflow name and whether a human had to step in. With those seven fields you can compute:
- Cost per completed task: total model and tool spend for a workflow divided by tasks that finished without human rescue.
- Calls per task: the average and the worst 10%. The tail is usually where loops and retries hide.
- Context share: how much of each request is repeated prefix versus new information.
Then compare the cheapest and most expensive runs of the same workflow; the gap usually points at one step, a bloated prompt or a flaky tool. Our AI production cost audit walks through the same breakdown if you want a structured starting point.
Next question: Where is your production AI spend actually going?
Attribute every dollar to an agent, a workflow and an owner
A provider invoice tells you almost nothing. IBM recommends tracking usage by agent, workflow, model and business unit; without that, finance can only make blunt cuts.
The practical way to get attribution is to send every model call through one gateway or shared client library that tags requests with metadata before they leave your network:
- Tag at the source. Agent ID, workflow, environment (dev, staging, prod), team and a trace ID for the task.
- Store usage with the tags. Input, output and cached tokens per request, joined to the task outcome.
- Report weekly by owner. Each team sees its own agents, cost per completed task and the trend.
- Separate dev from prod. Eval runs, prompt experiments and load tests are real spend, and they often surprise people.
Next question: What is an LLM gateway and why route model calls through one?
The cost levers that actually move the bill
Once you can see spend per task, these are the levers worth pulling. None of them is free: each carries a quality or reliability risk, so each needs a test before it ships. The discounts below are the ones the providers state in their own documentation; your savings depend on your traffic.
Prompt caching, by the provider docs
Agents repeat the same prefix constantly, which makes caching one of the highest-yield changes. Anthropic's prompt caching docs state that cache read tokens are 0.1 times the base input price (lower for some newer models), while cache writes with the default 5-minute lifetime cost 1.25 times base input. OpenAI's prompt caching guide says caching is enabled by default for supported models and that reused tokens are discounted up to 95%. Both depend on an exact prefix match, so put stable instructions and tool definitions first and dynamic details like timestamps last.
Batch work that can wait
Nightly document classification, backfills and eval runs rarely need an answer in seconds. Anthropic's Message Batches API is documented as reducing costs by 50 percent, with most batches finishing in less than an hour. OpenAI's Batch API lists a 50% discount compared to synchronous APIs, with each batch completing within 24 hours.
Next question: How do you build retrieval so agents stop stuffing whole documents into context?
Put hard limits on loops, tool calls and budgets
Agents fail expensively. A tool error the model does not understand can trigger a loop that repeats until something stops it. That should be your code, not the invoice.
A minimum set of guardrails for every production agent:
- Max iterations per task. Set it from the 95th percentile of successful runs, plus a margin.
- Max tool calls per task and per tool. Stop and escalate when a tool fails twice in a row.
- Per-task token budget. The agent stops and hands off to a human when it is exceeded.
- Per-agent daily budget. IBM recommends spending limits for individual agents or workflows, alerts as usage approaches a threshold, and runtime controls that can pause an agent.
- Retry rules. Exponential backoff and a hard cap, with retries counted in cost per task.
- Kill switch. One flag per agent that an on-call engineer can flip without a deploy.
Next question: How do you test an agent's failure paths before they reach production?
Test cheaper models with evals before you swap
The fastest way to cut AI agent costs is also the riskiest: replace the expensive model with a cheaper one everywhere. Sometimes it works. Often it quietly lowers completion rates, which raises cost per completed task.
Make the swap an experiment:
- Build an eval set per workflow step from real production traces, including the hard and ugly cases.
- Define pass criteria the business agrees with: correct answer, correct tool choice, valid output format.
- Run the current and candidate models on the same set and compare pass rate and cost per passed case.
- Ship to a slice of traffic and watch completion and escalation rates for a week.
- Keep the eval set in CI so every prompt or model change is checked again.
Next question: How do you measure whether an agent's outputs are actually correct?
Give agent spend an owner before 2027 budgets lock
Most runaway AI bills share a root cause: nobody owns cost per completed task. Platform owns the gateway, product owns the agents, finance owns the invoice.
A simple ownership model that works for year-end planning:
- Each production agent has a named engineering owner and a monthly budget.
- Each owner reviews cost per completed task, calls per task and the worst runs every week.
- A platform owner maintains the gateway, tagging, caching defaults and guardrail libraries.
- Any new agent ships with its guardrails, eval set and budget, or it does not ship.
When you build the 2027 plan, budget for the engineering work too, not only tokens. Instrumentation, evals and routing take senior time, and that time is usually what turns a rising line into a flat one. Our AI development cost guide breaks down both sides, and the LLM cost calculator helps you model token spend by volume.
Next question: What does it cost to build and run a production AI system?
How Ryz can help
Ryz AI pod teams are senior engineers who work on your team, in your cloud and repos, to build and operate agents, including the cost controls above: gateways and tagging, routing, caching, retrieval, guardrails and eval suites. Pods have shipped production systems such as an AI driver-support agent that covers about 218,000 driver calls a year in three languages. See how we approach AI agent development, or hire senior AI agent developers at $10,000 to $15,000 per engineer per month. Most of our engineers ship code in their first week.
FAQ
Why are AI agent costs higher than chatbot costs?
Agents make many model calls per task: planning, tool calls, reading tool results, retries and checks, often re-sending long context each time. Elastic's analysis says agentic workflows commonly run 5 to 30 times the tokens of a comparable chatbot task.
What is the single best metric for agent spend?
Cost per completed task: total model and tool spend for a workflow divided by tasks finished correctly without human rescue. It captures price, call volume, retries and quality in one number.
Does prompt caching reduce quality?
No. Caching reuses the processing of an identical prompt prefix; the model sees the same input. The main risk is a low hit rate if prompts change at the top, so keep stable content first and dynamic content last.
Should we switch every agent to the cheapest model?
Not without evals. Route by step: use smaller models where your eval set shows they match, and keep stronger models for planning and hard reasoning. Judge every change on cost per completed task, not price per token.

