Appearance
Grok Search
OpenClaw 支持将 Grok 用作 web_search 提供商,通过 xAI 网络搜索 grounding 技术生成带引用来源的 AI 合成答案,并支持实时搜索结果。
获取 API Key
第一步:创建密钥
从 xAI 控制台 获取 API key。
第二步:存储密钥
在 Gateway 环境中设置 XAI_API_KEY,或通过以下命令配置:
bash
openclaw configure --section web配置
json5
{
plugins: {
entries: {
xai: {
config: {
webSearch: {
apiKey: "xai-...", // 如果设置了 XAI_API_KEY 环境变量则可省略
},
},
},
},
},
tools: {
web: {
search: {
provider: "grok",
},
},
},
}环境变量替代方案:在 Gateway 环境中设置 XAI_API_KEY。对于 gateway 安装,将其放在 ~/.openclaw/.env 中。
工作原理
Grok 使用 xAI 网络搜索 grounding,合成带内联引用的答案,与 Gemini 的 Google Search Grounding 方式类似。
支持的参数
Grok 搜索支持标准的 query 和 count 参数。目前不支持特定提供商过滤器。
相关文档
- Web Search 总览 — 所有提供商与自动检测
- Gemini Search — 通过 Google grounding 的 AI 合成答案