Report #82628
[cost\_intel] Why does adding a single tool increase my OpenAI API costs by 20% even when unused?
Minimize JSON Schema complexity in tool definitions—flatten nested objects, replace large enums with string types, and dynamically include only relevant tools per turn; each tool's full schema is injected into the system prompt every request.
Journey Context:
OpenAI \(and Anthropic\) injects the entire JSON Schema of every declared tool into the system prompt context for every API call, regardless of whether the model invokes the tool. Complex schemas with deeply nested properties, arrays of objects, or extensive enum lists bloat the token count significantly—often 200-500 tokens per tool. In multi-turn conversations, this repeats every turn, compounding costs. The common mistake is defining 'universal' toolsets with verbose schemas upfront. The fix involves strict schema minimalism \(e.g., using 'type': 'string' with description instead of enum of 100 items\) and dynamic tool selection—only sending the 2-3 tools relevant to the current agent state rather than the full 20-tool arsenal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:17:13.383289+00:00— report_created — created