> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipellm.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# pipellm-websearch（npm）

> 通过 npm 安装 PipeLLM WebSearch，并作为 OpenClaw 插件使用

`pipellm-websearch` 是 PipeLLM WebSearch 的 npm 发行包，当前主要用于
OpenClaw 插件接入。它会给 OpenClaw 增加搜索、网页阅读和新闻搜索工具，并使用
你的 PipeLLM API Key 做鉴权和计费。

## 包信息

| 项目   | 值                                                        |
| ---- | -------------------------------------------------------- |
| 包名   | `pipellm-websearch`                                      |
| 发行渠道 | npm                                                      |
| 主要用途 | OpenClaw 插件                                              |
| 仓库   | `https://github.com/PipeLlm-AI/pipellm-websearch-plugin` |

## 安装

```bash theme={null}
npm install pipellm-websearch
```

## 插件会增加哪些工具

| 工具                      | 描述                 | 公共路由                          |
| ----------------------- | ------------------ | ----------------------------- |
| `pipellm_web_search`    | 深度网络搜索，带内容提取和相关性排序 | `/v1/websearch/search`        |
| `pipellm_simple_search` | 更快的搜索，返回搜索摘要       | `/v1/websearch/simple-search` |
| `pipellm_web_reader`    | 读取网页并返回干净文本        | `/v1/websearch/reader`        |
| `pipellm_news_search`   | 搜索近期新闻并带检索能力       | `/v1/websearch/search-news`   |

## OpenClaw 插件配置

把这个包加到你的 `openclaw.json`：

```json theme={null}
{
  "plugins": {
    "load": {
      "paths": ["./node_modules/pipellm-websearch"]
    },
    "entries": {
      "pipellm-websearch": {
        "enabled": true,
        "config": {
          "apiKey": "pipe-your-api-key-here"
        }
      }
    }
  }
}
```

## Agent 工具白名单

为你的 Agent 打开这些工具：

```json theme={null}
{
  "agents": {
    "list": [
      {
        "name": "my-agent",
        "tools": {
          "allow": [
            "pipellm_web_search",
            "pipellm_simple_search",
            "pipellm_web_reader",
            "pipellm_news_search"
          ]
        }
      }
    ]
  }
}
```

## 插件配置项

| 字段            | 必填 | 默认值                      | 描述              |
| ------------- | -- | ------------------------ | --------------- |
| `apiKey`      | 是  | —                        | PipeLLM API Key |
| `apiEndpoint` | 否  | `https://api.pipellm.ai` | 仅在自托管部署时覆盖      |

## 说明

* 这个包当前文档定位是 OpenClaw 插件，不是通用 JavaScript SDK。
* 请使用你在 Console 中创建的 PipeLLM API Key。
* 插件请求按 WebSearch 路由分档计费：`pipellm_web_search` 记录为 `websearch-deepsearch`，
  每次成功请求 $0.08；`pipellm_simple_search` 记录为 `websearch`，每次 $0.01；
  `pipellm_web_reader` 记录为 `websearch-reader`，每次 $0.01；`pipellm_news_search`
  记录为 `websearch-news`，每次 $0.08。
* 插件不需要传入计费参数；PipeLLM 会根据所选路由自动设置内部模型名。

## 相关文档

<Columns cols={3}>
  <Card title="OpenClaw" icon="terminal" href="/integrations/openclaw.zh">
    配置 OpenClaw 使用 PipeLLM
  </Card>

  <Card title="深度搜索" icon="magnifying-glass" href="/websearch/search-api.zh">
    直接通过 HTTP 调用完整检索路由
  </Card>

  <Card title="npm 包" icon="box" href="https://www.npmjs.com/package/pipellm-websearch">
    在 npm 上查看这个包
  </Card>
</Columns>
