Giving AI models live search without provider lock-in
Large language models are constrained by their training cutoffs. Ask one about breaking news, live prices, or a newly released API version and you'll likely get a stale answer—or none at all. Vercel's AI Gateway addresses this with provider-agnostic web search, letting you attach live search to any model it supports, from OpenAI and Anthropic to Google and beyond.
The setup is minimal. In the AI SDK, import gateway.tools.perplexitySearch() from @ai-sdk/gateway and pass it to any model as a tool named perplexity_search. When the model decides it needs current data, it runs the search automatically and folds the results into its reply.
Why Perplexity search over native options
Not every model ships with built-in web search. Perplexity search fills that gap uniformly across all models available through AI Gateway. This is especially valuable in production settings where you switch between models for cost, failover, or A/B testing: native search tools differ by provider, but Perplexity behaves the same no matter which model is behind it.
Developer tooling is another area where current information matters. Code assistants can give better answers when they have access to up-to-date package versions, recent pull requests, release notes, and documentation changes. Outdated data in these tools can lead to broken builds or security gaps. Similarly, agents monitoring pricing shifts, service outages, job listings, or announcements need near real-time data to be useful, and Perplexity search delivers that without requiring custom data pipelines.
When to use provider-specific tools
AI Gateway also supports native web search from Anthropic, OpenAI, and Google. Those tools are tuned for their respective models and can offer extra features. Perplexity is the right choice when you want consistent search behavior across different models, or when your model's provider lacks a native search option. Full details on all available choices are in the web search documentation.
Cost
Perplexity web search through AI Gateway is billed at $5 per 1,000 requests, with no markup. For more detail, see Perplexity's pricing page.



