Getting Started with Perplexity API
Getting Started with Perplexity API
Perplexity offers a RESTful API—referred to in developer docs as both the “official Perplexity API” and the “pplx-api”—designed for integration with LLM models such as open-source LLMs (Mistral, Llama, Code Llama, etc.) as well as their own Sonar model.
Perplexity API enables users to connect with Perplexity’s powerful AI models programmatically, allowing them to integrate intelligent responses, search, and reasoning capabilities into their own applications without needing to build AI models from scratch.
What is Perplexity API?
The Perplexity API is an interface that allows developers to access Perplexity’s advanced
AI-powered search and reasoning capabilities. Instead of asking questions directly on the Perplexity platform, developers can use the API to integrate the same functionality into custom applications, websites, or tools. This makes it possible to deliver AI-driven insights, conversational agents, and research features seamlessly inside other environments.
API Billing
Perplexity API usage is billed based on the amount of tokens processed or requests made.
Here’s a simplified look at how API billing works:
Billing Component | Description |
---|---|
API Calls | Each request made to the API is counted as an API call which may be billed based on usage. |
Tokens Used | The input and output tokens processed by the AI influence the overall cost. |
Plan Limits | Different subscription tiers may offer varying quotas and pricing models for usage. |
API Credits
To buy Perplexity API credits, follow these exact steps:
- Create an Account. Sign up for an account on the Perplexity website if you don’t have one already.
- Log in to your account.
- Access the API Settings page. Go to Account Settings >> select the API tab.
- Create New API Group
- Add a Payment Method. In the API tab, find the option API Billing to add your payment information (“Edit Payment” or similar). Enter your billing details and save.
- Purchase API Credits. Once your payment info is saved, you’ll see an option to buy credits directly in the API settings. Choose the amount of credits you want to purchase and complete the transaction.
Steps to create API key
You can authenticate via an API key, generated in your Perplexity account under the API settings tab. Generate API Key. You cannot create an API key with no API credit. API key lets you authenticate your API usage.
Perplexity API Call
Benefits of Using Perplexity API
Some of the benefits of using Perplexity API are as follows:
- Seamless Integration: Easily embed AI-powered reasoning and search into your own applications.
- Time Saving: No need to build machine learning models from scratch; instantly access advanced AI.
- Scalability: Designed to handle a wide range of use cases from small apps to enterprise solutions.
- Enhanced Productivity: Automates information retrieval, research, and content generation.
- Flexible Usage: Works with different programming environments and adapts to diverse workflows.