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. 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.
1

Configure the Search Provider

2

Start using OpenClaw with Perplexity 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.

Search 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.

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.
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
For Docker, Podman, Nix, or other installation methods, see the OpenClaw install documentation.
3

Configure Perplexity as an LLM Provider

4

Start using OpenClaw

Launch OpenClaw and your agent will use Perplexity:
openclaw

Agent API Configuration Tips

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.
Do not include /agent or /responses in the URL. OpenClaw appends /responses automatically.Wrong base URLs will cause authentication errors or 404s.
CorrectWrong
https://api.perplexity.ai/v1https://api.perplexity.ai/v1/agent
https://api.perplexity.ai/v1/responses
https://api.perplexity.ai (missing /v1)
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
For the latest model list and pricing, see the Agent API models page and pricing page.

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