Tool Use Cost

Tool use cost is the unit cost of one completed agent or workflow run after model calls, tool output context, retrieval, cache, and paid external tool/API overhead are included.

Question

How do I calculate cost for an AI agent that calls tools?

Quick answer

Formula: tool_docs_refresh_share = tool_docs_refresh_monthly / monthly_tool_use_runs

Formula: cost_per_tool_use_run = generation + retrieval + reranking + refresh_share + vector_db + cache + external_tool_api_or_infra

Formula: margin_pct = (run_price_or_credit - cost_per_tool_use_run) / run_price_or_credit * 100

  • Assumption: a model/tool step is one model request that may include tool selection, tool output, retries, or final synthesis.
  • Assumption: external tool/API fees are entered as a weighted-average cost per model/tool step.
  • Assumption: tool docs, schema, or index refresh work is amortized across monthly tool-use runs.

Example: if generation, context, refresh share, vector, cache, and external tool/API overhead sum to $0.11, one completed tool-use run costs $0.11 before human approval or multi-agent handoff is added.

Scenario Table

ScenarioWhat changesExpected effect
Tool output growsMore JSON, search results, traces, or browser text are sent back to the modelInput-side token spend rises even when the external tool is free
Paid lookup addedExternal tool/API cost per step increasesPer-run margin can move faster than model-token cost
Retry loop appearsModel/tool steps per completed run increaseModel spend, external tool spend, and latency all compound

Where This Fits

Use Tool Use Cost when paid tool calls or serialized tool output are meaningful cost drivers. Use Agent Run Cost for the broader run baseline, and use Break-even Price once the blended unit cost is known.

Open companion tools: Tool Use Cost, Agent Run Cost, Break-even Price

Related reads: Agent Run Cost, How To Price AI Agent Usage With Credits, Caps, and Margin, How Many Tokens Per Request?

Run the Tool Use Cost Calculator

Model cost per tool-use run from model/tool steps, tool output context, retrieval, cache, and external tool overhead.

Open Tool Use Cost