Function calling token cost calculator
Function (tool) calling is one of the most underestimated cost lines in an LLM app. The JSON schemas you pass — names, parameter types, and especially long natural-language descriptions — are serialized and prepended to your prompt as input tokens on every request. A few rich tools can quietly add hundreds of input tokens per call. This tool measures that hidden overhead and projects its monthly cost.
How it works
Paste the tools or functions array you send with each request. The tool serializes
and counts it using a four-characters-per-token heuristic plus a small per-function
structural allowance for the wrapping the API adds. Because definitions are re-sent on
every call (unless cached), the per-request overhead multiplies by your daily volume,
priced at your model’s input rate, to give a monthly figure. Verbose descriptions are
usually the biggest offender, and the calculator makes that cost concrete.
Tips and notes
- Trim tool descriptions first — they are free-text and often the largest token sink in a schema while contributing the least to correct tool selection.
- Send only the tools relevant to each request rather than the full catalogue; routing the right subset cuts both tokens and tool-selection errors.
- Enable prompt caching on the stable tools block so the schema is billed once per cache window instead of on every single call.