Claude API Cuts Agentic Search Output Costs: The response_inclusion Parameter Every Operator Must Set
Anthropic's June 11 platform update adds response_inclusion to web_search_20260318 and web_fetch_20260318, letting operators drop consumed search result blocks from API responses and cut output token costs in multi-step agentic workflows.

If your agentic pipeline calls Claude's web search tool in multi-step loops, you have likely noticed that the API response echoes back entire search result blocks even after the model has consumed and processed them. That output bloat has a direct line to your invoice. Anthropic's June 11 platform update closes this gap with a new parameter that any operator can turn on in a single field change.
What changed
The web_search_20260318 and web_fetch_20260318 tool versions, announced June 11, 2026 on the Anthropic platform changelog, introduce a response_inclusion parameter. Set it to "excluded" and the API will drop server_tool_use and result block pairs from the response whenever the result was already consumed by a completed code execution call in the same turn. The default remains "full", so existing integrations are not affected unless you opt in.
{
"tools": [
{
"type": "web_search_20260318",
"name": "web_search",
"response_inclusion": "excluded"
}
]
}
The same update also ships code_execution_20260521, which adds the 90-second per-cell execution time limit to the tool description. Claude can now read this limit and budget long-running code cells accordingly, rather than running into it silently.
Why it matters for AI engineering teams
Web search is one of the most token-intensive agentic operations you can run. The Anthropic docs describe a typical flow: Claude decides to search, the API executes the query and returns results, Claude reasons over the content, and the final response includes citations. In a naive implementation, every one of those intermediate result blocks appears in the API response, even if the model already processed them inside a dynamic-filtering code execution call.
For single-turn interactive queries that cost is acceptable. For multi-step research agents, grounding loops, or citation pipelines that make 10 to 20 searches per turn, the accumulated output from search result echoing is meaningful overhead. With response_inclusion: "excluded", those already-consumed blocks are stripped before the response reaches your gateway, reducing output token counts without touching what the model sees.
The code execution budget disclosure compounds this. When Claude knows about the 90-second per-cell limit, it can split work into smaller code cells and avoid silent timeouts that require a retry call. Fewer retries means fewer billable requests.
The router/operator angle
For teams routing Claude API calls through an AI gateway or any middleware layer, the response_inclusion change creates a clean cost optimization that does not require model-level changes or prompt rewrites:
Version gate your tool call: Update from web_search_20250305 or web_search_20260209 to web_search_20260318 only for agentic request paths where Claude uses code execution to filter results. Leave the older version in place for interactive assistant workflows that need the raw search blocks in the response.
Response size planning: With "excluded", output token counts drop proportionally to how many search calls per turn are consumed by code execution. The saving is not uniform across all request shapes — it only applies to completed code execution calls in the same turn. Track your usage.output_tokens before and after the switch to measure actual impact per workflow type.
ZDR and routing compatibility: The docs note that web search is not available on Amazon Bedrock, and that dynamic filtering (which pairs with response_inclusion) is not available on Vertex AI. If you route Claude traffic across Bedrock, Vertex, and the direct Anthropic API, your tool version selection must be provider-aware. Requests routed to Bedrock or Vertex fallbacks should not use web_search_20260318 with dynamic filtering enabled.
Model support scope: web_search_20260318 with dynamic filtering works on Claude Fable 5, Opus 4.8, Mythos 5, Mythos Preview, Opus 4.7, Opus 4.6, and Sonnet 4.6. If your fallback chain includes older models, test whether they accept the new tool version or need to fall back to web_search_20250305.
What TheRouter users should watch or try
If you're using Claude's built-in web search through a gateway layer, two configuration decisions matter now:
-
Set
response_inclusion: "excluded"for agent pipelines that use dynamic filtering. The cost reduction is immediate and requires no model or prompt changes. The only caveat is that your response handling code must not depend on those echoed search blocks for downstream processing — if it does, keep the default"full". -
Update to
code_execution_20260521for code-heavy agents. The 90-second per-cell limit in the tool description gives Claude the context it needs to plan cell boundaries intelligently. This is particularly relevant for document analysis, data extraction, or verification pipelines that run long Python cells.
Both updates are opt-in, backward-compatible, and require no changes to your routing policy itself — just the tool definition field in your request.
Decision checklist
Before switching tool versions in production:
- Confirm your provider path supports dynamic filtering (direct Anthropic API, Claude Platform on AWS, Microsoft Foundry — not Bedrock or Vertex AI)
- Verify your fallback model chain includes only models that support
web_search_20260318 - Check that your response handling code does not parse echoed search result blocks for downstream logic
- Measure
usage.output_tokenson a sample before switching to establish a baseline for the cost comparison - Apply
response_inclusion: "excluded"only on request paths where code execution dynamic filtering is enabled — requests without code execution return the same output under both settings

Claude API: Compaction on Demand and the `auto` Permission Mode Change Your Agentic Loop Design
Two new Claude API betas: `compact-2026-09-04` moves summarization off the critical path into a background call, and the `auto` permission mode shifts tool trust evaluation from your code to the server. Both change how you design stateful agentic loops.

Claude Code Execution: How the 90-Second Cell Budget Works (and What Operators Need to Fix)
Anthropic's code execution tool now tells Claude about its 90-second per-cell time limit before it writes any code — reducing detection_timeout failures. What changed, which models support it, and the pipeline fixes operators need (including Haiku 4.5 routing gotchas).

Claude Opus 5.5: Four Breaking API Changes and What They Mean for Your Routing Setup
Four breaking changes in Claude Opus 5.5: thinking can't be disabled, forced tool_choice returns 400, thinking blocks don't cross non-Fable/Mythos models, and computer_20251124 is gone. Each has a specific fix — three carry fallback routing implications the announcement skips.