Loading
Loading
Every agent turn re-sends the whole conversation so far. Here's cited current pricing across three providers, and a calculator that models what that actually costs — with and without caching.
Cheapest Output
$1.50/1M
Gemini 3.1 Flash, official pricing
Most Expensive
$168/1M
GPT-5.2 Pro output, official pricing
Cache Read Discount
0%
Off input price, Anthropic's own docs
Cache Write Premium
0.00x
5-min TTL, Anthropic's own docs
Why 'Tokens × Price' Undercounts By A Lot
Most “how much does an AI agent cost” posts multiply an expected number of tokens by a provider's list price and stop there. That works for a single request-response call. It breaks down for an agent, because the Messages/Chat Completions APIs are stateless — every tool-calling turn re-sends the entireconversation history as input, not just the new message. A 20-turn agent run doesn't cost 20x a single turn; it costs roughly 20x the average context size across those turns, which is much larger than the first turn and much smaller than the last one, and without prompt caching every one of those resends is billed at full input price.
This is also exactly where prompt caching earns its keep, and why a cost estimate that ignores it is not just imprecise but structurally wrong for any provider whose agent workloads use caching by default. The rest of this post is built on official pricing figures — no invented per-token numbers — plus a calculator that runs the actual resend-and-cache math instead of a flat multiplication.
Current Pricing, Sourced Directly
As of publishing, Anthropic's current lineup runs Claude Haiku 4.5 at $1/$5 per million input/output tokens, Claude Sonnet 5 at $3/$15 (a $2/$10 introductory rate applies through 2026-08-31), Claude Opus 5 at $5/$25, and Claude Fable 5 — the highest-capability tier — at $10/$50. OpenAI's current models run GPT-5.2 at $1.75/$14, GPT-5.5 at $5/$30, and GPT-5.2 Pro at $21/$168. Google's Gemini 3.1 Flash runs $0.25/$1.50, while Gemini 3.1 Pro runs roughly $2.00/$12.00 for prompts up to 200K tokens (higher above that threshold, per Google's own long-context pricing tiers). The spread on output price alone — $1.50 to $168 per million tokens — is more than 100x, which means model choice is usually a bigger lever than any optimization you can apply to a fixed model.
Official pricing pages, accessed 2026-07-28 — sorted highest to lowest
What An Agent Run Actually Costs
This calculator simulates an agentic loop turn by turn: each turn adds new tokens (a tool result, a user message) to a growing conversation, re-sends that accumulated context as input, and bills a fresh output. With caching enabled, everything before the newest addition is billed at each provider's cache-read rate instead of full price — for Anthropic that's roughly a 90% discount off input price, per its own published pricing documentation, with only the newest chunk paying a cache-write premium. Try dragging turns from 5 to 50 with caching off, then on — the gap widens dramatically as conversations get longer, which is exactly when caching matters most.
Simplified simulation, not a vendor-published benchmark: each turn re-sends the accumulated conversation as input and bills a fresh output. With caching on, everything before the newest turn is billed at each provider's cache-read rate (Anthropic: ~0.1x input price, per its published pricing docs) and only the new chunk pays the cache-write premium (~1.25x for Anthropic's 5-minute default); OpenAI and Google cache discounts are modeled from their own published multipliers. Real agent runs vary — tool-result size, system-prompt size, and thinking-token overhead all shift the actual number. Prices reflect each provider's own pricing pages as of 2026-07-28 and change frequently — verify current rates before budgeting.
Actually Cutting The Bill
Two levers dominate everything else. Turn on prompt caching and structure prompts so stable content comes first — system prompt and tool definitions before any per-turn variable content — since caching is a strict prefix match and a single byte changed early in the prompt invalidates everything after it. Use a cheaper model for routine steps— tool routing, simple extraction, formatting — and reserve the frontier model for the steps that actually need its reasoning. A multi-model agent that runs Gemini 3.1 Flash or Claude Haiku 4.5 for the bulk of its tool-calling turns and escalates to a frontier model only when a step is genuinely hard can cut blended cost by an order of magnitude versus running every turn on the most expensive model available, without necessarily sacrificing the final answer's quality if the escalation logic is sound.
The honest cost model for an agent isn't a single number per token — it's a function of how many turns the loop runs, how much context each turn adds, and whether the request pattern actually benefits from caching. Run your own numbers through the calculator above before committing to a model for a production agent.

Written by Abhishek Kushwaha
Founder and writer at Global Tech Search, based in Kathmandu, Nepal. Covers AI, infrastructure, markets, and climate with sourced data and original analysis. More about the author →
Recommended Tools
Affiliate disclosure — we may earn a commission at no cost to you.
Sources
LLM API pricing changes frequently and providers routinely ship new model versions — figures above reflect each provider's own pricing documentation as accessed on 2026-07-28. The cost calculator is a simplified simulation of caching mechanics, not a guarantee of any specific workload's bill; verify current rates on each provider's pricing page before budgeting a production agent.
Global Tech Search
More independent, cited breakdowns of the infrastructure decisions that actually matter.
Back to Dashboard →