Websearch in ChatCompletion API

In the doc https://platform.openai.com/docs/guides/responses-vs-chat-completions?api-mode=responses
it says that the WebSearch tool is available via the Response API as well as via the ChatCompletion API

But how exactly does it work via ChatCompletion? I am always getting an error in the response.

2 Likes

On completions you use specialized models for compatibility:

  • gpt-4o-search-preview
  • gpt-4o-mini-search-preview
2 Likes