Function-calling · hidden token tax
Tool & Function Token Cost
Every tools / functions block you define for function calling is resent as input tokens on every request — a hidden tax almost nobody measures. Paste your definitions and see the total tokens, the cost per request and per 1,000 requests across GPT-5.6, Claude 5 and Gemini 3, and a per-tool breakdown of which definition is the most expensive. Everything runs in your browser; nothing is uploaded.
This block adds 0 input tokens to every call. Function-calling tools are billed as input — the numbers below are the pure definition overhead, before any prompt or answer.
| Model | Input $/1M | Tokens / req | $ / request | $ / 1K requests | $ / 1K requests |
|---|
Per-tool breakdown
Which definition is eating your token budget — sorted by cost on the selected model. Trim the top of this list first.
| Tool | Tokens (est.) | Share of block | $ / 1K requests |
|---|---|---|---|
| Paste a valid tools block to see the per-tool split. | |||
How it works
The overhead you are paying on every call
When you use function calling, you hand the model a tools (or legacy functions) array. That array is serialized to JSON and injected into the request as input tokens — and unlike your user message, it is sent again on every turn of the conversation, whether or not a tool actually gets called. A ten-tool catalog with verbose descriptions can quietly add several thousand input tokens to each request. Across a production workload that is a real line on the bill, and it almost never shows up in a plain token counter.
This tool parses your definitions, estimates the token weight of the whole block, multiplies it by the published input price of eleven current models — GPT-5.6 Sol / Terra / Luna, GPT-4.1 nano, Claude Fable 5, Opus 4.8, Sonnet 5, Haiku 4.5, and Gemini 3.5 Flash / 3.1 Pro / 3 Flash — and then splits the cost per individual tool so you can see exactly which definition to trim first. Every price cell is editable and seeded from published list prices as of 2026-07-13.
Paste your tools block
Drop in your OpenAI or Anthropic tools array, or a raw JSON-Schema parameters object.
Read the per-request tax
See how many input tokens ride along on every call, and what that costs per request.
Scale to 1,000+ requests
The overhead is fixed per call — multiply it by your volume to see the real monthly weight.
Find the fat tool
The breakdown ranks each definition by cost so you know which schema to shrink first.
Worked example
What a real block costs
[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name" },
"units": { "type": "string", "enum": ["celsius","fahrenheit"] }
},
"required": ["city"]
}
}
}
]
Input tokens (est.) ≈ 150 (resent every request)
Cost / 1,000 requests at default input prices:
GPT-4.1 nano → $0.015
Gemini 3 Flash → $0.075
Claude Haiku → $0.150
Claude Sonnet 5 → $0.300
Claude Opus 4.8 → $0.750
Claude Fable 5 → $1.500
One small tool ≈ 150 tokens.
A 12-tool catalog ≈ 3,000+ tokens
… on EVERY request, tool called or not.
At 3,000 tokens/req, 50k requests/day
on Claude Sonnet 5 ($2 / 1M input):
3,000 × 50,000 = 150M tokens/day
= $300 / day → ~$9,000 / month
just to carry the definitions.
Cache the block or trim descriptions
and this line drops by 70-90%.
(Load "Big catalog" above to try it.)
Sister tools
Keep costing your stack
FAQ
Common questions
Do function definitions cost tokens?+
Yes. The tools or functions block you pass for function calling is serialized and prepended to your request as input tokens, and it is sent again on every single call for the whole conversation. The model has to read every tool name, description, and parameter schema each turn to decide whether and how to call a function, so a large tool catalog is a fixed input tax on every request — even the ones where no tool is ultimately called. This page measures that tax.
How much do tools add to each request?+
It depends on how many tools you expose and how verbose their JSON schemas are. A single simple function with a two-field parameter object is often 60–120 tokens; a rich tool with long descriptions, enums, and nested objects can be 300–800 tokens on its own; a catalog of a dozen tools routinely runs 2,000–5,000 input tokens that ride along on every request. Paste your real block above to get the number for your exact definitions instead of guessing.
How can I reduce the token cost of my tools?+
Trim descriptions to one tight sentence, drop words the model can infer from the name, shorten enum lists, remove optional parameters you rarely use, and only attach tools relevant to the current step instead of the whole catalog on every call. Many providers also let you cache a stable tools block so the repeated input is billed at a large discount after the first request. The per-tool breakdown here shows which definition to cut first for the biggest saving.
Which tool formats does this support?+
Paste any of three shapes: an OpenAI-style tools array where each item has a function object with name, description and parameters; an Anthropic-style tools array where each item has name, description and input_schema; or a raw JSON Schema object for a single function's parameters. You can also paste a full request object and it will find the tools or functions key inside it.
How accurate is the token count?+
It is an approximation, not the provider's exact tokenizer. The estimate blends a character-based count (roughly one token per four characters) with a word/symbol count and takes the higher of the two, which tracks real tokenizers within a few percent for typical JSON. Dense JSON with many braces, quotes and short keys tokenizes slightly heavier than plain prose, so treat the number as a planning estimate for budgeting, not a billing-exact count.
Does this send my tool definitions to any server?+
No. There is no network request anywhere on this page. Parsing, token estimation, and cost math all run in plain JavaScript in your browser tab. You can load the page, disconnect from the internet, and it keeps working. Nothing you paste is transmitted, logged, or stored.