Embeddings API
Overview
Section titled “Overview”Perplexity's Embeddings API generates high-quality text embeddings for semantic search and retrieval. Choose between standard embeddings for independent texts or contextualized embeddings for document chunks that share context.
Pricing
Pay-as-you-go pricing for all APIs. No subscription required.
See pricing
Available Models
Section titled “Available Models”| Model | Dimensions | Context | MRL | Quantization | Price ($/1M tokens) |
|---|---|---|---|---|---|
pplx-embed-v1-0.6b |
1024 | 32K | Yes | INT8/BINARY | $0.004 |
pplx-embed-v1-4b |
2560 | 32K | Yes | INT8/BINARY | $0.03 |
pplx-embed-context-v1-0.6b |
1024 | 32K | Yes | INT8/BINARY | $0.008 |
pplx-embed-context-v1-4b |
2560 | 32K | Yes | INT8/BINARY | $0.05 |
All models use mean pooling and require no instruction prefix—you can embed text directly without prompt engineering.
Installation
Section titled “Installation”pip install perplexityainpm install @perplexity-ai/perplexity_aiAuthentication
Section titled “Authentication”Set your API key as an environment variable:
export PERPLEXITY_API_KEY="your_api_key_here"setx PERPLEXITY_API_KEY "your_api_key_here"