The Perplexity AI API: What to know before you build (2026)

Kenneth Pangan
Written by

Kenneth Pangan

Katelin Teen
Reviewed by

Katelin Teen

Last edited September 8, 2026

Expert Verified
A practical guide to the Perplexity AI API: what to know before you build

The Perplexity AI API is useful when an application needs search, researched answers, or access to models. For customer support, the key question is not simply whether an answer includes citations. It is whether the answer uses the right information for that customer and your business.

As checked on September 8, 2026, Perplexity recommends its Agent API for new projects. Its Sonar migration guide says Sonar Chat Completions is supported until September 27, 2026. If you are following an older tutorial, check the endpoint, model names, and response parsing before copying its code.

This guide covers the API choices, the responsibilities that remain with your application, and a separate option for support operations: using eesel CLI to configure and work with an existing teammate.

What is the Perplexity AI API?

Perplexity’s current quickstart describes four core APIs. They serve different purposes, so “send a question to Perplexity” is not a complete implementation choice.

APIMain purposeWhat your application receives or uses
Agent APIWeb-grounded answers and agent workflowsGenerated output, sources, and tool activity
Search APISearch without an LLM-generated answerRanked web results
Router APIModel access through a shared endpointOutput from the selected model
Embeddings APISemantic search and related text tasksVector representations of text

A research assistant might use Agent API to produce an answer with sources. A custom retrieval pipeline might use Search API and handle synthesis itself. Embeddings serve a different job again: they represent text for similarity search, rather than answer the user’s question.

What changes from Sonar to Agent API?

The older Sonar Chat Completions pattern sends a messages array and reads choices. Agent API uses input and a typed output array. The result can contain different item types, including the answer and search results.

That means migration is more than selecting another model name. Review how you send context, request search, and extract sources. Perplexity’s migration documentation also describes presets and tools, including web search, URL fetching, MCP, and custom functions.

Perplexity is not limited to public-web answers. MCP and custom functions can extend an Agent API application with private data and business tools. That access still needs authorization and an implementation. It does not automatically connect your helpdesk or establish which internal document should take precedence.

Getting started without exposing credentials

Generate an API key in the Perplexity API Console, choose the API for your task, and follow its current quickstart. Use an environment variable or secret manager rather than embedding the key in frontend code or committing it to a repository.

Begin with a small set of representative requests. For research, check whether the cited pages actually support the answer and whether their dates fit the question. For an action-taking application, test what happens when the required information or permission is missing.

Perplexity also offers a terminal CLI. Its pplx command returns structured search results for shell workflows and coding agents. That is useful for gathering external information, but it is a different tool from eesel CLI, which operates an eesel teammate.

Pricing and reliability: Measure your own workload

Use Perplexity’s pricing documentation for the chosen API and model. Costs can include model tokens and tool or request charges, depending on the route you use. A short user question does not necessarily mean a short execution when an agent performs several research steps.

Pricing differs across APIs and models. Inspect actual usage and compare ordinary requests with long, tool-heavy ones before forecasting volume.

For reliability, separate three checks: did the request complete, did the answer follow the source, and was that source appropriate? A citation makes verification possible; it is not proof that the answer is correct.

Your application also needs timeout handling, rate-limit handling, retries, and monitoring. If tools can change business records, ensure a retry cannot silently repeat an action. Those are application responsibilities, not reasons to dismiss a research API as unsuitable for production.

Where company support knowledge changes the decision

Consider a customer asking whether an opened item can be returned. A general web result about consumer returns may be useful background, but it is not necessarily your policy. The answer may depend on the item, purchase date, region, and exceptions approved by your team.

You can build those connections and rules into a custom application. Or, if the desired outcome is a support teammate working with existing tools, evaluate a helpdesk teammate that already provides that product experience.

The distinction is responsibility, not “public data versus private data.” Perplexity can participate in a private-data application. eesel supplies the support-focused teammate; its CLI gives developers and coding agents a way to configure and inspect that teammate.

