Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Perplexity

Perplexity

Web-grounded AI answers and a raw web search API.

3 actions API key 3 read0 write Calls api.perplexity.ai

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "perplexity" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Ask with web searchreadperplexity.askAsk Perplexity's Agent API a question and get a web-grounded answer (Agent API with a preset; replaces Sonar chat completions).
InputTypeDescription
inputstringRequiredThe question or prompt
presetstringRequiredTask intensity
instructionsstringOptionalGuidance for the model's behaviour
TypeScript
await setu.execute({
  userId: "user_1",
  action: "perplexity.ask",
  input: {
    "input": "<input>",
    "preset": "<preset>"
  },
});
Chat with Sonarreadperplexity.sonar_chatLegacy Sonar chat completion with web search. Perplexity says Sonar chat completions ended on 2026-09-27 and are being rerouted to the Agent API; prefer ask.
InputTypeDescription
modelstringRequiredSonar model, e.g. sonar
promptstringRequiredThe user message
TypeScript
await setu.execute({
  userId: "user_1",
  action: "perplexity.sonar_chat",
  input: {
    "model": "<model>",
    "prompt": "<prompt>"
  },
});