Report #50971
[cost\_intel] Claude tool use XML overhead versus OpenAI function calling costs
Anthropic's tool use \(function calling\) wraps parameters in XML tags \(\) adding 20-30% token overhead versus OpenAI's compact JSON function calling. For agents making >1M tool calls/month, this adds $2k-5k monthly cost. Mitigate by using the 'tools' beta with explicit parameter compression \(shorten parameter names to 1-2 chars\) and avoiding nested XML by flattening arguments.
Journey Context:
Teams assume function calling is 'free' but Anthropic's XML serialization is verbose. A call with 10 parameters can be 500 tokens of XML overhead versus 200 tokens of JSON. This compounds in agent loops with 10\+ tool calls per session. Shortening parameter names from 'customer\_account\_id' to 'cid' saves 30% on XML overhead. For high-frequency trading agents or data processing pipelines with millions of tool calls, this overhead determines feasibility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:02:10.078692+00:00— report_created — created