packages/perplexity/README.md
The Perplexity provider for the AI SDK contains language model support for Perplexity's Sonar API - a powerful answer engine with real-time web search capabilities.
The Perplexity provider is available in the @ai-sdk/perplexity module. You can install it with:
npm i @ai-sdk/perplexity
If you use coding agents such as Claude Code or Cursor, we highly recommend adding the AI SDK skill to your repository:
npx skills add vercel/ai
You can import the default provider instance perplexity from @ai-sdk/perplexity:
import { perplexity } from '@ai-sdk/perplexity';
import { perplexity } from '@ai-sdk/perplexity';
import { generateText } from 'ai';
const { text } = await generateText({
model: perplexity('sonar-pro'),
prompt: 'What are the latest developments in quantum computing?',
});
Please check out the Perplexity provider documentation for more information.