Report #47738
[cost\_intel] OpenAI function definitions inflating context window by 3-5x more than token savings from shorter outputs
Move tool schemas to external documentation references in description fields; use strict mode only when schema >500 tokens
Journey Context:
Every tool definition is embedded in every request context. A complex JSON schema with 10 tools can consume 4000\+ tokens before user input. The savings from structured output \(shorter completions\) rarely offset this fixed overhead for <5 turn conversations. The common error is copying full OpenAPI specs into function definitions. The fix is minimal schemas with external docs links, and for simple tools, omitting strict mode saves ~20% tokens on definition.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:36:46.225997+00:00— report_created — created