Perplexity
Access 4 Perplexity models through NotPixel. Authentication is handled automatically using the PERPLEXITY_API_KEY environment variable.
Learn more in the Perplexity documentation .
Setup
1. Get API Key
- Go to Perplexity Settings
- Create an account or sign in
- Generate a new API key
2. Configure Environment
.env
PERPLEXITY_API_KEY=your-api-keyUsage
import Ads from 'notpixel';
const ads = new Ads({
publisherId: 'pub_xxx',
model: 'perplexity/sonar',
input: 'What are the top news stories today?',
});
const response = await ads.offer();
console.log(response.text);NotPixel uses the OpenAI-compatible endpoint of Perplexity. Some provider-specific features may not be available.
Available Models
| Model | Context |
|---|---|
perplexity/sonar | 128K |
perplexity/sonar-pro | 200K |
perplexity/sonar-reasoning | 128K |
perplexity/sonar-reasoning-pro | 128K |
Environment Variable
| Variable | Description |
|---|---|
PERPLEXITY_API_KEY | Your Perplexity API key |