The Perplexity API, also known as the Sonar API, brings the power of real-time web search into your AI applications. Unlike traditional LLMs that rely solely on pre-trained knowledge, Perplexity combines large language model capabilities with live search results—offering up-to-date, grounded, and citation-rich responses.

Whether you're building research assistants, news summarizers, or domain-specific Q&A tools, the Perplexity API delivers accurate, explainable outputs through a flexible and OpenAI-compatible interface.

What You’ll Learn

  • What the Perplexity API is and how it differs from traditional LLM APIs
  • The core capabilities of the API
  • How to select the right model
  • Step-by-step instructions to setup your API key
  • Create a workflow to use Perplexity with the API key
  • Pro tips for performance, cost, and reliability

Subscribe now to unlock the full article and gain unlimited access to all premium content.

Subscribe

The Perplexity API, also known as the Sonar API, brings the power of real-time web search into your AI applications. Unlike traditional LLMs that rely solely on pre-trained knowledge, Perplexity combines large language model capabilities with live search results—offering up-to-date, grounded, and citation-rich responses.

Whether you're building research assistants, news summarizers, or domain-specific Q&A tools, the Perplexity API delivers accurate, explainable outputs through a flexible and OpenAI-compatible interface.

What You’ll Learn

  • What the Perplexity API is and how it differs from traditional LLM APIs
  • The core capabilities of the API
  • How to select the right model
  • Step-by-step instructions to setup your API key
  • Create a workflow to use Perplexity with the API key
  • Pro tips for performance, cost, and reliability

What is the Perplexity API?

At its core, the Perplexity API is a real-time research assistant designed for developers. It offers:

  • Real-time web search to augment model responses
  • Multiple reasoning and research models with deep context support
  • Domain filtering, JSON schema output, and regex formatting
  • A dual-prompt structure (system + user) for flexible control
  • Compatibility with OpenAI client libraries

It’s ideal for building AI products that need factual accuracy, recent knowledge, and structured output at scale.

Core Capabilities

  • Search Modes: Choose high, medium, or low search depth to balance quality vs. cost.
  • Domain Filtering: Focus or exclude specific websites to control where information is pulled from.
  • Structured Output: Return results as validated JSON schema or regex-based patterns.
  • System + User Prompting: Separate styling/tonality from query logic.
  • Streaming: Support for real-time token output.

Model Categories

When to Use Which Model

  • sonar: For fast factual queries at low cost.
  • sonar-pro: When you need grounded responses across multiple sources.
  • sonar-deep-research: Ideal for full reports, market analysis, or literature reviews.
  • sonar-reasoning / reasoning-pro: Great for recommendation systems, trade-off analysis, or expert Q&A.
  • r1-1776: Use when offline reasoning is preferred, or internet access is restricted.

Pricing Snapshot

How to Get Started

Step 1: Sign Up & Get API Key

  • Click on "Generate" and it will generate a key for, copy it and store it in a secure location

Step 2: Use the API key in your workflow or app

For the purpose of demonstration, we are going to create a workflow on make.com with our API key.

We will create a workflow to watch for submissions on a Tally form, store them in a database and then use Perplexity to respond to the submission with a personalized email.

To begin, these are the fields we are capturing in the Tally form. We have also created an Airtable database with the same fields, to store the information received with each submission.

Form fields :

Airtable Database:

We start by adding the Tally and Airtable modules to capture and store the information.  The scenario performs the following tasks :

  1. Listens for submissions on the Tally form
  2. Captures the field info from the submission and stores in Airtable
  3. Retrieves entries from the Airtable that have received

Next, we want the retrieved entries to be be passed to perplexity for an email response. Lets setup the perplexity module and connection with our API key.

After the Airtable search records module, add a Perplexity AI Module and select “Create a chat Completion”

Click on “Add” to create a new Perplexity connection, give the connection an appropriate name and paste in the API key you captured from your Perplexity settings page. Hit save.

Once the connection is made, the model selector populates the available models and we’re ready to give it some instructions.