Use eesel CLI for company-grounded support work

eesel CLI lets you inspect connections, upload knowledge, review instructions, chat with a teammate, and examine its activity from a terminal. It operates the same agent and workspace as the dashboard, not a separate terminal-only assistant.

That makes it useful alongside a developer’s existing research workflow. A coding agent can gather public documentation through a research tool, then use eesel CLI to inspect the support setup. Decide explicitly which information belongs in company knowledge; do not automatically turn web research into policy.

With Node.js 18.17 or newer, start by logging in to your existing workspace:

Bash
npx @eesel/cli login
npx @eesel/cli whoami
npx @eesel/cli agents

Choose the intended agent and replace AGENT_ID below with its ID:

Bash
npx @eesel/cli integrations --agent AGENT_ID
npx @eesel/cli status --agent AGENT_ID
npx @eesel/cli instructions --agent AGENT_ID

These commands show the connected systems, whether connected content has downloaded, and the teammate’s standing rules. They do not establish that every source is current policy or that every answer will be correct.

Add an approved policy and check its use

For the returns example, upload the document your team has approved:

Bash
npx @eesel/cli files upload ./approved-returns-policy.pdf --agent AGENT_ID

The upload adds knowledge. It does not change standing instructions or resolve contradictions with another source. Review the instructions separately, including when the teammate should ask for more information or escalate to a person.

Then test representative questions on an agent with appropriate action restrictions. Include one question the policy answers, one missing a required detail, and one asking for an exception. Inspect the answer and activity. CLI chat can take actions, so treat it as interaction with the teammate rather than an inherently read-only search.

For helpdesk knowledge, inspect the relevant integration setup. eesel supports connections such as Zendesk and Freshdesk; some setup steps require browser authorization.

Let a coding agent inspect results

The CLI prints JSON, so Claude Code, Cursor, or Codex can read a command’s result and decide what to inspect next. Give it a bounded task such as “check the selected agent’s sources and instructions, report conflicts, and ask before making changes.”

That instruction limits the coding agent’s task. It is distinct from eesel’s approval process for actions awaiting review. The CLI also exposes activity, automations, and approvals so you can inspect ongoing work and review those actions.

Use --help for command options. For writes, --dry-run prints the server call without sending it; it does not simulate an answer. Headless scripts can use EESEL_API_URL and EESEL_API_TOKEN, with explicit agent scope. Keep these credentials separate from your Perplexity API key and out of source control.

This is not a built-in Perplexity-to-eesel integration. You decide whether the tools belong in the same workflow and review any information transferred between them.

Choose based on the work you want to own

Choose Perplexity’s APIs when you need research, search, model access, or a custom agent application. Measure its performance on the sources and tasks your users need.

Choose eesel when you want to operate a support teammate with connected company knowledge. Its CLI lets technical users configure and inspect that product while the support team uses the same dashboard.

eesel AI helpdesk dashboard overview. CLI operations use the same teammate and workspace available to the support team.
eesel AI helpdesk dashboard overview. CLI operations use the same teammate and workspace available to the support team.

Try eesel. Once your workspace and teammate are set up, use the CLI to inspect the knowledge and instructions for one support scenario before expanding the rollout. Check current eesel pricing separately; using the CLI does not move its usage onto your Perplexity account.

Frequently asked questions

