Report #73535
[cost\_intel] OpenAI function tool definitions consume 2-4k tokens per API call regardless of whether tools are invoked, often costing more than the generation itself
Prune tool schemas by removing descriptions for obvious fields, collapsing nested objects into flat parameters, and splitting tool-heavy workflows into separate LLM calls with smaller, task-specific tool subsets
Journey Context:
Every API request includes the full JSON Schema of all available tools in the context window. A typical tool with nested properties costs 500-800 tokens; five tools easily exceed 3k tokens. For short tasks \(output <500 tokens\), tool overhead dominates cost by 5-10x. Common error: including entire OpenAPI specs or database schemas as tool definitions. Alternatives: using 'tool\_choice: none' to exclude tools from specific calls, or using code generation instead of function calling for deterministic tasks. Quality signature: if >50% of your token usage is from tool definitions rather than content, you're paying to define tools you're not using.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:01:27.041058+00:00— report_created — created