What drives the cost of running an AI agent?
Mostly tokens: the number of model calls a task takes, how much context each call carries, and the price of the model that runs it. Agents loop, so they use far more tokens than a chat — Anthropic measured about four times as many for agents and about fifteen times for multi-agent systems. Measure cost per completed task, then reduce it by caching repeated context, using smaller models for simple steps, trimming what each call sees, and capping how long an agent can loop.
- Published
- 22 October 2026
- Sources checked
- 22 October 2026
- From
- Kramiva
01
Where the tokens go
Each loop of an agent re-sends its instructions, tool definitions and the conversation so far, then adds the new tool result. Context therefore grows with every step, and the cost of each call grows with it. In Anthropic's analysis of its research agents, token usage alone explained 80% of the variance in performance on one benchmark — more spending often bought better answers, which is exactly why it needs a ceiling.
02
Ways to reduce it
- Prompt caching: re-use a fixed prefix (instructions, tool definitions, documents) across calls
- Model routing: send classification and extraction to a smaller model, keep the large one for hard reasoning
- Context trimming: summarise or drop old tool results instead of carrying them forever
- Loop limits: cap steps, time or spend per task, and escalate when the cap is hit
- Fewer agents: one agent with good tools is usually cheaper than several
03
Prompt caching in numbers
On Anthropic's API at the time of review, writing to the cache costs 1.25 times the base input price for the default five-minute lifetime (twice the price for one hour), and reading from it costs 0.1 times the base price on most models. A long, stable system prompt that is read on every step of an agent run is the case caching was built for. Other providers price caching differently; check their current documentation.
04
Trade-offs
Cheaper models and shorter context can lower quality, so every cost change should be run against the evaluation set before it ships. Cost per task is the metric that matters: an agent that costs more per call but finishes in fewer steps can be the cheaper one.
Where Kramiva fits
Kramiva's AI product feature work models cost and latency per user before rollout, so the economics are known before the commitment rather than discovered on the first invoice.
Sources
- How we built our multi-agent research system — Anthropic, 13 June 2025
- Prompt caching — Anthropic (Claude Developer Platform docs)
- Gartner predicts over 40% of agentic AI projects will be canceled by end of 2027 — Gartner, 25 June 2025
Accessed 22 October 2026. Kramiva is not affiliated with these publishers.
Related questions
Tell us what you are building.
A short brief gets you a real reply from a founder within one business day — an honest read on fit, scope, and budget.

