Perplexity Sonar
OpenClaw can use Perplexity Sonar for the web_search tool. You can connect through Perplexityβs direct API or via OpenRouter.
API options
Perplexity (direct)
- Base URL: https://api.perplexity.ai
- Environment variable: PERPLEXITY_API_KEY
OpenRouter (alternative)
- Base URL: https://openrouter.ai/api/v1
- Environment variable: OPENROUTER_API_KEY
- Supports prepaid/crypto credits.
Config example
{
tools: {
web: {
search: {
provider: "perplexity",
perplexity: {
apiKey: "pplx-...",
baseUrl: "https://api.perplexity.ai",
model: "perplexity/sonar-pro"
}
}
}
}
}
Switching from Brave
{
tools: {
web: {
search: {
provider: "perplexity",
perplexity: {
apiKey: "pplx-...",
baseUrl: "https://api.perplexity.ai"
}
}
}
}
}
If both PERPLEXITY_API_KEY and OPENROUTER_API_KEY are set, set tools.web.search.perplexity.baseUrl (or tools.web.search.perplexity.apiKey) to disambiguate.
If no base URL is set, OpenClaw chooses a default based on the API key source:
- PERPLEXITY_API_KEY or pplx-... β direct Perplexity (https://api.perplexity.ai)
- OPENROUTER_API_KEY or sk-or-... β OpenRouter (https://openrouter.ai/api/v1)
- Unknown key formats β OpenRouter (safe fallback)
Models
- perplexity/sonar β fast Q&A with web search
- perplexity/sonar-pro (default) β multi-step reasoning + web search
- perplexity/sonar-reasoning-pro β deep research
See Web tools for the full web_search configuration.