Calculator

Agent / tool-calling cost estimator

Model multi-step agents: system instructions, tool rounds, tool-result tokens, and growing context—then compare two models for the same workload.

Agent run cost

9-turn agent on Claude Sonnet 4.5

$2,317.95$0.2318 / run

8 tool calls · peak context ~14,330 tokens

Claude Sonnet 4.5$2,317.95
GPT-5 mini$214.76
cheaper
Input / run71,370
Cached / run9,450
Output / run2,880
Tool-result / run9,600

Workload

Agent shape

Growing context: each tool result is re-sent on later turns.

Cascade

Step / tool-call cost stack

How input growth, cache, and output stack into the run bill.

Uncached input (growing context)$1,857.60
Cached system prefix$28.35
Model output across turns$432.00
Turns9
Peak context14,330
Input cost$1,857.60
Cached input$28.35
Output cost$432.00

Cheaper for this agent: GPT-5 mini · delta $2,103.19

Planning model for tool-calling agents with growing context. Real agents vary by framework, retries, and tool payload size. Pricing snapshot updated 2026-07-31. Approximate static list prices for planning only. Always verify against each provider’s official pricing page before production budgeting.

Guide

How to get value from this calculator

Estimate spend for multi-step agents that call tools, accumulate context, and loop until a task completes. Each tool round adds input tokens from growing history plus output tokens from reasoning and tool calls. Agent workloads often cost 5–20x a single chat turn—model steps explicitly before enabling autonomous loops.

Cost formula

Agent cost per task = sum over steps of (input tokens at step / 1M × input price) + (output tokens at step / 1M × output price) + tool API costs; Monthly = tasks per month × average cost per task

Why it matters

Agents trade capability for unpredictable token growth. A demo that completes in three steps may average eight in production, multiplying cost without changing the per-token price.

How to use it

  1. Estimate average tool-calling steps required to complete a typical task.
  2. Set starting context size and how much context grows per step.
  3. Enter output tokens per step including reasoning and tool call JSON.
  4. Add monthly task volume for the agent feature.
  5. Apply cache hit rate if system prompt and tool schemas are cached.
  6. Inspect the step cascade to see which agent steps accumulate the most tokens.
  7. Compare against a single-shot prompt baseline to justify agent architecture.

Planning tips

  • Cap max steps and max tokens per agent run to prevent runaway loops.
  • Keep tool schemas concise— they are re-included in context every step.
  • Use a cheaper model for tool routing and a stronger model only for final synthesis if quality allows.
  • Prompt caching on static system and tool definitions reduces input cost per step materially.
  • Cap or cheapen the tallest steps in the cascade before switching the whole agent model.
  • Log step count and token usage per task in production to refine estimates monthly.

Frequently asked questions

Do tool calls themselves cost tokens?

Tool definitions and call/response JSON consume input and output tokens in the LLM context. External tool APIs (search, databases) add separate infrastructure cost not included here.

How many steps should I plan for?

Start with your p95 step count from evals, not the happy-path demo. Planning on averages underestimates spend for long-tail complex tasks.

Are these agent cost estimates exact?

No. CentsPerToken uses approximate list prices and your supplied assumptions. Real agent cost varies widely by task complexity and model behavior.

Does caching help agent workloads?

Yes. Static system prompts and tool schemas are ideal cache candidates. Model a realistic cache hit rate to avoid overstating input cost.