Skip to main content

Overview

The livekit-plugins-perplexity package wraps Perplexity’s OpenAI-compatible chat completions endpoint at https://api.perplexity.ai so it can be used as a drop-in LLM for LiveKit Agents.
LiveKit Agents is an open-source framework for building realtime voice and multimodal AI agents. The Perplexity plugin lets a voice agent answer with web-grounded, citation-backed responses. Learn more at livekit.io.

Installation

API Key Setup

Set your Perplexity API key as an environment variable, or pass it directly to the constructor:

Get API Key

Generate your API key from the Perplexity dashboard.

Quick Start

Use perplexity.LLM anywhere a LiveKit Agent expects an LLM:
The plugin reuses the OpenAI plugin’s chat completions transport with base_url="https://api.perplexity.ai" and forwards an X-Pplx-Integration attribution header on every outgoing request.

Configuration

perplexity.LLM accepts the same options as the underlying OpenAI-compatible client:

Available Models

The plugin works with any model exposed through the Perplexity Agent API. sonar-pro is the default. See the full list on our models page.

LiveKit Agents Docs

Build realtime voice and multimodal agents with LiveKit.

Perplexity Plugin Source

Plugin source in the livekit/agents monorepo.

PyPI Package

View on PyPI.

Agent API Quickstart

Learn more about the OpenAI-compatible Perplexity Agent API.

Support

Need help with the integration?