Tool Choice - Forcing Web Search not working

I am attempting to force the web search tool. Using the Responses API. Have tried with GPT 4.1 and GPT 5.1

The error message I get is “Tool choice ‘web_search_preview’ not found in ‘tools’ parameter.”

I have included the web_search tool in the tools array. Not web_search_preview and have passed tools_choice like this.

It suggests something is forcing the web_search_preview tool instead of just web_search

tool_choice: {
type: “web_search”
}

Using the gpt-5.1 API:

“tools”: [{“type”: “web_search”}],

Works for us - working as we speak…

You can force NOT whatever web_search is being mapped to on your org or project as an alias or pointer when you explicitly state a version, only seen documented in the API reference:

"tools":[{ "type": "web_search_2025_08_26" }]

web_search_preview is 2025_03_11, BTW, the date of the Responses API release. It doesn’t support a URL whitelist, the source citation, and also likely doesn’t confer a lower price now offered.

I would not “force” any internal tool. One bug, or the AI actually being forced, and you will get max tool calls with no return.