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.

OpenClaw 支持将 Kimi 作为 web_search 提供方,使用 Moonshot 网页搜索 生成带有引用的 AI 综合答案。

获取 API 密钥

1

创建密钥

Moonshot AI 获取 API 密钥。
2

存储密钥

在 Gateway 环境中设置 KIMI_API_KEYMOONSHOT_API_KEY,或者 通过以下方式配置:
openclaw configure --section web
当你在 openclaw onboardopenclaw configure --section web 期间选择 Kimi 时,OpenClaw 还可能会询问:
  • Moonshot API 区域:
    • https://api.moonshot.ai/v1
    • https://api.moonshot.cn/v1
  • 默认的 Kimi web-search 模型(默认为 kimi-k2.6

配置

{
  plugins: {
    entries: {
      moonshot: {
        config: {
          webSearch: {
            apiKey: "sk-...", // 如果已设置 KIMI_API_KEY 或 MOONSHOT_API_KEY,则为可选项
            baseUrl: "https://api.moonshot.ai/v1",
            model: "kimi-k2.6",
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "kimi",
      },
    },
  },
}
如果你在聊天中使用中国区 API 主机(models.providers.moonshot.baseUrlhttps://api.moonshot.cn/v1),当省略 tools.web.search.kimi.baseUrl 时,OpenClaw 也会为 Kimi web_search 复用同一个主机,因此来自 platform.moonshot.cn 的密钥不会误请求到 国际端点(这通常会返回 HTTP 401)。当你需要不同的搜索基础 URL 时, 请使用 tools.web.search.kimi.baseUrl 覆盖。 环境变量替代方案: 在 Gateway 环境中设置 KIMI_API_KEYMOONSHOT_API_KEY。对于 gateway 安装,请将其放入 ~/.openclaw/.env 如果省略 baseUrl,OpenClaw 默认使用 https://api.moonshot.ai/v1。 如果省略 model,OpenClaw 默认使用 kimi-k2.6

工作原理

Kimi 使用 Moonshot 网页搜索来综合答案并在文中插入引用, 类似于 Gemini 和 Grok 的 grounded response 方法。 OpenClaw 将 Kimi web_search 仅在 Moonshot 返回原生 web-search grounding 证据后视为成功,例如可回放的 $web_search 工具载荷、search_results 或引用 URL。如果 Kimi 立即停止并仅返回普通聊天答案,例如“I cannot browse the internet”,且没有 grounding 证据,OpenClaw 将返回结构化的 kimi_web_search_ungrounded 错误,而不是把该文本包装为搜索结果。请重试查询,切换到结构化提供方(例如 Brave),或者在你已经有目标 URL 时使用 web_fetch / 浏览器工具。

Supported parameters

Kimi 搜索支持 query count 也被共享 web_search 兼容性所接受,但 Kimi 仍然 返回一条带有引用的综合答案,而不是 N 条结果列表。 目前不支持特定于提供方的过滤器。

相关内容