Vercel AI SDK deprecates openai.tools.webSearchPreview(): switch to webSearch() (October 16, 2026)
@ai-sdk/openai 4.0.96 and @ai-sdk/azure 4.0.104 deprecate webSearchPreview(). Use webSearch(), which takes the same options.
Your keys
0 of 1 ready
Create each key on its own page, paste it below, then copy the finished lines into your project's .env file. What you paste stays in this tab. It is never sent to Wirestack or saved.
- OpenAI API keyOPENAI_API_KEYGet key
Click Create new secret key
3 of 3 free copies left this month.Unlimited with Pro
What you get
On October 16, 2026 @ai-sdk/openai 4.0.96 deprecated the openai.tools.webSearchPreview() tool, and @ai-sdk/azure 4.0.104 deprecated azure.tools.webSearchPreview(). The provider docs say to use openai.tools.webSearch() instead. Both take searchContextSize and userLocation.
Prerequisites
- An OpenAI API key in
OPENAI_API_KEY - An app on the Vercel AI SDK that uses the preview web search tool
Steps
- Update
@ai-sdk/openai(or@ai-sdk/azure). - Replace
openai.tools.webSearchPreview({...})withopenai.tools.webSearch({...})(Azure:azure.tools.webSearch()), keeping the same options.
Test it
Ask a question that needs fresh web results and check the answer cites sources.
Not confirmed
- When
webSearchPreview()will be removed; the release notes give no date.
