Skip to main content

Perplexity

Perplexity AI Integration​

Integrate your application with the Perplexity AI to harness advanced AI capabilities powered by Meta’s Sonar. This documentation outlines the integration process, key features, and supported operations.


Introduction​

The Perplexity AI enables seamless communication with Sonar, empowering you to build AI-driven features such as conversational AI and more.

This guide provides essential integration details, including supported operations and usage examples.


Prerequisites​

Before using the Perplexity AI, ensure you have:

  • A Perplexity AI Console account.
  • An API key for secure authentication.
  • Python 3.7+ or TypeScript 4.5+ (if using the SDKs).
  • For step-by-step setup instructions, refer to the Perplexity AI documentation.

Supported Authentication Methods​

  • API Key

Basic Operations​

  • Chat Completion: Generate responses powered by Sonar's AI capabilities.

The Chat Completion operation allows interaction with Sonar to:

  • Generate AI responses.
  • Complete prompts with appropriate responses.
  • Facilitate single-turn or multi-turn conversations.
  • While configuring the integration please ensure that

Key Features​

  • Models Support: Use any of (sonar-reasoning-pro, sonar-reasoning, sonar-pro, sonar) models to achieve desired output with optimal costs.
  • Text Input and Output: Submit prompts either as (user, assistant, system) to receive AI-generated responses and control the model's behaviour.
  • Temperature Control: Adjust the creativity level of Sonar's responses.
  • Token Limitation: Limit the output tokens generated by the model to save costs.
  • Conversation Continuation: Generate the next message in a conversation based on input messages.