OpenClaw supports Grok as aDocumentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
web_search provider, using xAI web-grounded
responses to produce AI-synthesized answers backed by live search results
with citations.
The same XAI_API_KEY can also power the built-in x_search tool for X
(formerly Twitter) post search. If you store the key under
plugins.entries.xai.config.webSearch.apiKey, OpenClaw now reuses it as a
fallback for the bundled xAI model provider too.
For post-level X metrics such as reposts, replies, bookmarks, or views, prefer
x_search with the exact post URL or status ID instead of a broad search
query.
Onboarding and configure
If you choose Grok during:openclaw onboardopenclaw configure --section web
x_search with the same
XAI_API_KEY. That follow-up:
- only appears after you choose Grok for
web_search - is not a separate top-level web-search provider choice
- can optionally set the
x_searchmodel during the same flow
x_search later in config.
Get an API key
Create a key
Get an API key from xAI.
Config
XAI_API_KEY in the Gateway environment.
For a gateway install, put it in ~/.openclaw/.env.
How it works
Grok uses xAI web-grounded responses to synthesize answers with inline citations, similar to Gemini’s Google Search grounding approach.Supported parameters
Grok search supportsquery.
count is accepted for shared web_search compatibility, but Grok still
returns one synthesized answer with citations rather than an N-result list.
Provider-specific filters are not currently supported.
Grok uses a provider-specific 60 second default timeout because xAI Responses
web-grounded searches can run longer than the shared web_search default. Set
tools.web.search.timeoutSeconds to override it.
Base URL overrides
Setplugins.entries.xai.config.webSearch.baseUrl when Grok web search should
route through an operator proxy or xAI-compatible Responses endpoint. OpenClaw
posts to <baseUrl>/responses after trimming trailing slashes. x_search
uses the same webSearch.baseUrl fallback unless
plugins.entries.xai.config.xSearch.baseUrl is set.
Related
- Web Search overview — all providers and auto-detection
- x_search in Web Search — first-class X search via xAI
- Gemini Search — AI-synthesized answers via Google grounding