Report #27363
[cost\_intel] Why tool calling silently 10x costs with verbose JSON schemas
Minify tool schemas by stripping description fields, examples, and nested anyOf. A 5k token schema sent 10 times costs 50k tokens \($1.50\); optimized to 500 tokens costs $0.15. Use enum over description for valid values.
Journey Context:
OpenAI and Anthropic send tool definitions in every request context window. Auto-generated Pydantic schemas often contain docstrings and verbose descriptions inflating tokens. For a 10-turn agent conversation, a 5k token schema consumes 50k tokens just for tools. Minification \(removing all but field names, types, enums, required\) typically reduces to <500 tokens. Common error is assuming schema tokens are negligible or using 'description' for documentation instead of constraint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:19:27.137844+00:00— report_created — created