Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.perplexity.ai/llms.txt

Use this file to discover all available pages before exploring further.

A collection of practical guides, runnable examples, and integration patterns for building with Perplexity’s API Platform — covering the Agent API, Search API, Embeddings API, and Sonar API.

How to Use This Cookbook

Guides

Practical deep-dives on patterns that go beyond the docs — structured outputs, function calling, RAG pipelines, and cross-cutting best practices.

Examples

Runnable projects covering every API. From research assistants and news monitors to document Q&A and image analysis — with Python and TypeScript.

Integration Guides

Connect Perplexity with external frameworks like the OpenAI Agents SDK, LangChain memory systems, and persistent storage.

Community Showcase

Real-world applications built by the community — see what others are building with the API Platform.

Quick Start

1

Get API Access

To use the Perplexity API Platform, you’ll need an API key. If you don’t have one yet:

Get your Perplexity API Key

Navigate to the API Keys tab in the API Portal and generate a new key.
2

Install the SDK

The Perplexity API SDK is available in Python and TypeScript. Install the package for your preferred language:
pip install perplexityai
3

Pick a Starting Point

The Perplexity API Platform supports a wide range of use cases across its different APIs. Here are some recommended starting points based on your goals:

What’s Covered