Skip to main content

Documentation Index

Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt

Use this file to discover all available pages before exploring further.

Perplexity 插件通过 Perplexity Search API 或通过 OpenRouter 的 Perplexity Sonar 提供网页搜索能力。
本页是 Perplexity 提供方 设置。关于 Perplexity 工具(代理如何使用它),请参见 Perplexity 工具
PropertyValue
类型网页搜索提供方(不是模型提供方)
认证PERPLEXITY_API_KEY(直连)或 OPENROUTER_API_KEY(通过 OpenRouter)
配置路径plugins.entries.perplexity.config.webSearch.apiKey

快速开始

1

设置 API 密钥

运行交互式网页搜索配置流程:
openclaw configure --section web
或直接设置密钥:
openclaw config set plugins.entries.perplexity.config.webSearch.apiKey "pplx-xxxxxxxxxxxx"
2

开始搜索

一旦配置好密钥,代理就会自动使用 Perplexity 进行网页搜索。无需其他步骤。

搜索模式

插件会根据 API 密钥前缀自动选择传输方式:
当你的密钥以 pplx- 开头时,OpenClaw 会使用原生 Perplexity Search API。此传输方式返回结构化结果,并支持域名、语言和日期过滤(见下方过滤选项)。
Key prefixTransportFeatures
pplx-原生 Perplexity Search API结构化结果、域名/语言/日期过滤
sk-or-OpenRouter(Sonar)带引用的 AI 合成答案

原生 API 过滤

只有在使用原生 Perplexity API (pplx- 密钥)时才可使用过滤选项。OpenRouter/Sonar 搜索不支持这些参数。
使用原生 Perplexity API 时,搜索支持以下过滤器:
FilterDescriptionExample
国家2 位国家代码us, de, jp
语言ISO 639-1 语言代码en, fr, zh
日期范围时效窗口day, week, month, year
域名过滤白名单或黑名单(最多 20 个域名)example.com
内容预算每次响应 / 每页的 token 限制max_tokens, max_tokens_per_page

高级配置

如果 OpenClaw Gateway 作为守护进程运行(launchd/systemd),请确保 PERPLEXITY_API_KEY 对该进程可用。
仅设置在 ~/.profile 中的密钥不会被 launchd/systemd 守护进程看到,除非显式导入该环境。请在 ~/.openclaw/.env 中设置密钥,或通过 env.shellEnv 设置,以确保网关进程能够 读取它。
如果你希望通过 OpenRouter 路由 Perplexity 搜索,请改为设置一个 OPENROUTER_API_KEY(前缀为 sk-or-),而不是原生 Perplexity 密钥。 OpenClaw 会自动检测前缀并切换到 Sonar 传输方式。
如果你已经有 OpenRouter 账户,并希望在多个提供方之间统一计费,那么 OpenRouter 传输方式会很有用。

相关内容

Perplexity 搜索工具

代理如何调用 Perplexity 搜索并解释结果。

配置参考

包含插件条目的完整配置参考。