Report #65579
[cost\_intel] Token bloat from JSON mode vs function calling
Use OpenAI's function calling \(tools\) instead of JSON mode for structured output; it reduces token count by 20-30% because the model doesn't repeat key names in the output. Avoid strict JSON mode for large nested schemas.
Journey Context:
Developers force JSON mode with strict schemas, causing the model to output verbose JSON with repeated keys. OpenAI's function calling \(tools\) mode injects the schema into the prompt and allows the model to generate more compact token sequences. For a 50-field nested schema, JSON mode can 1.5x your token cost. Tools mode also improves adherence to schema constraints. Only use JSON mode when the consumer requires raw JSON without function call wrappers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:33:23.592822+00:00— report_created — created