Skip to content

docs(anthropic_tool_search): document OpenAI tool_search on Claude models through /v1/responses - #2701

Merged
mateo-berri merged 2 commits into
mainfrom
litellm_docs_responses_tool_search_claude
Oct 29, 2026
Merged

mateo-berri merged 2 commits into
mainfrom
litellm_docs_responses_tool_search_claude

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Since BerriAI/litellm#45882 (first in v1.107.0-rc.1), /v1/responses turns OpenAI's tool_search tool into Anthropic's regex tool search tool for Claude 4.5 and newer, but no page says so. The tool search page lists only Chat Completions and Messages, and the Responses API page says tool search needs gpt-5.4 or later, so a reader would expect Claude to drop the tool

This adds a "Responses API" section to the Claude tool search page. It covers what the proxy translates, the tool_search_call item it returns (streaming too), follow-up turns, which routes run it, and what is not translated (client execution and tool_search_output). It also adds a Responses API column to the support table and a link from the OpenAI Responses API page

Decisions

The section goes on the Claude tool search page, since a reader who wants Claude to search tools looks there first, and the OpenAI page only links to it. The curl request is case 1 from the #45882 proof, and the response and SDK example come from a live run on litellm main today

The page says client execution with every tool deferred gets Anthropic's 400 All tools cannot be deferred., since the live run shows that answer, and it says a follow-up answer can mention calling a tool without a search, since Claude never sees the dropped search call (#45882's decisions, and turn 2 below)

User Flow

Before: the reader finds nothing that says Claude takes tool_search on /v1/responses

  1. Open https://docs.litellm.ai/docs/providers/anthropic_tool_search. The table lists Chat Completions and Messages only
  2. Open https://docs.litellm.ai/docs/providers/openai/responses_api#tool-search--namespaces. It says tool search needs gpt-5.4 or later

After: the reader sends the documented request to Claude and gets the documented output

  1. Open https://docs.litellm.ai/docs/providers/anthropic_tool_search#responses-api, or follow the new link from the OpenAI page
  2. Copy the config and the curl request, and get the tool_search_call and function_call items the page shows
  3. Send the follow-up turn the SDK example shows, and get Claude's answer

Proof

A no-DB proxy at litellm main a66dc50efb on a random port, with the section's config and anthropic/claude-sonnet-5-5, real Anthropic calls, 2026-10-29 UTC. H holds the auth and JSON headers

$ curl -sS http://127.0.0.1:$PORT/v1/responses "${H[@]}" -d @req1.json -w '\nHTTP %{http_code}\n'
# 2026-10-29T05:33:34Z, output items only
{"id": "tsc_srvtoolu_01F8hTt8WqVTUttskjushEVj", "arguments": {"pattern": "weather|forecast|temperature"}, "call_id": "srvtoolu_01F8hTt8WqVTUttskjushEVj", "execution": "server", "status": "completed", "type": "tool_search_call"}
{"arguments": "{\"city\": \"Paris\"}", "call_id": "toolu_01K24WmFy7Wp67qTowYf2cw3", "name": "get_weather", "type": "function_call", "id": "fc_toolu_01K24WmFy7Wp67qTowYf2cw3", "namespace": null, "status": "completed"}
HTTP 200

$ curl -sS -N ... -d @req_stream.json    # req1 with "stream": true, 2026-10-29T05:33:54Z, event types
response.created, response.in_progress
response.output_item.added 0 tool_search_call arguments={}
response.output_item.added 1 function_call
response.function_call_arguments.delta x3
response.output_item.done 0 tool_search_call arguments={"pattern": "weather|forecast|temperature"}
response.function_call_arguments.done, response.output_item.done 1 function_call, response.completed
HTTP 200

$ curl -sS ... -d @req_turn2_replay.json    # turn 1 output replayed with a function_call_output, 2026-10-29T05:33:57Z
"Paris is cloudy right now, at 18 °C (about 64 °F). I should mention that I called `get_weather` directly. I hadn't searched for it first..."
HTTP 200

$ curl -sS ... -d @req_namespace.json    # tool_search with crm and weather namespaces, members deferred, 2026-10-29T05:33:59Z
{"id": "tsc_srvtoolu_011SEuDweoCsup4GBVehsf2H", "arguments": {"pattern": "crm|customer"}, "execution": "server", "status": "completed", "type": "tool_search_call", ...}
{"arguments": "{\"id\": \"42\"}", "name": "get_customer", "namespace": "crm", "type": "function_call", "status": "completed", ...}
HTTP 200

$ curl -sS ... -d @req_client.json    # req1 with "execution": "client", 2026-10-29T05:33:58Z
{"error": {"message": "litellm.BadRequestError: AnthropicException - ... At least one tool must have defer_loading=false. All tools cannot be deferred. ...", "code": "400"}}
HTTP 400

$ .venv/bin/python sdk_example.py    # the page's SDK example, openai 3.41.0, 2026-10-29T05:35:08Z
Searched with {'pattern': 'weather|forecast|temperature'}
Called get_weather({"city": "Paris"})
It's currently 18°C (about 64°F) and cloudy in Paris.

The Azure, Vertex AI, Bedrock Invoke, and Bedrock Converse rows come from #45882's live proof (cases 27, 12, 7, and 6), and the route gate is _without_unsupported_tool_search in litellm/responses/litellm_completion_transformation/transformation.py on main. scripts/check-docs.py docs and scripts/check-writing-style.js pass

Caveats

Low. Bugbot did not review this PR. A bare bugbot run posted after the last commit got no reaction and no check run within three minutes, so the review is unavailable on this repo today

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
litellm Ready Ready Preview Oct 29, 2026 5:43am UTC

Request Review

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@mateo-berri
mateo-berri merged commit 8f0dacf into main Oct 29, 2026
6 checks passed
@mateo-berri
mateo-berri deleted the litellm_docs_responses_tool_search_claude branch October 29, 2026 05:48

This branch was previously deployed

1 inactive deployment
Preview — 327defaa Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant