The docs https://platform.openai.com/docs/guides/tools-web-search clearly show an example of using gpt5 with the response API and web search, it goes on to explain how to force the websearch (which was the way to do it with the 4x models)
You can also force the use of the web_search_preview tool by using the tool_choice parameter, and setting it to {type: "web_search_preview"} - this can help ensure lower latency and more consistent results.
However, attempting to add a tool choice parameter to the request returns an error
Tool choices other than ‘auto’ are not supported with model ‘gpt-5’ and the following tool types: ‘web_search_preview’.
Either the docs need to be updated, or (and preferably) the functionality updated to support forcing a web search on the response API
FYI - I did get there eventually by asking the same API question to Gemini, Claude and ChatGPT and finding sometimes one of them guessed right - must set reasoning the at least low, tools = [{“type”: “web_search”}], return_tool_calls_immediately=False, etc.
Still don’t know if I am using optimal API call but at least it works consistently…
Definitely a lot of tokens…
Sticking with Serpapi + gpt5 nano to interpret the results for the time being