Skip to main content

Perplexity Provider Guide

Web-search-augmented generation via Perplexity's Sonar models


Overview

Perplexity hosts a family of LLMs (Sonar, Sonar Pro, Sonar Reasoning) that pair the model with a live web search backend; responses include citations to the documents the model relied on.

Key Facts

  • Protocol: OpenAI-compatible (/chat/completions)
  • Default base URL: https://api.perplexity.ai
  • Default model: sonar
  • Citations: Returned via citations field on the response
  • Streaming: Yes
  • Tool calling: No

Quick Start

1. Get an API Key

https://www.perplexity.ai/settings/api

2. Configure

PERPLEXITY_API_KEY=pplx-your-key
PERPLEXITY_MODEL=sonar

3. Generate

import { NeuroLink } from "@juspay/neurolink";
const ai = new NeuroLink();
const result = await ai.generate({
provider: "perplexity",
input: { text: "What did the Fed announce yesterday?" },
});
console.log(result.content);

Supported Models

Model IDNotes
sonarDefault; fast search-augmented chat
sonar-proLarger context, deeper search
sonar-reasoningChain-of-thought reasoning

CLI Usage

pnpm run cli generate "What were today's tech-stock movers?" --provider perplexity

Provider Aliases

AliasExample
perplexity--provider perplexity

Configuration Reference

Environment VariableRequiredDefault
PERPLEXITY_API_KEYYes
PERPLEXITY_MODELNosonar
PERPLEXITY_BASE_URLNohttps://api.perplexity.ai

Feature Support Matrix

FeatureSupport
Text generationYes
StreamingYes
Tool callingNo
Structured outputLimited
Web searchYes (native)
CitationsYes

See Also