Explained Episode 7 of 8

07 What an AI agent costs: tokens, caching and budgets

11 min Watch on YouTube

How LLM token pricing adds up in an AI agent: input and output tokens, why an agent loop's token use grows quadratically with its steps, and how prompt caching works and what breaks it. Then budgets that cap a run, like step limits and dollar limits, plus smaller models, compaction and the Batch API.

Chapters

  1. 0:00Intro
  2. 0:59What you pay for
  3. 2:47How fast does that add up?
  4. 5:03Do you really have to pay full price, to read the same text again?
  5. 7:58Does caching fix the bill?
  6. 10:07Where does an agent's money go?

Sources 18

Every claim in the episode, and where it comes from.

  1. Anthropic docs, Pricing (list prices on 7 November 2026: Sonnet 5.5 at $2 in and $10 out per million tokens; output at 5× input on every Claude model; cache writes and cache hits; Haiku 5.5 up to 100,000 tokens) platform.claude.com
  2. Anthropic docs, Steering thinking (thinking billed as output, even when hidden; each request in a run has its own maximum length) platform.claude.com
  3. Claude Code docs, Manage costs effectively (thinking can run to tens of thousands of tokens a request; agent teams at about 7× a standard session's tokens in plan mode) code.claude.com
  4. Manus, Context Engineering for AI Agents: Lessons from Building Manus (July 2025: about 100 tokens read for every one written; about 50 tool calls in a typical task; timestamps that break the cache; append-only context) manus.im
  5. Anthropic, How we built our multi-agent research system (June 2025: one agent about 4× and a team about 15× the tokens of a chat) anthropic.com
  6. Claude Code docs, How Claude Code uses prompt caching (the prefix; the match has to be exact; each model has its own cache) code.claude.com
  7. Anthropic, Prompt caching with Claude (August 2024: a 100,000-token prompt started answering in 2.4 seconds, not 11.5) claude.com
  8. OpenAI docs, Prompt caching (it doesn't change the output; on by default; 1,024-token minimum) developers.openai.com
  9. OpenAI docs, GPT-6.1 Sol (cached input at a twentieth of the normal price) developers.openai.com
  10. Google, Gemini API docs, Context caching (on by default; 4,096-token minimum on Gemini 4 Argon) aistudio.google.com
  11. Google, Gemini API docs, Gemini Developer API pricing (Gemini 4 Argon's cached input at a twentieth of its input price) aistudio.google.com
  12. Anthropic docs, Prompt caching (five-minute lifetime; 512-token minimum on Sonnet 5.5; what invalidates the cache; adding instructions partway through) platform.claude.com
  13. Anthropic docs, Context editing (clearing old results invalidates the cached prefix) platform.claude.com
  14. Anthropic, Lessons from building Claude Code: Prompt caching is everything (April 2026: static content first; a low cache hit rate treated as an incident) claude.dev
  15. Claude Agent SDK docs, How the agent loop works (a turn limit and a dollar cap, both off by default; what a capped run returns; compaction) code.claude.com
  16. Anthropic docs, Task budgets (beta: telling Claude its budget so it can wrap up first) platform.claude.com
  17. Anthropic docs, Batch processing (half price; most batches finish within an hour; 24 hours at most) platform.claude.com
  18. OpenAI docs, Batch API (half price, within 24 hours) developers.openai.com

Written by Kiran Krishna. Narrated with an AI voice.

LinkedIn: linkedin.com/in/kiran-krishna-au