Skip to Content
NotPixel SDK v1.0.1 — Now with caching, hooks, and browser tracking!
ModelsProvidersPerplexity

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

  1. Go to Perplexity Settings 
  2. Create an account or sign in
  3. Generate a new API key

2. Configure Environment

.env
PERPLEXITY_API_KEY=your-api-key

Usage

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

ModelContext
perplexity/sonar128K
perplexity/sonar-pro200K
perplexity/sonar-reasoning128K
perplexity/sonar-reasoning-pro128K

Environment Variable

VariableDescription
PERPLEXITY_API_KEYYour Perplexity API key