概述
Grok 搜索通过 xAI web-grounded responses 提供 AI 合成答案,返回带引用的综合回答。同一 xAI API Key 还可用于 x_search(X 平台帖子搜索)和 code_execution 工具。
核心功能
- xAI web grounding:AI 合成答案 + 内联引用
- 同一 API Key 可同时支持
web_search、x_search和code_execution - 默认超时 60 秒(xAI Responses 搜索耗时较长)
- 自动检测优先级:order 30
- 选择 Grok 时可选配置
x_search(同一 key)
配置/使用
{
plugins: {
entries: {
xai: {
config: {
webSearch: {
apiKey: "xai-...",
baseUrl: "https://api.x.ai/v1",
},
},
},
},
},
tools: {
web: {
search: { provider: "grok" },
},
},
}环境变量:XAI_API_KEY
注意事项
- 返回一个合成答案(带引用),
count参数不改变响应形状 - 不支持提供商特定过滤器
- 帖子级别 X 指标(转发、回复等)建议使用
x_search+ 精确帖子 URL x_search配置在plugins.entries.xai.config.xSearch.*下
相关页面
- concepts/tool-web — Web 搜索工具总览(含 x_search 说明)
- concepts/tool-gemini-search — Gemini 搜索(Google grounding)
- concepts/tool-kimi-search — Kimi 搜索(Moonshot grounding)