← All patterns

ReAct Agent (Tool Loop)

Agent decides tools and actions. Loops and failures compound.

API Calls per Conversation

Low

2

Mid

4

High

10

Best Use Cases

Tool-using assistantsWeb browsing agentsCode execution agentsDynamic research tasks

Cost Drivers

  • Unpredictable loop count (2-10+ iterations)
  • Each tool use = 2 API calls (tool request + tool result)
  • Tool definitions add ~500 tokens per tool per request
  • Failure retries compound context (18% growth per failure)

Monthly Cost Scenarios

100/day

Sonnet 4.5 (3 tools)

$360-1,200/mo

500/day

Sonnet 4.5 (5 tools)

$2,700-9,000/mo

1,000/day

Haiku 4.5 (3 tools)

$1,800-6,000/mo

Optimization Tips

  • Add loop detection — cap iterations at a reasonable maximum
  • Only include tool definitions that are relevant to the current task
  • Use structured error messages to help the agent recover without extra iterations
  • Monitor and log iteration counts to identify runaway conversations

Estimate your react agent (tool loop) costs

Describe your system, get a cost breakdown in 60 seconds. Free, no signup required.

Estimate Your System →