Anthropic Programmatic Tool Calling
Programmatic tool calling allows Claude to write code that calls your tools programmatically within a code execution container, rather than requiring round trips through the model for each tool invocation. This reduces latency for multi-tool workflows and decreases token consumption by allowing Claude to filter or process data before it reaches the model's context window.
info
Programmatic tool calling is currently in public beta. LiteLLM automatically detects tools with the allowed_callers field and adds the appropriate beta header based on your provider:
- Anthropic API & Microsoft Foundry:
advanced-tool-use-2025-11-20 - Amazon Bedrock:
advanced-tool-use-2025-11-20 - Google Cloud Vertex AI: Not supported
This feature requires the code execution tool to be enabled.
Model Compatibility
Programmatic tool calling is available on the following models:
| Model | Tool Version |
|---|---|
Claude Opus 4.5 (claude-opus-4-5-20251101) | code_execution_20250825 |
Claude Sonnet 4.5 (claude-sonnet-4-5-20250929) | code_execution_20250825 |