Key takeaways
Optimise the cost of a correctly completed task, not simply the price of a model call.
Replace predictable decisions with application logic and reserve model reasoning for genuine uncertainty.
Reduce sequential dependencies, repeated context and unnecessary tool calls before purchasing faster infrastructure.
Set task-level spending, time and retry limits without removing security, validation or approval controls.
Measure tail latency, quality and human workload together; a fast acknowledgement is not a completed task.
The hidden expense behind a successful AI demonstration
Imagine an online retailer introducing an AI agent to resolve customer enquiries. During the demonstration, it answers a delivery question, checks the order system and explains the returns policy. The experience looks impressive. Then thousands of customers begin using it, and the finance team notices a growing AI bill while customers complain that straightforward requests take too long.
The underlying model may not be the problem. The agent might be interpreting each question several times, searching for policies that it does not need, repeatedly sending the entire conversation to the model or retrying a slow inventory service. The business is paying for every unnecessary detour.
AI agent cost and latency optimisation is about designing a system that completes the right work within an acceptable time and budget. It requires understanding the whole execution journey, from the initial request to a verified business outcome, rather than concentrating on model selection alone.
An agent that can do more is not necessarily more valuable. An agent that knows when it has done enough is often a better business proposition.
Where the time and money actually go
A conventional chatbot may answer a question using one model request. An agent can make a series of decisions, call business applications, inspect their results and decide what to do next. Each cycle consumes resources, and subsequent cycles may carry increasingly large amounts of context.
Model processing is only one component of the bill. Other costs include external search or tool services, document retrieval, storage, execution infrastructure, monitoring, unsuccessful attempts and human intervention. A low-priced model can still support an expensive workflow if it needs repeated attempts to complete a task.
Latency is the time a user or downstream process spends waiting. In a sequential execution path, model calls, tool requests and retry delays accumulate. When independent operations execute concurrently, elapsed time is driven by the slower branch plus coordination overhead rather than the sum of their individual durations.
Start by tracing a complete task. Separate queue time, model inference, tool execution, orchestration, validation and approval waiting time. If the agent spends most of its time waiting for a legacy order database, switching to a faster model may make little difference.
Stop asking AI to make decisions you already understand
Consider three requests: checking the delivery status of an order, investigating a missing parcel and authorising a refund. They do not require the same degree of reasoning. Once a customer and order have been authenticated, an ordinary application can look up the current delivery status and display it using a template.
A missing parcel may require the agent to inspect shipment events and choose between approved diagnostic tools. A refund requires the applicable policy, the relevant facts and any necessary authorisation. The model can assist with interpretation, but the transaction must remain subject to enforced business rules.
Design predictable portions of the process as deterministic workflows: explicit steps executed by software. Introduce agent-directed decisions only where the next step genuinely depends on information that is not known in advance. Anthropic's engineering guidance describes this distinction between predefined workflows and dynamically directed agents, and recommends choosing the simplest adequate design.[1]
The same principle applies to multi-agent architectures. A planner, researcher, reviewer and coordinator may be appropriate for a complicated research assignment. For routine invoice classification, passing a document between four agents can introduce hand-off errors, duplicate context and extra waiting without producing a better result.
Six practical changes that make agents more efficient
1. Reduce the number of model calls. Combine compatible decisions when all necessary evidence is available, and move arithmetic, schema checks and exact record lookups into application code. Do not combine steps that depend on missing evidence or require independent approval.
2. Match model capability to the step. Use a smaller, approved model for a narrow task only after it has demonstrated sufficient quality. Reserve more capable models or higher reasoning budgets for difficult exceptions. Evaluate the complete path, including the cost and delay of escalation.
3. Control context growth. Retrieve relevant records, keep compact task state and provide only the tool definitions necessary for the current stage. Preserve original evidence and authoritative transaction identifiers outside the model context. Summaries may omit critical details, so they should not replace source records in consequential decisions.
4. Reuse stable inputs where supported. Prompt caching can reduce repeated processing of unchanged prompt prefixes under eligible provider configurations. Arrange stable instructions separately from changing task data and measure actual cache hits. A prompt cache is not an answer cache: permissions, data freshness and tenant isolation still matter.[2][3]
5. Overlap independent work. After authenticating a customer and identifying the order, a shipment lookup and a read-only returns-policy lookup may run together. Avoid parallel execution when one call depends on the other's result, or when concurrent writes can conflict. Limit concurrency to protect downstream systems.
6. Choose an appropriate interaction pattern. Stream validated responses or provide truthful progress updates for interactive work. For lengthy reconciliation or document-review tasks, a durable background queue may be more suitable. It improves responsiveness but does not necessarily reduce the actual work or its cost.
A simple financial model for agent performance
The cost per model invocation is useful for engineering analysis, but the finance and operations teams need a measure that connects spending to useful work. Calculate cost per accepted task by dividing all attributable execution costs for a workload by the number of tasks completed to the agreed standard. Include failed attempts, retries and necessary review in the numerator.
Suppose an enterprise processes 10,000 comparable support tasks. In the original design, total attributable delivery costs are £2,400 and 9,000 tasks are accepted. A redesigned workflow costs £1,500 and produces 9,200 accepted tasks under the same acceptance criteria. These are assumed figures for demonstrating the calculation, not provider prices or measured customer results.
The original cost per accepted task is approximately £0.267; the redesigned cost is approximately £0.163. That represents a reduction of about 38.9% in cost per accepted task. The acceptance rate also increases from 90% to 92%. Neither figure should be expected from a real deployment without evidence.
Include human handling and rework in the comparison. If an agent reduces its own bill by transferring difficult tasks to an already stretched service team, the apparent saving may simply be an additional expense elsewhere.
For an investment decision, separately estimate one-off redesign and integration costs, ongoing maintenance, evaluation and infrastructure overhead. Compare those costs with the measured recurring benefit at the expected workload volume.
Why average response time can be misleading
An average of five seconds does not tell you how long customers with complex requests wait. A service can respond rapidly to routine enquiries while a smaller group experiences frustrating delays. Measure median latency (P50) and the 95th percentile (P95) for comparable tasks. P95 is the duration within which approximately 95% of measured observations fall.
Track time to first visible response as an experience metric, and total time to a validated result as an outcome metric. Record timeouts, abandoned tasks and incomplete executions separately so that excluding failed work does not make the service look artificially fast. For approval-based processes, distinguish active processing time from the full elapsed time including human waiting.
Set service objectives by workload. A simple account lookup may require an interactive response, whereas an overnight data-quality investigation can tolerate more processing time. Load-test the agent with realistic concurrency, rate limits and variable tool response times. The fastest design in an isolated test may become unstable when many users arrive simultaneously.
Give every agent a stopping rule and a recovery plan
Autonomy without execution limits can turn a minor problem into a prolonged and costly loop. An agent may keep searching for missing information, retry an unavailable service or ask another agent to reconsider the same result. Define a maximum number of steps, tool-call allowances, token or compute limits, an elapsed-time deadline and a monetary budget appropriate to each task.
Enforce limits in the orchestration layer rather than relying on the model to remember them. Reserve sufficient capacity for essential validation and use conservative estimates before starting new work. Reconcile against actual recorded usage; a provider request already in progress may still incur charges after a local deadline.
Retry temporary failures only when doing so is safe and useful. Cap retries, use increasing delays with randomness where appropriate, and avoid retries at several layers of the same call chain. AWS guidance explains how these techniques help prevent failures from amplifying system load.[4]
A timed-out payment or refund request is particularly sensitive because the original action may have succeeded. Use durable transaction identifiers, idempotency controls and reconciliation before retrying a write. If the agent cannot finish within its limits, preserve its progress and route the exception to an approved human or alternative process. Never remove an approval or security check just to meet a latency target.
Build a performance dashboard around completed work
An agent trace connects the model requests and tool operations that belong to one business task. Record a task identifier, execution path, model and workflow versions, token usage where reported, tool durations, errors, escalation reasons and final outcome. Keep sensitive input and tool-result content out of routine telemetry unless a justified and protected logging arrangement exists.
Track accepted-task rate, cost per accepted task, critical errors, median and P95 completion time, calls per task, repeat-call frequency and human intervention. Break these measures down by task type, complexity and relevant customer groups. Compare quality alongside cost and latency to prevent a cheaper configuration from concealing unacceptable errors.
Establish a baseline and replay representative cases against proposed changes, including difficult requests and failures. A shadow evaluation must not perform duplicate external actions or bypass access restrictions. Introduce changes gradually, monitor for deterioration and retain a tested rollback path.
Assign responsibility for business acceptance criteria to the process owner, execution reliability to engineering and spending visibility to the teams accountable for technology costs. The agent's operating economics should remain visible after the initial deployment, not only during a pilot.
The best optimisation may be a simpler process
If your organisation is struggling with an expensive or slow AI agent, begin by mapping the work it performs. Identify redundant decisions, unreliable tools, growing context and loops that do not make meaningful progress. Then determine which activities need model reasoning and which can be handled more reliably by ordinary software.
Where an agent already delivers measurable value, use a focused architecture and performance assessment to identify improvements without weakening governance. Where the process is predictable, conventional automation may deliver a more dependable outcome at a lower operating cost.
The objective is not to build the fastest or cheapest agent in isolation. It is to build the most appropriate system for the business task, with a clear understanding of how much a successful outcome costs and how long it takes. For organisations evaluating agentic AI at scale, those are the economics worth discussing before expanding deployment.
References and further reading
[1] Anthropic (2024). Building effective agents. Engineering guidance on workflow patterns, agent autonomy and architectural trade-offs. Source: https://www.anthropic.com/research/building-effective-agents
[2] OpenAI. Latency optimization. API documentation covering request-level performance and engineering techniques. Source: https://developers.openai.com/api/docs/guides/latency-optimization
[3] OpenAI. Prompt caching. API documentation on supported caching behaviour and usage. Source: https://developers.openai.com/api/docs/guides/prompt-caching
[4] Brooker, M. (2019). Timeouts, retries, and backoff with jitter. Amazon Builders' Library. Source: https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/
Apply the approach
Consider a hypothetical support operation processing 10,000 comparable tasks per period. The original workflow incurs £2,400 in attributable delivery costs and completes 9,000 accepted tasks; a redesigned workflow incurs £1,500 and completes 9,200. All figures are assumptions for explaining unit economics, not observed business results. Both designs use the same acceptance criteria and cost scope.
£2,400 divided by 9,000 accepted tasks.
£1,500 divided by 9,200 accepted tasks.
Relative reduction using unrounded unit costs; the assumed acceptance rate also rises from 90% to 92%.
Put the approach into practice
- 01Define task acceptance criteria, service objectives and risk constraints for the workload.
- 02Instrument end-to-end traces and quantify model, tool, retry, infrastructure and review costs.
- 03Remove redundant model calls, bound context growth and streamline the longest dependency paths.
- 04Enforce per-task budgets, safe retry policies, controlled concurrency and approval requirements.
- 05Evaluate quality and cost on representative cases and expand the optimised workflow only when its net benefit is demonstrated.
Frequently asked questions
Why is an AI agent more expensive than a chatbot?
An agent may repeatedly invoke models, retrieve information, run tools and evaluate intermediate results. Each step can add cost. A chatbot can also use multiple calls, so the actual cost difference depends on the implementation and workload.
Does using a smaller model always make an AI agent cheaper?
No. If a smaller model makes more errors, consumes additional attempts or causes frequent human escalation, the overall cost may increase. Evaluate the complete task at an equivalent acceptance standard.
Can AI agents run tools in parallel to reduce latency?
Yes, when operations are genuinely independent and authorised. Limit concurrency, preserve dependencies and avoid conflicting writes. Concurrent operations can shorten elapsed time without necessarily reducing spending.
What happens when an AI agent reaches its spending or time limit?
The orchestration layer should prevent new unauthorised work, record the current state and return a controlled outcome or transfer the task to an approved exception process. In-flight work may still incur costs, and any external actions must be reconciled.
How do I calculate the return on an agent optimisation project?
Measure the change in cost per accepted task, throughput, service quality and human workload against a comparable baseline. Estimate recurring net benefits and compare them with implementation, maintenance and evaluation costs. Avoid counting the same productivity benefit twice.