ReAct Agent Cost-per-Task Calculator

Estimate what a tool-using ReAct agent costs to complete one task.

Ad placeholder (leaderboard)

What does one agent task actually cost?

A single ReAct agent run is not one API call — it is a loop of think, act and observe steps, each one a fresh LLM call that resends the growing conversation history. That is why agentic workloads can cost 10–50× a simple completion. This calculator models the loop honestly so you can budget per task and spot where the cost is hiding.

How it works

The tool simulates the loop step by step. At each step the agent’s prompt includes the system/task prompt plus all prior thoughts and observations, so the input grows every iteration. The model emits a thought/action (your output tokens per step), the tool returns an observation that is appended to the next prompt, and the cycle repeats for the number of steps you specify. Because history accumulates, total input tokens scale roughly quadratically with step count — the single biggest driver of agent cost. A retry budget then inflates the total to reflect backtracking and failed attempts.

Tips to control agent cost

  • Cap the steps. A hard maximum on loop iterations prevents a runaway task from quietly burning your budget.
  • Compress history. Summarise old thoughts and observations instead of resending them verbatim — this directly attacks the quadratic growth.
  • Keep observations lean. Truncate or post-process tool outputs before feeding them back; raw API dumps are expensive to carry forward.
  • Mix models. Use a cheap model for routine reasoning steps and a stronger one only for planning or the final answer.
Ad placeholder (rectangle)