Summary: Firecrawl published a guide on October 13, 2026 laying out nine LLM token optimization techniques in a specific order: biggest input reductions first, unit-price levers like caching and batching after. The reason order matters is that agent bills are dominated by content re-sent every turn, and some fixes carry quality risk that only evals can catch. Here’s the practical version for anyone shipping on the OpenAI or Anthropic APIs.
Why agent bills balloon
Model APIs are stateless, so every turn resends the system prompt, tool definitions, prior replies, and any fetched pages. A page read on turn one of an eight-turn task gets billed eight times. A study by Longju Bai, a PhD researcher at the University of Michigan, and colleagues — the first systematic look at agent token consumption — found agentic coding tasks on SWE-bench Verified consumed 1,000x more tokens than plain code chat, with most of the cost on the input side.
The pricing structure makes this worse. On both OpenAI’s and Anthropic’s current price sheets, output costs 5x input, and cache reads run 1/10th to 1/40th of a fresh input token. The spread between top and bottom models is 100x on input. Where a token lands — input, output, cache — changes its price dramatically.
Start where the savings are free
The first move is measurement, not optimization. Log the usage fields every provider returns — input, output, cache creation, and cache reads — tagged per task and feature. Three numbers tell you where to start: input tokens per task split by layer, output tokens per task, and cache hit rate. Thariq Shihipar of Anthropic’s Claude Code team has written that the team runs alerts on cache hit rate and declares SEVs when it drops, because a few points of cache misses swing both cost and latency.
Then cut input at the source. The biggest win is format: in Firecrawl’s own tokenization benchmark, fifteen real pages came to about 4.1 million GPT tokens as raw HTML versus roughly 191,000 as clean markdown — a 21.5x reduction. And if an agent needs one fact, it can skip the page entirely. Firecrawl reports its answer to a stock-price lookup was 98% smaller than Claude Code’s fetch output for the same question. On the independent Openbenchmarks web-search board (updated September 26, 2026), coding agents searching through Firecrawl used 15–69% fewer tokens per task than with Perplexity, Parallel, Brave, Tavily, Exa, or Linkup — though Perplexity completed more tasks while using about 18% more tokens, so raw savings aren’t the whole story.
// Whole page: right for RAG ingestion
await firecrawl.scrape(url, { formats: ["markdown"] });
// One answer: right for a tool call
await firecrawl.scrape(url, {
formats: [{ type: "query", prompt: "How much is the Core plan?" }],
});
The same logic applies outside the web: a database tool that returns three matching rows instead of the table, a file tool that returns a diff, a test runner that returns the failing test instead of the full log.
Then work the price, not the count
Next comes prompt caching, the largest unit-price discount available. Both major providers cache by prefix, so anything that changes early in the request kills the hit silently. Order matters: put static instructions first, then tool definitions, then growing history. Related post worth reading: we covered what happens when the model cleans its own context, which attacks the same history layer from a different direction.
After that, per the Firecrawl guide: defer tools you don’t need (Anthropic’s docs show ~55k tokens of tool definitions cut by over 85%), cap output and reasoning since output is the most expensive per-token layer, and batch anything that can wait — batching gets 50% off and stacks with caching.
The guide’s worked model claims all of it together drops a 10,000-task research agent from $11,648 to $425 a month. Treat that as Firecrawl’s own model, not a guarantee for your workload.
One caveat the guide itself stresses: every change needs an eval behind it, because a cheap request that fails costs more than an expensive one that works. If you take one step this week, add per-task token logging — you can’t fix what you’re not counting.
