Skip to content

Perplexity API and MCP

Perplexity provides web search and language model answers with source citations. An agent can search web sources and request cited answers for research. Add your Perplexity key once in Longwave settings; calls run on your vendor account.

Add to Longwave

Add Perplexity to your agent

Paste this into Claude Code or a terminal. Then run /mcp to sign in.

functions
5
lowest price
$0.005/call
access
Your key
tasks
2

Use Perplexity on Longwave

  1. Download Longwave or open app.longwave.run.
  2. Add your Perplexity API key once in Longwave settings. Calls run on your Perplexity account at Perplexity's price.
  3. Ask for the result in any thread, for example: “Find sources for a company research brief”. The agent picks the Perplexity function and calls it.

Use Perplexity in Claude Code, Codex, Cursor or ChatGPT

Add the Longwave MCP server once. It carries 2,593 functions across 103 tools, including Perplexity, and asks you to sign in on first use.

Why call Perplexity through Longwave

  • Your Perplexity key is stored once, encrypted, and used by every harness and device you use.
  • One MCP server for 103 tools, so your agent setup does not grow a key and a server per vendor.
  • Spending limits per key and per account, checked before a paid call is made.
  • Each call is recorded with the provider, the cost and the result, and can be read again from another device.

Perplexity functions

Perplexity 4

Function Price
Get a response from Perplexity Accepts a model name, conversation messages and an output token limit and returns a generated response to the supplied conversation. perplexity.sonar.generate
The selected model and usage determine the charge; no single per-call price applies to this function.
Embed text with Perplexity Accepts up to ten texts and an embedding model and returns an int8 embedding vector for each text, encoded as base64. perplexity.text.embed
$0.004 per 1M input tokens pplx-embed-v1-0.6b: $0.004 per million input tokens. pplx-embed-v1-4b costs $0.03 per million input tokens.
List asynchronous Perplexity requests Returns asynchronous chat completion requests for the account without requiring input parameters. perplexity.openapi.get.v1.async.sonar
The selected model and usage determine the charge; no single per-call price applies to this function.
Get a response from Perplexity (queued result) Accepts a request ID and returns the response to an asynchronous chat completion request. perplexity.openapi.get.v1.async.sonar.api_request
The selected model and usage determine the charge; no single per-call price applies to this function.

Web 1

Function Price
Search the web with Perplexity Accepts a search query and returns web search results and relevant page contents. perplexity.web.search
$0.005 per call Standard Search API: $5 per 1,000 successful requests, including up to 20 results. Fast Search costs $1 per 1,000. No token fee.

Prices are Perplexity's published rates. Source: Perplexity pricing.

Use cases

Questions people ask

How do I get a Perplexity API key?

Sign in to Perplexity and create a key at www.perplexity.ai/account/api/keys. Add it once in Longwave settings and your agents' Perplexity calls run on your own account. Perplexity API keys

Do I need a Perplexity account?

Yes. Create a key at https://www.perplexity.ai/account/api/keys and add it in Longwave settings. Longwave stores it encrypted and uses it only for your calls.

What does a Perplexity API call cost through Longwave?

The same as calling Perplexity directly. For example, “Search the web with Perplexity” costs $0.005 per call. Longwave adds no markup. Perplexity pricing

How do I use Perplexity in Claude Code?

Add the Longwave MCP server once with claude mcp add --transport http longwave https://api.longwave.run/v1/mcp/tasks, sign in, and ask for what you need. Claude finds the right Perplexity function and calls it.

Use Perplexity in Longwave

Ask any Longwave thread for the result, or add Longwave to Claude Code, Codex, Cursor or ChatGPT.

Add to Longwave