Overview
OpenClaw is an open-source AI agent that runs in your terminal and connects to multiple LLM providers, featuring support for Perplexity as a web search provider for real-time information retrieval. You can configure OpenClaw to use Perplexity’s Agent API models as your agent, and the Perplexity Search API for web search tool calls. This allows you to leverage Perplexity’s powerful models and up-to-date search results directly within OpenClaw’s agent framework.Get a Perplexity API Key
Navigate to the API Console and generate a new key to use with OpenClaw.
Search API Setup (Use Perplexity as your Web Search Provider)
Use Perplexity Search API as OpenClaw’s web search backend for real-time information retrieval.Configure the Search Provider
- Interactive CLI (Recommended)
- Config File (JSON)
- Environment Variable
The quickest way — no file editing required:Select Perplexity when prompted for a search provider, then paste your API key.
Search Tool Parameters
When OpenClaw invokesweb_search with Perplexity as the provider, these parameters are available:
| Parameter | Description |
|---|---|
query | Search query (required) |
count | Number of results (1–10, default: 5) |
country | ISO 3166-1 alpha-2 country code (e.g., US, DE) |
language | ISO 639-1 language code (e.g., en, fr) |
freshness | Time filter: day, week, month, or year |
date_after | Results published after this date (YYYY-MM-DD) |
date_before | Results published before this date (YYYY-MM-DD) |
domain_filter | Domain allowlist or denylist (max 20 entries) |
max_tokens | Total content budget (default: 25,000, max: 1,000,000) |
max_tokens_per_page | Per-page token limit (default: 2,048) |
Agent API Setup (Use Perplexity as your LLM Provider)
Use Perplexity’s Agent API to run models like Claude Sonnet, GPT-5, Gemini, and Sonar as your OpenClaw coding agent.Install OpenClaw
If you haven’t installed OpenClaw yet:For Docker, Podman, Nix, or other installation methods, see the OpenClaw install documentation.
- macOS / Linux
- Windows (PowerShell)
Configure Perplexity as an LLM Provider
- Onboarding CLI (Recommended)
- Config File (All Models)
The quickest way — no file editing required:This registers Perplexity as a provider with one model. To add more models, re-run with a different
--custom-model-id or switch to the config file method.You can replace anthropic/claude-sonnet-4-6 with any model ID from the Agent API models list to change your default model.Agent API Configuration Tips
API transport must be openai-responses
API transport must be openai-responses
Perplexity’s Agent API uses the OpenAI Responses format. In
openclaw.json, set the api field to "openai-responses" at both the provider level and each model entry.Using "openai-completions" will not work.Base URL must be exactly https://api.perplexity.ai/v1
Base URL must be exactly https://api.perplexity.ai/v1
Do not include
/agent or /responses in the URL. OpenClaw appends /responses automatically.Wrong base URLs will cause authentication errors or 404s.| Correct | Wrong |
|---|---|
https://api.perplexity.ai/v1 | https://api.perplexity.ai/v1/agent |
https://api.perplexity.ai/v1/responses | |
https://api.perplexity.ai (missing /v1) |
Model ID format
Model ID format
In the config, model IDs under a provider block omit the provider prefix. The full model reference adds it:
- Config model ID:
anthropic/claude-sonnet-4-6 - Full model reference:
perplexity/anthropic/claude-sonnet-4-6
Links & Resources
Agent API Quickstart
Use third-party models with built-in tools and function calling
Agent API Models
Full list of available models and pricing
Search API Quickstart
Full Perplexity Search API documentation
OpenAI Compatibility
How the Agent API works with OpenAI-compatible clients
OpenClaw Documentation
OpenClaw’s official documentation
API Console
Generate and manage your API keys