The Tool-Use / Function-Calling Cost Adder estimates the token charge added by schemas, tool-result context, and function-call JSON. It compares one plain completion with the same request using tools, then scales that overhead across monthly requests.
Loading calculator...
It is a token-cost estimate. It does not price external API calls, tool execution time, retries, or infrastructure.
How to use it
Enter monthly requests plus base input and output tokens for a plain completion. Defaults are 100,000 requests, 500 input tokens, and 300 output tokens.
Add the tool schema tokens, tool calls per request, tokens per tool result, and extra output per call. Defaults are 800, 2, 600, and 80. The source treats each tool result as added input on every call.
Check the actual serialized schema and returned payload size before using the default token counts.
Enter input and output prices per million tokens, defaulting to $3 and $15. Read the per-request overhead before using the monthly total.
A multi-step agent changes three separate terms at once: result input and tool output grow with calls, while schema is charged once per request in this approximation.
Fields explained
Requests / month – monthly completion count. Default: 100,000.
Base input tokens / req and Base output tokens / req – plain-completion token counts. Defaults: 500 and 300.
Tool schema tokens – definitions sent with the request. Default: 800.
Tool calls / request, Tokens / tool result, and Extra output / tool call – round trips, returned context, and function-call JSON. Defaults: 2, 600, and 80.
Input price / 1M and Output price / 1M – rates used in the formula. Defaults: $3 and $15.
Reading the results
| Result | Meaning | Action |
|---|---|---|
| Tool overhead / req | Schema, results, and JSON charge | Trim the largest component. |
| With tools / req | Plain cost plus tool overhead | Compare with a direct flow. |
| Monthly overhead | Extra cost across requests | Use for the agent budget. |
| Monthly total | Base plus tools across requests | Compare architecture variants. |
The overhead percentage compares tool overhead with base cost. When base cost is zero, the source displays 0% rather than attempting division.
Two 600-token results add 1,200 input tokens per request.
Warning: this source approximates accumulated context as calls times one tool-result size; it does not model each individual result length.
Monthly total includes base completion cost. Monthly overhead isolates only the cost introduced by tooling.
The formula
Input and output prices are divided by one million. base = baseIn × inputPrice + baseOut × outputPrice. Tool overhead is schemaTokens × inputPrice + calls × resultTokens × inputPrice + calls × extraOutput × outputPrice. With-tools cost is base plus overhead; monthly amounts multiply by requests.
| Default input | Value |
|---|---|
| Schema | 800 tokens |
| Calls | 2 |
| Tool result | 600 tokens |
| Extra output | 80 tokens/call |
| Prices | $3 input, $15 output per 1M |
At defaults, base cost is $0.006. Schema costs $0.0024, results cost $0.0036, and tool JSON costs $0.0024. Overhead is $0.0084, with-tools cost is $0.0144, monthly overhead is $840, and monthly total is $1,440.
Info: the code suggests compact tool results, trimmed schemas, and caching stable schema prefixes.
Those actions target distinct formula terms and should be measured after deployment.
Worked examples
One lookup. At one call, a 300-token schema, 200-token result, 40 JSON tokens, $3 input, and $15 output, overhead is $0.0018 per request. Record it against the external tool charge.
Default agent. The built-in values show $0.00840 overhead per request and $840 monthly overhead. Inspect schema size first.
Three-step flow. With 3 calls and 1,000-token results, the default rates make result input $0.009 per request. Keep tool payloads small.
Scale case. At 1M requests, default settings produce $8,400 monthly tool overhead. Test whether every request needs two calls.
Common mistakes
Counting tool execution fees as model tokens mixes separate costs. Add external API charges outside this tool.
Using output price for results is incorrect. Tool results are fed back as input tokens in the source.
Ignoring schema tokens misses a charge that occurs on every request in this formula.
Danger: invalid numeric prices are not clamped positive by the source and can produce misleading values.
Use current nonnegative rates from the selected provider.
FAQ
Are tool-result tokens input tokens?
Yes. The code prices them at the input rate.
It multiplies result tokens by calls per request.
Is schema charged per call?
No. The approximation adds schema once per request.
It separately grows result and JSON terms by calls.
Does it include tool API fees?
No. Only model token costs are calculated.
Add search, database, or payment API bills separately.
What happens with zero base cost?
The percent overhead displays as 0%.
Dollar overhead can still be positive.
How can I lower overhead?
Reduce schema, results, calls, or JSON output.
The formula shows each term separately.
Disclaimer
This is an educational estimate for planning. Results depend on the model, provider, hardware, configuration, and current pricing, all of which change.
The live calculator on the page is the source of truth for its exact fields. Verify against current prices and a small real test before scaling spend.






