What agents cost to run: tokens, caching, batching
Why agents use more tokens than chatbots, a worked cost example for a support agent, and how caching, batching and model choice cut the bill.
Updated 2026-11-19. "(source N)" refers to the numbered list at the end.
You pay for tokens, many times over
Models are billed per token, a small chunk of text. On Anthropic's current tokenizer, a million tokens is about 555,000 words (source 10). There are separate prices for input you send and output you get back. Output is usually about five times dearer. Claude Sonnet 5.5, for example, costs $2 per million input tokens and $10 per million output (source 1).
Agents cost more than chatbots because they loop. Every step resends the instructions, the tool definitions and the conversation so far. Anthropic warns builders that agents trade higher cost and latency for better results, so the trade must be worth it (source 8).
Hidden extras
Watch for costs that do not show up in the headline price.
- Tool definitions count as input. Simply enabling tools on Claude's current models adds 286 tokens of system prompt per request, before your own tool descriptions (source 1).
- Web search on Claude costs $10 per 1,000 searches on top of tokens, and the results count as input (source 1).
- Some prices rise with prompt size. Claude Haiku 5.5 charges five times more per token once a prompt passes 100,000 tokens (source 1).
- Prices change. Google's Gemini 4 Carbon and Argon double on 1 December 2026 (source 7).
A worked example
Picture a support agent on Claude Sonnet 5.5. Each ticket takes 10 model calls. Every call sends a fixed 20,000 tokens of instructions, policy and tool definitions, plus about 5,000 tokens of conversation and tool results, and gets 600 tokens back. Prices are from Anthropic's pricing page (source 1).
Without caching, input is 250,000 tokens, which costs $0.50, and output is 6,000 tokens, which costs $0.06. That is about $0.56 a ticket, or $560 for 1,000 tickets a month.
Now add prompt caching for the fixed 20,000 tokens. The first call writes the cache at $2.50 per million, which costs $0.05. The next nine calls read it at $0.10 per million, which costs about $0.02. The changing 50,000 tokens still cost $0.10, and output is still $0.06. That comes to about $0.23 a ticket, or $230 a month, roughly 60% less.
Swap in Claude Haiku 5.5 for the same job and, at its base rate of $0.10 in and $0.50 out, the ticket costs under 3 cents before caching (source 1). Model choice is often the biggest lever of all, if quality holds.
How prompt caching works
Caching stores the start of a prompt so later requests can reuse it cheaply. It only works when the cached part is exactly the same each time, so put fixed content first and changing content last (source 2, source 5).
- Claude: a 5-minute cache costs 1.25 times the input price to write and is refreshed free each time it is read. A 1-hour cache costs 2 times to write. Reads cost a small fraction of the input price: 5% on Opus 5.5 and Sonnet 5.5, 10% on most others. Prompts under 512 tokens on current models are not cached (source 2, source 1).
- OpenAI: caching is on by default for supported models. On GPT-5.6 and later, the minimum is 1,024 tokens, reads cost 0.1 times the input price, and writes cost 1.25 times for the default 30-minute life or 2.5 times for 12 hours (source 5).
- Gemini: caching is implicit, and cached input on Gemini 4 models costs about 5% of the normal input price (source 7).
Easy ways to break the cache
Changing tool definitions, putting a timestamp near the top of the prompt, or switching settings such as thinking effort mid-conversation can all force a fresh, full-price read (source 2). Keep the top of the prompt boring and stable.
Batching: half price if you can wait
If the work does not need an instant answer, send it as a batch. Anthropic and OpenAI both charge 50% less for batch jobs (source 3, source 6). On OpenAI, GPT-6.2 Sol drops from $2 in and $10 out to $1 and $5 (source 4).
- Anthropic: up to 100,000 requests or 256 MB per batch. Most finish within an hour, and anything not done in 24 hours expires without charge (source 3).
- OpenAI: up to 50,000 requests and 200 MB per batch, with a 24-hour completion window (source 6).
- Gemini: batch prices are half the standard rates (source 7).
Good batch jobs
Overnight lead research, tagging last week's tickets, writing product descriptions for a new catalogue, and running your test suite all suit batch mode. Caching and batching can be combined on Claude for even bigger savings (source 1).
Other levers
Do the maths on paper before you build. A rough spreadsheet with calls per task, tokens per call and tasks per month will tell you whether an agent pays for itself long before the first invoice arrives.
- Route by difficulty: a cheap model sorts requests and only hard ones go to an expensive model.
- Cap the loop: set a maximum number of steps so a confused agent cannot spin forever.
- Trim tool results: return the five fields the agent needs, not the whole database row.
- Time-shift: DeepSeek's API charges half price outside its peak hours (source 9).
- Track cost per task, not cost per month, so you notice when a change makes each task dearer.
Sources
Written by Agents Lookup in our own words. Facts come from these pages:
- 1. Anthropic: Pricing: platform.claude.com/docs/en/about-claude/pricing
- 2. Anthropic: Prompt caching: platform.claude.com/docs/en/build-with-claude/prompt-caching
- 3. Anthropic: Batch processing: platform.claude.com/docs/en/build-with-claude/batch-processing
- 4. OpenAI: API pricing: developers.openai.com/api/docs/pricing
- 5. OpenAI: Prompt caching: developers.openai.com/api/docs/guides/prompt-caching
- 6. OpenAI: Batch API: developers.openai.com/api/docs/guides/batch
- 7. Google AI Studio: Gemini API pricing: aistudio.google.com/docs/pricing
- 8. Anthropic: Building effective agents: www.anthropic.com/engineering/building-effective-agents
- 9. DeepSeek: Models and pricing: api-docs.deepseek.com/quick_start/pricing
- 10. Anthropic: Models overview: platform.claude.com/docs/en/about-claude/models/overview