Skip to main content

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. When configured as a provider, Perplexity Search API returns structured results (title, url, snippet) that the agent can process and reason over.

Setup

1

Get Your API Key

Generate API Key

Navigate to the API Console and generate a new key.
2

Install OpenClaw

If you haven’t installed OpenClaw yet:
curl -fsSL https://openclaw.ai/install.sh | bash
Verify the installation:
openclaw --version
openclaw doctor
For Docker, Podman, Nix, or other installation methods, see the OpenClaw install documentation.
3

Configure Perplexity as the Search Provider

The quickest way to configure Perplexity is the interactive setup wizard:
openclaw configure --section web
Select Perplexity when prompted for a search provider, then paste your API key.Alternatively, set the environment variable and OpenClaw will auto-detect it:
export PERPLEXITY_API_KEY="pplx-..."
4

Search

Start OpenClaw and ask anything that requires web search:
openclaw
> What are the latest developments in quantum computing?
OpenClaw will use Perplexity Search API to retrieve structured results and incorporate them into its response.

Configuration

Config file

Add Perplexity to your openclaw.json (run openclaw config file to locate it):
{
  "plugins": {
    "entries": {
      "perplexity": {
        "config": {
          "webSearch": {
            "apiKey": "pplx-..."
          }
        }
      }
    }
  },
  "tools": {
    "web": {
      "search": {
        "provider": "perplexity"
      }
    }
  }
}

Environment variable

Set PERPLEXITY_API_KEY in the gateway environment. For daemon installs, add it to ~/.openclaw/.env:
PERPLEXITY_API_KEY=pplx-...
If provider: "perplexity" is configured but no valid key is found, OpenClaw will fail fast at startup with a clear error.

Tool Parameters

When OpenClaw invokes web_search with Perplexity as the provider, these parameters are available:
ParameterDescription
querySearch query (required)
countNumber of results (1–10, default: 5)
countryISO 3166-1 alpha-2 country code (e.g., US, DE)
languageISO 639-1 language code (e.g., en, fr)
freshnessTime filter: day, week, month, or year
date_afterResults published after this date (YYYY-MM-DD)
date_beforeResults published before this date (YYYY-MM-DD)
domain_filterDomain allowlist or denylist (max 20 entries)
max_tokensTotal content budget (default: 25,000, max: 1,000,000)
max_tokens_per_pagePer-page token limit (default: 2,048)
Domain filters support allowlists (["nature.com", "science.org"]) and denylists (["-reddit.com", "-pinterest.com"]), but you cannot mix both in the same request. See the domain filter guide for details.

Search API Quickstart

Full Perplexity Search API documentation

OpenClaw Perplexity Docs

OpenClaw’s Perplexity Search provider documentation

OpenClaw Repository

OpenClaw source code on GitHub

API Console

Generate and manage your API keys