The hardest sell in AI cost consulting is convincing a team that their "cheap" agent is actually expensive. The demo shows one request, one response. The production logs show fifty.

Here's what actually happens when a user submits a support ticket to an AI agent.

What One "Request" Actually Looks Like

Take a customer support agent that can: look up account info, check order history, query a knowledge base, and draft a reply. From the user's perspective: one message in, one answer out. From the token counter's perspective:

Call 1:  system_prompt (2,100t) + user_message (45t) + tool_defs (850t) = 2,995 input → 120 output
Call 2:  system_prompt (2,100t) + history (165t) + tool_defs (850t) + tool_result_lookup (380t) = 3,495 input → 85 output (tool call)
Call 3:  system_prompt (2,100t) + history (250t) + tool_defs (850t) + tool_result_orders (620t) = 3,820 input → 90 output (tool call)
Call 4:  system_prompt (2,100t) + history (340t) + tool_defs (850t) + tool_result_kb (1,200t) = 4,490 input → 95 output (tool call)
Call 5:  system_prompt (2,100t) + history (435t) + tool_defs (850t) + all_results (2,200t) = 5,585 input → 380 output (final response)

Total: 20,385 input tokens + 770 output tokens for one support ticket.

At Claude Sonnet 4.5 pricing ($3.00/M input, $15.00/M output): - Input: 20,385 × $3.00/M = $0.061 - Output: 770 × $15.00/M = $0.012 - Total: $0.073 per ticket

The original estimate was $0.001. The real cost is 73x higher.

The Four Multipliers

1. System Prompt Repetition

Every single LLM call in the agent loop carries the full system prompt. This is unavoidable with stateless APIs — the model has no memory between calls. A 2,000-token system prompt on a 25-iteration agent loop = 50,000 tokens burned before a single token of actual work.

The fix is prompt caching. Anthropic's cache_control lets you pin the system prompt in the KV cache, dropping cache hits to 10% of normal input cost. On a 25-call loop with a 2,000-token system prompt: uncached costs $0.15, cached costs $0.015. That's real money at scale.

2. Tool-Call Response Verbosity

Tool responses are injected back into context in full. A database query that returns a customer record formatted as verbose JSON can easily run 800–1,500 tokens:

{
  "customer": {
    "id": "cust_8472947",
    "created_at": "2024-03-15T14:22:31.000Z",
    "updated_at": "2026-01-08T09:11:04.000Z",
    "email": "customer@example.com",
    "first_name": "Sarah",
    "last_name": "Chen",
    "subscription": {
      "plan": "pro",
      "status": "active",
      "billing_cycle": "monthly",
      "next_billing_date": "2026-08-01T00:00:00.000Z",
      ...
    }
  }
}

The agent doesn't need 90% of this. Strip tool responses to the minimum fields the agent actually uses. A customer lookup that returns {"name": "Sarah Chen", "plan": "pro", "status": "active"} is 50 tokens, not 800.

3. History Growth

Each iteration, the agent carries all previous turns. By iteration 10, the conversation history is 3,000 tokens of context that grows with every call. By iteration 20, it's 6,000+ tokens of accumulating overhead.

Options: (a) summarize history every N iterations, (b) use a sliding window that drops older tool results once the agent has acted on them, (c) store intermediate state externally and pass only relevant summary back in.

4. Loop Overhead Without Termination Logic

Agents without clear termination conditions loop unnecessarily. An agent checking "is this task complete?" with a separate LLM call before terminating adds one full-cost iteration just to say "yes, done." Explicit done-conditions in the tool schema, or structured output with a finished: true flag, eliminate these dead-end iterations.

The Real Cost of a Support Operation

Suppose your support tool handles 50,000 tickets/month. At your naive estimate of $0.001/ticket, you budgeted $50. At the real cost of $0.073/ticket, you owe $3,650. Across 12 months: $43,800 you didn't budget for a single feature.

Multiply that by 3–5 agent features in a mid-size product and you're looking at $150K–$200K in unexpected annual spend.

Chatbot vs. Agent: The Comparison That Matters

Metric Simple Chatbot Basic Agent (4 tools) Complex Agent (10+ tools)
LLM calls per user task 1 3–8 10–50
Avg input tokens per task 1,500 8,000–20,000 40,000–150,000
Cost per task (Sonnet 4.5) $0.005 $0.03–$0.07 $0.15–$0.60
50K tasks/month cost $250 $1,500–$3,500 $7,500–$30,000

These aren't edge cases — they're typical numbers from production systems.

Measuring Your Actual Cost

Before you can fix anything, you need visibility. Add token counting to every LLM call:

from anthropic import Anthropic

client = Anthropic()
total_input_tokens = 0
total_output_tokens = 0

def agent_step(messages, tools):
    global total_input_tokens, total_output_tokens

    response = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=1024,
        messages=messages,
        tools=tools
    )

    total_input_tokens += response.usage.input_tokens
    total_output_tokens += response.usage.output_tokens

    return response

# After agent completes:
input_cost = (total_input_tokens / 1_000_000) * 3.00
output_cost = (total_output_tokens / 1_000_000) * 15.00
print(f"Task cost: ${input_cost + output_cost:.4f}")
print(f"Total tokens: {total_input_tokens + total_output_tokens:,}")

Run this for 100 representative tasks. The number will surprise you. Use it to set a realistic budget per task, then instrument your agent loop to abort if it exceeds 2x that threshold.

What Good Architecture Looks Like

The lowest-hanging fruit, in order of impact:

  1. Cache your system prompt. One line change, 85–90% cost reduction on repeated input tokens.
  2. Trim tool response schemas. Return only what the agent needs, not what's easy to serialize.
  3. Add explicit termination conditions. Don't let the agent decide if it's done via free-form reasoning.
  4. Summarize long histories. After 10 turns, summarize and discard raw history.
  5. Route simple tasks away from agents entirely. An agent that runs to answer "what are your business hours?" is burning 50x the tokens a retrieval lookup would.

The agent paradigm is powerful. It's also the fastest way to generate a $50K surprise invoice if you treat each task as a single cheap call.