xAI
Velaclaw ships a bundledxai provider plugin for Grok models.
Getting started
1
Create an API key
Create an API key in the xAI console.
2
Set your API key
Set
XAI_API_KEY, or run:3
Pick a model
Velaclaw uses the xAI Responses API as the bundled xAI transport. The same
XAI_API_KEY can also power Grok-backed web_search, first-class x_search,
and remote code_execution.
If you store an xAI key under plugins.entries.xai.config.webSearch.apiKey,
the bundled xAI model provider reuses that key as a fallback too.
code_execution tuning lives under plugins.entries.xai.config.codeExecution.Bundled model catalog
Velaclaw includes these xAI model families out of the box:
The plugin also forward-resolves newer
grok-4* and grok-code-fast* ids when
they follow the same API shape.
Fast-mode mappings
/fast on or agents.defaults.models["xai/<model>"].params.fastMode: true
rewrites native xAI requests as follows:
Legacy compatibility aliases
Legacy aliases still normalize to the canonical bundled ids:Features
Web search
Web search
The bundled
grok web-search provider uses XAI_API_KEY too:Video generation
Video generation
The bundled
xai plugin registers video generation through the shared
video_generate tool.- Default video model:
xai/grok-imagine-video - Modes: text-to-video, image-to-video, and remote video edit/extend flows
- Supports
aspectRatioandresolution
See Video Generation for shared tool parameters,
provider selection, and failover behavior.
x_search configuration
x_search configuration
The bundled xAI plugin exposes
x_search as an Velaclaw tool for searching
X (formerly Twitter) content via Grok.Config path: plugins.entries.xai.config.xSearchCode execution configuration
Code execution configuration
The bundled xAI plugin exposes
code_execution as an Velaclaw tool for
remote code execution in xAI’s sandbox environment.Config path: plugins.entries.xai.config.codeExecutionThis is remote xAI sandbox execution, not local
exec.Known limits
Known limits
- Auth is API-key only today. There is no xAI OAuth or device-code flow in Velaclaw yet.
grok-4.20-multi-agent-experimental-beta-0304is not supported on the normal xAI provider path because it requires a different upstream API surface than the standard Velaclaw xAI transport.
Advanced notes
Advanced notes
- Velaclaw applies xAI-specific tool-schema and tool-call compatibility fixes automatically on the shared runner path.
- Native xAI requests default
tool_stream: true. Setagents.defaults.models["xai/<model>"].params.tool_streamtofalseto disable it. - The bundled xAI wrapper strips unsupported strict tool-schema flags and reasoning payload keys before sending native xAI requests.
web_search,x_search, andcode_executionare exposed as Velaclaw tools. Velaclaw enables the specific xAI built-in it needs inside each tool request instead of attaching all native tools to every chat turn.x_searchandcode_executionare owned by the bundled xAI plugin rather than hardcoded into the core model runtime.code_executionis remote xAI sandbox execution, not localexec.
Related
Model selection
Choosing providers, model refs, and failover behavior.
Video generation
Shared video tool parameters and provider selection.
All providers
The broader provider overview.
Troubleshooting
Common issues and fixes.