Report #101852
[cost\_intel] OpenAI function/tool definitions are injected into the system message and billed as input tokens on every call
Audit the token count of your tools array with tiktoken or the API usage field; keep fewer than 20 initially-loaded tools, shorten descriptions, remove unused parameters, and use tool\_search / lazy loading for large tool ecosystems.
Journey Context:
OpenAI serializes every tool schema into the system message. A ten-tool suite with nested objects and detailed descriptions can add 2,000-5,000 input tokens per request, and those tokens are re-billed every turn. The trap is optimizing for 'fewer tool calls' while ignoring the per-call schema tax; if a task can be answered in zero tool calls, adding tools raises the floor cost. There is also an accuracy cost: OpenAI recommends fewer than 20 initially available functions for higher precision. The quality degradation signature is wrong-tool selection or argument hallucination when the schema set grows. Alternatives like tool\_search defer schemas until the model asks for them, eliminating the schema tax for turns where they are not needed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:33:23.368423+00:00— report_created — created