Costs
Where agent spend goes and how to cut it without cutting quality, from token prices to tool calls.
Turning the usage object into dollars: how Claude, OpenAI and Gemini count the tokens you pay for
Every API response tells you what it cost, but Claude, OpenAI and Gemini split cached, written and thinking tokens differently. Read the fields the wrong way and your per-run cost meter is off by 40 percent or more. Here's how to do the math on each.
Read article →Output tokens are the pricey side: where an agent's output bill comes from and how to shrink it
On current Claude, OpenAI and Gemini models, output tokens cost five times what input does, and thinking, tool arguments and replies all bill at that rate. Here's how the output side of an agent run adds up on Claude, OpenAI and Gemini as of November 2026, and the settings that actually cut it.
Read article →The 10 percent region tax: what data residency costs an agent
Pinning model inference to the US or EU costs about 10 percent more on Claude, OpenAI and Google Cloud, and an agent pays it on every turn. Here's how each provider bills it and how to keep it off traffic that doesn't need it.
Read article →Long-context price steps: the token count where your agent's bill quietly doubles
Several model APIs charge more per token once a single prompt crosses a length threshold, and agent loops cross it without telling you. Here is where the steps sit today at OpenAI, Anthropic, Google and xAI, what they cost, and how to keep a long run under the line.
Read article →Counting tokens before you send: the token counting APIs agent builders should use
How the free token counting endpoints on Claude, the OpenAI Responses API and Gemini work as of November 2026, what they can't count, and how to build a pre-send budget check into an agent loop.
Read article →Flex, Fast and Priority tiers: picking a service tier for each agent call
OpenAI, Google and DeepSeek now sell the same model at several prices depending on how fast and how reliably you want it. Here is how flex, fast, priority and off-peak pricing work as of November 2026, with worked math for an agent loop and the fallback logic that keeps the discount from turning into a bill surprise.
Read article →Hosted tool fees: what web search, fetch and code execution add to an agent run
Provider-hosted tools like web search, code execution and file search carry their own fees on top of tokens, and the tokens they pull into context often cost more than the fee. Here is how Anthropic, OpenAI and Google price them as of November 2026, with a worked example and the knobs that keep the bill sane.
Read article →Model routing for agents: when sending easy work to a cheap model actually cuts the bill
Routers, cascades and mid-run model switches, priced on real November 2026 rates, including the prompt-cache penalty that makes switching models inside a loop more expensive than it looks.
Read article →Budget caps for agent runs: turn limits, token budgets and provider spend limits
A runaway agent loop can cost ten times a normal run before anyone notices. Here is how to cap a single run with turn limits and token budgets, how provider spend limits behave when you hit them, and why your retry logic needs to know the difference.
Read article →Batch APIs for agent workloads: when half price is worth the wait
OpenAI, Anthropic and Google all sell batch inference at 50% off. Here is which agent jobs fit a 24-hour window, which do not, and the details that bite.
Read article →Context compaction for agent loops: when trimming history actually cuts the bill
Tool result clearing and server-side compaction on Anthropic and OpenAI, with worked cost math showing when shrinking an agent's context saves money, when it costs more, and how it interacts with prompt caching.
Read article →Why Your Agent Costs More Than You Think: A Practical Guide to Tool-Calling Costs
How tool definitions, growing histories, and multi-turn loops drive the cost of AI agents, with a worked example and the caching and batching discounts that actually move the bill.
Read article →