AI Cost Save
AICostSave

The Hidden Costs of AI Agents: Retries, Loops, and Tool Calls

Agents multiply cost through retries, tool chains, and non-converging loops. Learn to measure and cap the runaway parts.

The problem

An agent that calls a model five times per user message bills five times the tokens—before you add retries when tools fail.

Where agent cost hides

A single user action in an agent can trigger:

  • Multiple model calls (plan → act → observe → refine)
  • Tool calls that return verbose results
  • Retries when a tool fails or times out
  • Loops that never reach a stopping condition

Each step adds billed tokens on top of the previous ones.

The retry trap

A tool fails 5% of the time. You retry up to 3 times. Suddenly call volume is higher than it looks, and so is cost—even when average tokens per call stay flat.

Non-converging loops

If an agent has no clear "done" signal, it keeps refining. The loop's cost is unbounded until something stops it.

How to cap the runaway parts

  • Retry caps: limit attempts per tool
  • Depth caps: limit how many reasoning turns are allowed
  • Convergence rule: stop when the goal is met, not when it "feels" done
  • Per-agent budgets: hard stop at a spend threshold

Quick checklist

  • Count calls per user action, not just tokens
  • Cap retries and loop depth
  • Set per-agent budgets and alerts

Related reading