Skip to main content

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.
We recommend using our official SDKs for a more convenient and type-safe way to interact with the Embeddings API.

Available Models

ModelDimensionsContextMRLQuantizationPrice ($/1M tokens)
pplx-embed-v1-0.6b102432KYesINT8/BINARY$0.004
pplx-embed-v1-4b256032KYesINT8/BINARY$0.03
pplx-embed-context-v1-0.6b102432KYesINT8/BINARY$0.008
pplx-embed-context-v1-4b256032KYesINT8/BINARY$0.05
All models use mean pooling and require no instruction prefix—you can embed text directly without prompt engineering.
Perplexity embeddings are unnormalized. Always compare base64_int8 embeddings via cosine similarity (not inner product or L2 distance). Compare base64_binary embeddings via Hamming distance. See Best Practices for details and normalization helpers.
When to use which:
  • Standard embeddings (pplx-embed-v1-*) - Independent texts, search queries, single sentences
  • Contextualized embeddings (pplx-embed-context-v1-*) - Document chunks that benefit from shared context (e.g., paragraphs from the same article)

Installation

pip install perplexityai

Authentication

Set your API key as an environment variable:
export PERPLEXITY_API_KEY="your_api_key_here"

Next Steps