We will use Sonar Pro for this workflow, choose it from the dropdown and click on “Add item” under messages. The first message will be a “System” message with exact instructions (prompt) to analyze the fields of the form submission and create a personalized email message.

For our System instructions, we will use the following prompt :

"You are a professional AI assistant tasked to follow up with people who fill out an inbound lead form. Use the provided form details to research the company and individual to generate a personalized, concise email in an encouraging and professional tone.

The email should have a Subject and Body.

For the Subject:

  • Keep it concise and direct, based on the information they shared in the lead.
  • It should never sound sensational or clickbait-like.
  • Limit to 10 words.

For the Body, follow these instructions:

  1. Reference their AI usage or role and acknowledge it. Pay attention to their "Current AI Usage", which they submit with the lead. If it is an individual need or a company need, respond accordingly. If the request sounds personal, target your email towards the individual's needs, not the company’s. Sound encouraging, not too excited and always grounded.
  2. Mention 1 company-specific insight, if available (based on your research of the company). If you cannot find any information on the company or appropriate insights, share a fact about how their industry is using AI. The fact should be grounded and not sound salesy or esoteric. It should also be very brief and concise.
  3. Feel warm, helpful, and curious (not salesy). Do not offer solutions or advice based on facts you have uncovered.
  4. End with a simple invitation to connect or book a call. The invitation should be polite and only targeted towards understanding more about them and their needs, without offering any advice yet.

Formatting instructions:

  • Return your response ONLY in valid JSON format. DO NOT BREAK JSON STRUCTURE. DO NOT INCLUDE THE WORD 'JSON' IN YOUR RESPONSE
  • In the "body" field, format paragraphs using real line breaks (by pressing Enter). Do not write \\\\n, \\\\\\\\n, or use Markdown or HTML.
  • Keep the tone warm, concise, and easy to read.
  • Include the calendar link and sign-off at the end of the email body: https://cal.com/sash-test/30min
  • Use this exact structure:

{"subject": "Your short subject line here","body": "Hi [First Name],\n\n[Paragraph 1]\n\n[Paragraph 2]\n\nFeel free to grab a quick 30-minute slot here: https://cal.com/sash-test/30min\\\\n\\\\n Looking forward to connecting,\n"}"

Once the system message is added, click save and then click on “Add item” again to create the user message, where we will pass the fields from the form submission to perplexity.

With this message, Perplexity can then research the information based on the system instructions and provide us with an email, formatted in JSON.

Click save and now we have Perplexity connected to our database using its API. We made a test submission and ran the scenario.

Now, lets look at the input and Output for our Perplexity Module. We can see that both the system and user messages were sent as input to Perplexity, including the details from the form submission.

Next, scroll down to the Output section, expand “Choices” and find “Messages”. Here we can see the output from Perplexity, which is a neatly structured personal email with context from the information that was submitted in the form.

In summary :

  • We connected to Perplexity using an API key
  • Pass system instructions to write and email, along with contextual information from our form submission.
  • Received a JSON structured output from Perplexity, which now can be parsed for the subject and body.

To completely the workflow,

  • we added a JSON parser to parse the output from Perplexity
  • Add HTML markdown formatting and error handling
  • Added Gmail to send the email
  • Update the status in the Airtable to mark a submission as “Responded”

If you are using code, you can use curl or Python to make a similar API call with system and user messages. For information, check out Perplexity’s API documentation.

Rate Limits and Usage Tiers

Perplexity uses a tiered credit system to define rate limits and unlock advanced features:

Usage Tiers (Based on Lifetime Credit Purchase)

Higher tiers offer increased rate limits and access to beta features.

Model Rate Limits & Feature Access

To view your current tier, go to your API settings page.

Pro Tips

  • Be specific with your system instructions. Iterate and refine till you get the desired results.
  • Use structured output: Leverage JSON outputs, which make it easier to process that data downstream in your app.
  • Match model to task: Don’t overpay—use sonar for simple queries and use reasoning models for more complex tasks.
  • Monitor API usage in your account settings page to understand how much your queries cost. This is extremely useful in cost analysis for any app that your build.

