How Claude's tool use (function calling) affects API costs in 2026: tool definition tokens, result tokens, multi-turn overhead, and cost-reduction strategies.
Claude's tool use feature lets the model call external functions mid-response. Every part of a tool call — the definition, the call itself, and the result — counts as billable tokens.
What gets billed in a tool-use turn
Token type
What it includes
Billed as
Tool definitions
Your tools array (name, description, input_schema)
Input tokens per request
Model's tool call
JSON the model outputs to invoke a tool
Output tokens
Tool result
Your function's response passed back in the next message
Input tokens
Final model response
The model's answer after using the tool result
Output tokens
A single tool-use round-trip requires at minimum two API requests: one to get the model's tool call, one to send the result and get the final answer.
Example cost breakdown
Using Claude Sonnet 4.6 ($3/M input, $15/M output) for a calculator tool:
Tool definitions: 200 tokens × $3/M = $0.0006 per request (repeats every turn)
Model tool call output: 50 tokens × $15/M = $0.00075
Tool result input: 100 tokens × $3/M = $0.0003
Final response output: 200 tokens × $15/M = $0.003
Total per tool-use chain: ~$0.005 on Sonnet vs ~$0.001 for a simple one-shot request
Cost-reduction strategies for tool use
Cache tool definitions — tool schemas are static. Mark them with cache_control: ephemeral. After the first request, subsequent reads are 90% cheaper.
Minimise tool definitions per request — only include the tools the model needs for the current task. Unused tool definitions still consume input tokens.
Compress tool descriptions — tool description fields are summarised prose the model reads every request. Keep them under 50 words without losing intent clarity.
Batch tool-use workloads — if the final answer doesn't need to be real-time, use the Batch API for 50% off. Note: Batch API tool-use jobs complete within 24h.
Model routing for tool use
Haiku 4.5 follows tool schemas reliably for well-structured, deterministic functions (e.g. database lookups, API calls with clear parameters). Use Sonnet 4.6 when the tool selection logic is ambiguous or involves reasoning across multiple candidates. Reserve Opus 4.7 for agentic chains where tool misuse compounds across many steps. The Prompt-Pricing Recommender can help with model selection.
Estimate tool-use costs
Use the Claude Cost Calculator and add your estimated tool definition token count to the input field — multiply by the average number of turns per session to model monthly cost.
Frequently asked questions
Are tool definitions billed every request?
Yes. The tools array is included in the request payload and counts as input tokens on every API call where it appears. Cache tool definitions with cache_control: ephemeral to cut this cost by 90% on repeated requests.
Can I use tool use with the Batch API?
Yes. The Batch API supports tool use with the same JSONL format. Tool-use batch jobs complete within 24h at 50% off standard pricing — ideal for bulk data extraction or classification pipelines that call external APIs.
Does Claude 4.7 (Opus) perform better tool use than Sonnet?
For complex agentic reasoning across many sequential tool calls, Opus 4.7 makes fewer selection errors. For straightforward single-tool lookups with a clear schema, Sonnet 4.6 performs equivalently at 5× lower cost.
What is the maximum number of tools I can define?
Anthropic does not publish a hard cap on tool count, but the total tools array must fit within your context window after the system prompt and messages. In practice, 10–20 well-described tools is a practical upper limit before response quality degrades.