S1 · E11 · Intermediate · Season 1: AI Agents & Tools

Why do AI agents cost more than a chat?

Explained with Pizza

AI models are billed per token, for the text that goes in and the text that comes out. An agent works in a loop, and each step sends the conversation so far back to the model, so input tokens add up much faster than in a single chat answer.

In short

  • You pay per token: input (what you send) and output (what the model writes), with a price per 1 million tokens.
  • Every step of an agent loop sends the whole conversation again, so input tokens grow step by step.
  • Example at Claude Sonnet 5.5 API prices: 1 chat answer is about 1 cent, a 20-step agent run about $1.40 (an illustration, not a measurement).
  • Pay less with prompt caching, a smaller model for simple steps, and the Batch API for jobs that can wait.

You pay per token, in and out

A token is a small piece of text, often part of a word. AI APIs count tokens and charge a price per 1 million tokens (MTok). There are two prices: one for input tokens, the text you send, and one for output tokens, the text the model writes. Output is usually several times more expensive.

A plain chat is one round: your question goes in, an answer comes out, and you pay for both once.

Why the agent loop multiplies the bill

An agent works in a loop: plan, act with a tool, read the result, decide the next step. To decide, the model needs to see everything so far. So each step sends the whole conversation again: your task, earlier steps, tool results, file contents.

That means the input grows with every step, and you pay for it again each time. Twenty steps is not twenty small questions. It is twenty ever-longer questions.

A worked example

Prices: Claude Sonnet 5.5 costs $2 per 1M input tokens and $10 per 1M output tokens on the Claude API. The numbers below are an illustration, not a measurement of a real run.

  • 1 chat answer: 2,000 tokens in ($0.004) + 500 tokens out ($0.005) = about 1 cent.
  • A 20-step agent run: 600,000 tokens in ($1.20) + 20,000 tokens out ($0.20) = about $1.40.
  • Most of the agent's cost is input: the same context read again and again.

Real API prices (per 1M tokens, input / output, checked Nov 23, 2026)

Prices change often and some depend on prompt length. Check the provider's pricing page before you plan a budget.

  • Claude Sonnet 5.5: $2 / $10 (Anthropic)
  • GPT-6.2 Sol: $2 / $10 (OpenAI, standard rate)
  • Gemini 3.1 Pro Preview, prompts up to 200K tokens: $2 / $12 (Google)
  • Claude Haiku 5.5, prompts up to 100K tokens: $0.10 / $0.50 (Anthropic)

3 ways to pay less

  • Prompt caching: context that repeats (instructions, files) is stored and read back cheaply. On the Claude API a cache hit costs 0.1x the base input price on most models, and 0.05x on Claude Opus 5.5 and Sonnet 5.5. Writing to the cache costs a bit more than normal input.
  • A smaller model for simple steps: Claude Haiku 5.5 costs a fraction of a large model, so use it where it is good enough.
  • Batch API: for jobs that can wait, the Claude API gives 50% off both input and output tokens.

Tip for Claude Code users

Type /usage to see your current session's token usage. In a long session, use /compact to summarize the history, or /clear to start fresh when you switch to unrelated work. Stale context costs tokens on every message.

On a Pro, Max or Ultra plan, usage is part of your subscription, so the session cost figure is mainly useful for API users.

Test yourself

5 quick questions. Pick an answer to check it.

1. What are you billed for when you use an AI model through an API?
2. Why does an agent cost more than a single chat answer?
3. At $2 in / $10 out per 1M tokens, about how much is 600,000 tokens in and 20,000 out?
4. Which option gives 50% off input and output on the Claude API?
5. In Claude Code, which command shows your session's token usage?

Sources

Checked November 23, 2026.