Wrapping Up

The Perplexity API gives developers an edge by combining real-time web search with advanced reasoning and research models. It enables dynamic applications that stay grounded in current facts, with outputs that are explainable, structured, and adaptable to domain-specific needs.

Whether you're powering up research tools, answering real-time questions, or generating structured insights from live information, Perplexity's web-native capabilities help you build smarter apps with Real-time information.

The Perplexity API, also known as the Sonar API, brings the power of real-time web search into your AI applications. Unlike traditional LLMs that rely solely on pre-trained knowledge, Perplexity combines large language model capabilities with live search results—offering up-to-date, grounded, and citation-rich responses.

Whether you're building research assistants, news summarizers, or domain-specific Q&A tools, the Perplexity API delivers accurate, explainable outputs through a flexible and OpenAI-compatible interface.

What You’ll Learn

  • What the Perplexity API is and how it differs from traditional LLM APIs
  • The core capabilities of the API
  • How to select the right model
  • Step-by-step instructions to setup your API key
  • Create a workflow to use Perplexity with the API key
  • Pro tips for performance, cost, and reliability

What is the Perplexity API?

At its core, the Perplexity API is a real-time research assistant designed for developers. It offers:

  • Real-time web search to augment model responses
  • Multiple reasoning and research models with deep context support
  • Domain filtering, JSON schema output, and regex formatting
  • A dual-prompt structure (system + user) for flexible control
  • Compatibility with OpenAI client libraries

It’s ideal for building AI products that need factual accuracy, recent knowledge, and structured output at scale.

Core Capabilities

  • Search Modes: Choose high, medium, or low search depth to balance quality vs. cost.
  • Domain Filtering: Focus or exclude specific websites to control where information is pulled from.
  • Structured Output: Return results as validated JSON schema or regex-based patterns.
  • System + User Prompting: Separate styling/tonality from query logic.
  • Streaming: Support for real-time token output.

Model Categories

When to Use Which Model

  • sonar: For fast factual queries at low cost.
  • sonar-pro: When you need grounded responses across multiple sources.
  • sonar-deep-research: Ideal for full reports, market analysis, or literature reviews.
  • sonar-reasoning / reasoning-pro: Great for recommendation systems, trade-off analysis, or expert Q&A.
  • r1-1776: Use when offline reasoning is preferred, or internet access is restricted.

Pricing Snapshot

How to Get Started

Step 1: Sign Up & Get API Key

  • Click on "Generate" and it will generate a key for, copy it and store it in a secure location

Step 2: Use the API key in your workflow or app

For the purpose of demonstration, we are going to create a workflow on make.com with our API key.

We will create a workflow to watch for submissions on a Tally form, store them in a database and then use Perplexity to respond to the submission with a personalized email.

To begin, these are the fields we are capturing in the Tally form. We have also created an Airtable database with the same fields, to store the information received with each submission.

Form fields :

Airtable Database:

We start by adding the Tally and Airtable modules to capture and store the information.  The scenario performs the following tasks :

  1. Listens for submissions on the Tally form
  2. Captures the field info from the submission and stores in Airtable
  3. Retrieves entries from the Airtable that have received

Next, we want the retrieved entries to be be passed to perplexity for an email response. Lets setup the perplexity module and connection with our API key.

After the Airtable search records module, add a Perplexity AI Module and select “Create a chat Completion”

Click on “Add” to create a new Perplexity connection, give the connection an appropriate name and paste in the API key you captured from your Perplexity settings page. Hit save.

Once the connection is made, the model selector populates the available models and we’re ready to give it some instructions.

We will use Sonar Pro for this workflow, choose it from the dropdown and click on “Add item” under messages. The first message will be a “System” message with exact instructions (prompt) to analyze the fields of the form submission and create a personalized email message.

For our System instructions, we will use the following prompt :

"You are a professional AI assistant tasked to follow up with people who fill out an inbound lead form. Use the provided form details to research the company and individual to generate a personalized, concise email in an encouraging and professional tone.

The email should have a Subject and Body.

