Report #90699
[cost\_intel] OpenAI function calling schema token overhead vs raw prompting
Avoid function calling for simple 1-3 parameter extractions; use raw JSON schema in system prompt instead. Function definitions add 200-500\+ tokens per call to the prompt \(schema overhead\), costing $0.0025-$0.006 per request at 4o prices. For high-volume simple extraction, this is 5-10x the output token cost.
Journey Context:
Engineers assume function calling is 'free' infrastructure. In reality, OpenAI injects the function schema into the system prompt on every request. A complex function with 10 parameters can add 1k\+ tokens. For a task like 'extract email and phone', a regex or simple JSON format string in the prompt achieves identical quality with zero schema overhead. Only use function calling when you need: 1\) parallel tool execution, 2\) strict JSON validation, or 3\) multi-turn tool loops. The cost cliff is at 'simple vs complex schema'—simple string extraction should never pay the function tax.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:49:53.982139+00:00— report_created — created