Skip to main content

Overview

Perplexity’s Agent API is compatible with the OpenAI Responses API, so it works as a drop-in LLM for LiveKit Agents through livekit-plugins-openai’s openai.responses.LLM class, pointed at Perplexity’s base URL.
LiveKit Agents is an open-source framework for building realtime voice and multimodal AI agents. For new integrations, use the Perplexity Agent API via openai.responses.LLM — not the livekit-plugins-perplexity plugin or openai.LLM.with_perplexity(), which both call the legacy Sonar Chat Completions endpoint. Learn more at livekit.io.

Installation

API Key Setup

Set your Perplexity API key as an environment variable and pass it to the constructor:

Get API Key

Generate your API key from the Perplexity dashboard.

Quick Start

Use openai.responses.LLM anywhere a LiveKit AgentSession expects an LLM:
Because the Agent API is OpenAI-Responses-compatible, the OpenAI plugin talks to https://api.perplexity.ai/v1 with no other changes.

Configuration

openai.responses.LLM needs two settings to target Perplexity - base_url and an explicit api_key (the constructor does not read PERPLEXITY_API_KEY on its own):
Perplexity’s built-in tools (like web_search, shown in the Quick Start) attach to the Agent, not to the LLM.

Available Models

The integration works with any model exposed through the Perplexity Agent API, addressed as provider/model (for example openai/gpt-5.6-sol). See the full list on our models page.

LiveKit Agents Docs

Build realtime voice and multimodal agents with LiveKit.

OpenAI Plugin Source

The livekit-plugins-openai source, including the Responses LLM.

Agent API Quickstart

Request, response, and tool contract used above.

Agent API Models

Available models and pricing.

Support

Need help with the integration?