Use Perplexity Web Search with Vercel AI Gateway
Blog post from Vercel
AI Gateway introduces a provider-agnostic web search capability that enhances AI models, such as those from OpenAI, Anthropic, and Google, by allowing them to access real-time information from the web, thus overcoming the limitations of static training data. This feature can be implemented with a single line of code using the AI SDK, enabling models that lack native search capabilities to deliver up-to-date responses by integrating Perplexity search. The tool is particularly beneficial in various contexts, including developer tooling, CI assistants, production chatbots, and operational agents, where access to current data is essential for optimal performance. Perplexity search provides consistent functionality across different models and is available at a cost of $5 per 1,000 requests, with no additional markup.