What is the Perplexity AI API used for?
Perplexity offers APIs for agent applications, ranked web search, model routing, and embeddings. Choose the API based on whether you need a generated answer, search results, model access, or vector representations of text.
Should a new project use Sonar Chat Completions?
Perplexity recommends the Agent API for new projects and migration from Sonar Chat Completions. Its documentation states that Sonar Chat Completions is supported until September 27, 2026. Check the migration guide for request and response changes.
Does Perplexity only work with public web information?
No. Its Agent API supports tools such as MCP and custom functions that can connect to private data. You still need to implement and authorize those connections and decide which sources are appropriate for the task.
How should I estimate Perplexity API costs?
Use the current rates for your selected API, model, and tools, then inspect actual usage on representative requests. Compare ordinary requests with longer, tool-heavy tasks before estimating production costs.
Does eesel CLI replace the Perplexity API?
No. Perplexity supplies APIs for applications and research workflows. eesel CLI operates an eesel teammate, including its knowledge connections, instructions, conversations, and activity. They address different parts of a workflow.
Can a coding agent use eesel CLI?
Yes. A coding agent such as Claude Code, Cursor, or Codex can run commands and read JSON results. It acts on the same eesel agent and workspace available in the dashboard, so scope the task and any changes explicitly.
Does uploading research make it company policy?
No. Uploading a document adds knowledge, not authority or new standing instructions. Review external research before adding it, distinguish it from approved policy, and test how the teammate handles conflicting information.

Share this article

Kenneth Pangan

Article by

Kenneth Pangan

Writer and marketer for over ten years, Kenneth Pangan splits his time between history, politics, and art with plenty of interruptions from his dogs demanding attention.

Related Posts

All posts →
A deep dive into OpenAI ChatKit advanced samples or examples: What to know before you build
Guides

A deep dive into OpenAI ChatKit advanced samples or examples: What to know before you build

Exploring OpenAI's ChatKit for your next AI project? This guide breaks down advanced ChatKit examples, reveals the true setup complexity, and compares it to out-of-the-box solutions designed for customer support.

Stevia PutriStevia PutriOct 12, 2025
Text and image inputs moving through risk flags to a human reviewer
Guides

OpenAI Moderation API: build a safer support review flow

Learn what OpenAI Moderation API signals mean, how to route flagged support content safely, and how eesel CLI helps test the support workflow around them.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
Blue waveform icon on an abstract blue and purple background
Guides

OpenAI Audio Speech API: what to build and test in 2026

Understand the OpenAI Audio Speech API for text-to-speech, transcription, and realtime voice work, then separate the model infrastructure from the support workflow you operate.

Rama Adi NugrahaRama Adi NugrahaOct 12, 2025
Perplexity Comet AI browser pricing breakdown illustration
Guides

Perplexity Comet pricing in 2026: Everything you need to know

Perplexity Comet's browser is free - but the AI features that make it useful cost up to $200/month. Here's what you get at every price point.

Rama Adi NugrahaRama Adi NugrahaJun 9, 2026
A practical Perplexity overview for business teams (2025)
Guides

Perplexity review (2026): What business teams need to know

Dive into our complete Perplexity overview for 2025. Learn how the AI answer engine works, its pros and cons for business, and why specialized tools may be better for support.

Kenneth PanganKenneth PanganSep 25, 2025
Forefront AI Review: What you need to know before trying it
Guides

Forefront AI Review: What you need to know before trying it

Forefront AI gives developers deep control over open-source models, but it’s complex, support-light, and not built for business teams.

Kenneth PanganKenneth PanganJul 24, 2025
Slack and Perplexity logos in separate white circles
Guides

Brave Leo vs Perplexity AI (2026): privacy, research, and browsing

Compare Brave Leo and Perplexity AI for private browser help, cited research, data controls, and browser actions, with a practical support workflow.

Stevia PutriStevia PutriOct 26, 2025
A person wearing headphones beside a large blue browser icon with a white arrow.
Guides

ChatGPT Atlas pricing: what to know after its discontinuation

Atlas has been discontinued. Understand the difference between its old browser access and current ChatGPT subscriptions, then budget for the workflow you need.

Kenneth PanganKenneth PanganOct 26, 2025
A blue browser icon with a white arrow above a dark reflective tiled surface.
Guides

ChatGPT Atlas vs Perplexity AI: what changed after Atlas

ChatGPT Atlas was discontinued in August 2026. See what that means for the comparison, how Perplexity approaches cited research, and how to turn verified research into a reusable teammate answer.

Stevia PutriStevia PutriOct 26, 2025

Ready to hire your AI teammate?

Set up in minutes. No credit card required.

Get started free