> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/ai/multi-models/perplexity-integration.md). Agents can also search and read this documentation through its [MCP server](https://dnotifier.gitbook.io/product-docs/~gitbook/mcp).

# Perplexity integration

`provider` value: `perplexity`

Perplexity (Sonar, etc.) is the one you reach for when the answer should lean on current web context. Configure the Perplexity connection in the portal, then call it like any other provider.

Models you'll often see: `sonar`, `sonar-pro` — again, use what your connection lists.

## Quick start

1. **Projects** (pick the project) → **AI Studio** → **Providers** → **Perplexity** → API key (or subscription).
2. Connect the SDK.
3. Send:

{% tabs %}
{% tab title="JavaScript" %}

```js
await notifier.sendAI({
  senderId: USER_ID,
  provider: "perplexity",
  model: "sonar-pro",
  message: {
    messages: [
      {
        role: "user",
        content: "What changed in React Server Components lately? Mention sources.",
      },
    ],
  },
  saveHistory: true,
});
```

{% endtab %}

{% tab title="Python" %}

```python
await notifier.send_ai(
    sender_id=user_id,
    provider="perplexity",
    model="sonar-pro",
    message={
        "messages": [
            {
                "role": "user",
                "content": "What changed in React Server Components lately? Mention sources.",
            }
        ],
    },
    save_history=True,
)
```

{% endtab %}

{% tab title="Dart" %}

```dart
await notifier.sendAI(
  senderId: userId,
  provider: 'perplexity',
  model: 'sonar-pro',
  message: {
    'messages': [
      {
        'role': 'user',
        'content':
            'What changed in React Server Components lately? Mention sources.',
      },
    ],
  },
  saveHistory: true,
);
```

{% endtab %}
{% endtabs %}

A pattern that works well in practice: Perplexity gathers notes, Claude or GPT turns them into the final draft. See [Research then write](https://dnotifier.gitbook.io/product-docs/tutorials/tutorials/research-then-write.md).

```js
const researcher = DNotifier.defineAgent({
  name: "researcher",
  provider: "perplexity",
  model: "sonar-pro",
  async run(ctx) {
    return ctx.sendAI({
      message: { text: ctx.input.query },
      saveHistory: false,
    });
  },
});
```

[Overview](https://dnotifier.gitbook.io/product-docs/ai/multi-models.md) · [Azure AI](https://dnotifier.gitbook.io/product-docs/ai/multi-models/azure-ai-integration.md)