For the Subject:

  • Keep it concise and direct, based on the information they shared in the lead.
  • It should never sound sensational or clickbait-like.
  • Limit to 10 words.

For the Body, follow these instructions:

  1. Reference their AI usage or role and acknowledge it. Pay attention to their "Current AI Usage", which they submit with the lead. If it is an individual need or a company need, respond accordingly. If the request sounds personal, target your email towards the individual's needs, not the company’s. Sound encouraging, not too excited and always grounded.
  2. Mention 1 company-specific insight, if available (based on your research of the company). If you cannot find any information on the company or appropriate insights, share a fact about how their industry is using AI. The fact should be grounded and not sound salesy or esoteric. It should also be very brief and concise.
  3. Feel warm, helpful, and curious (not salesy). Do not offer solutions or advice based on facts you have uncovered.
  4. End with a simple invitation to connect or book a call. The invitation should be polite and only targeted towards understanding more about them and their needs, without offering any advice yet.

Formatting instructions:

  • Return your response ONLY in valid JSON format. DO NOT BREAK JSON STRUCTURE. DO NOT INCLUDE THE WORD 'JSON' IN YOUR RESPONSE
  • In the "body" field, format paragraphs using real line breaks (by pressing Enter). Do not write \\\\n, \\\\\\\\n, or use Markdown or HTML.
  • Keep the tone warm, concise, and easy to read.
  • Include the calendar link and sign-off at the end of the email body: https://cal.com/sash-test/30min
  • Use this exact structure:

{"subject": "Your short subject line here","body": "Hi [First Name],\n\n[Paragraph 1]\n\n[Paragraph 2]\n\nFeel free to grab a quick 30-minute slot here: https://cal.com/sash-test/30min\\\\n\\\\n Looking forward to connecting,\n"}"

Once the system message is added, click save and then click on “Add item” again to create the user message, where we will pass the fields from the form submission to perplexity.

With this message, Perplexity can then research the information based on the system instructions and provide us with an email, formatted in JSON.

Click save and now we have Perplexity connected to our database using its API. We made a test submission and ran the scenario.

Now, lets look at the input and Output for our Perplexity Module. We can see that both the system and user messages were sent as input to Perplexity, including the details from the form submission.

Next, scroll down to the Output section, expand “Choices” and find “Messages”. Here we can see the output from Perplexity, which is a neatly structured personal email with context from the information that was submitted in the form.

In summary :

  • We connected to Perplexity using an API key
  • Pass system instructions to write and email, along with contextual information from our form submission.
  • Received a JSON structured output from Perplexity, which now can be parsed for the subject and body.

To completely the workflow,

  • we added a JSON parser to parse the output from Perplexity
  • Add HTML markdown formatting and error handling
  • Added Gmail to send the email
  • Update the status in the Airtable to mark a submission as “Responded”

If you are using code, you can use curl or Python to make a similar API call with system and user messages. For information, check out Perplexity’s API documentation.

Rate Limits and Usage Tiers

Perplexity uses a tiered credit system to define rate limits and unlock advanced features:

Usage Tiers (Based on Lifetime Credit Purchase)

Higher tiers offer increased rate limits and access to beta features.

Model Rate Limits & Feature Access

To view your current tier, go to your API settings page.

Pro Tips

  • Be specific with your system instructions. Iterate and refine till you get the desired results.
  • Use structured output: Leverage JSON outputs, which make it easier to process that data downstream in your app.
  • Match model to task: Don’t overpay—use sonar for simple queries and use reasoning models for more complex tasks.
  • Monitor API usage in your account settings page to understand how much your queries cost. This is extremely useful in cost analysis for any app that your build.

Wrapping Up

The Perplexity API gives developers an edge by combining real-time web search with advanced reasoning and research models. It enables dynamic applications that stay grounded in current facts, with outputs that are explainable, structured, and adaptable to domain-specific needs.

Whether you're powering up research tools, answering real-time questions, or generating structured insights from live information, Perplexity's web-native capabilities help you build smarter apps with Real-time information.