web_search provider with two transports: the
native Perplexity Search API (structured results with filters) and Perplexity
Sonar chat completions, direct or via OpenRouter (AI-synthesized answers with
citations).
This page covers the Perplexity provider setup. For the Perplexity tool (how the agent uses it), see Perplexity search.
Install plugin
Getting started
1
Set the API key
PERPLEXITY_API_KEY or OPENROUTER_API_KEY in the Gateway
environment also works.2
Start searching
web_search auto-detects Perplexity once its key is the available search
credential; no further setup is required. To pin the provider explicitly:Search modes
The plugin resolves transport in this order:webSearch.baseUrlorwebSearch.modelset: always routes through Sonar chat completions against that endpoint, regardless of key type.- Otherwise, key source decides the endpoint: a configured key’s prefix picks the transport (config beats environment variables); an environment key uses its matching endpoint directly.
A configured key with any other prefix also uses the native Search API. The
chat-completions path defaults to the
perplexity/sonar-pro model; override it
with plugins.entries.perplexity.config.webSearch.model.
Native API filtering
Native-only filters return a descriptive error on the chat-completions path.
freshness cannot be combined with date_after/date_before.
Advanced configuration
Environment variable for daemon processes
Environment variable for daemon processes
OpenRouter proxy setup
OpenRouter proxy setup
To route Perplexity searches through OpenRouter, set an
OPENROUTER_API_KEY
(prefix sk-or-) instead of a native Perplexity key. OpenClaw detects the
key and switches to the Sonar transport automatically. Useful if you already
have OpenRouter billing set up and want to consolidate providers there.Related
Perplexity search tool
How the agent invokes Perplexity searches and interprets results.
Configuration reference
Full configuration reference including plugin entries.