LLM & agent cost calculator

See what an AI agent run or an API workload costs on 36 models from 6 providers, with prompt caching, batch discounts, long-context tiers and tool calls. Prices verified 2026-10-18.

Presets:
Include thinking tokens if you use them

Same workload on every model

Click a column to re-sort. Click a model to see its full pricing.

ModelPer run / requestPer monthvs selected

How the agent estimate works

An agent loop sends a new request on every step. Step i carries the system prompt and tools, the task, and everything produced so far: prompt(i) = system + task + (i − 1) × (output + tool result). Without caching every step pays full input price for the entire history, so cost grows with the square of the number of steps.

With prompt caching the previous prompt is read from cache at the cached-input price and only the newly appended tokens are written. Providers that charge for cache writes (Anthropic) bill those new tokens at the cache-write price; others bill them as normal input. When a step's prompt crosses a provider's long-context threshold, that whole request is billed at the long-context rate.

Tool fees such as web search are added per call using the provider's published per-1,000-call price.

FAQ

Why does an agent cost so much more than a single API call?

An agent re-sends the whole conversation on every step: the system prompt, tool definitions, every earlier model output and every tool result. A 30-step run can bill hundreds of thousands of input tokens even when each step adds only a few thousand.

How much does prompt caching save?

Cached input usually costs 2.5% to 25% of the normal input price depending on the provider. For long agent loops that is often a 50-80% cut in total cost. Anthropic also charges a cache write premium (1.25x input for a 5-minute cache), which this calculator includes.

What is long-context pricing?

Some providers bill the whole request at a higher rate once the prompt passes a threshold (for example 272K tokens on recent OpenAI models, 200K on some Gemini and Grok models, 100K on Claude Haiku 5.5). The calculator applies the higher rate per step as soon as the context crosses it.

Are reasoning or thinking tokens included?

Providers bill thinking tokens as output tokens. If you use extended thinking, raise "output tokens per step" to include them.

How often are prices updated?

Prices are checked against official pricing pages; the current data was verified on 2026-10-18. Known upcoming changes are listed on the price changes page.