xAI
OpenClaw には、Grok モデル用のバンドル済みxai provider plugin が含まれています。
セットアップ
- xAI console で API key を作成します。
XAI_API_KEYを設定するか、次を実行します:
- 次のようなモデルを選びます:
XAI_API_KEY は、Grok ベースの web_search、ファーストクラスの x_search、
およびリモートの code_execution にも使えます。
xAI キーを plugins.entries.xai.config.webSearch.apiKey に保存した場合、
バンドル済み xAI model provider は現在それを fallback としても再利用します。
code_execution の調整は plugins.entries.xai.config.codeExecution 配下にあります。
現在のバンドル済みモデルカタログ
OpenClaw には現在、次の xAI モデルファミリーがそのまま含まれています。grok-3,grok-3-fast,grok-3-mini,grok-3-mini-fastgrok-4,grok-4-0709grok-4-fast,grok-4-fast-non-reasoninggrok-4-1-fast,grok-4-1-fast-non-reasoninggrok-4.20-beta-latest-reasoning,grok-4.20-beta-latest-non-reasoninggrok-code-fast-1
grok-4* と grok-code-fast* の id についても、
同じ API 形状に従っている限り forward-resolve します。
高速モデルに関する注記:
grok-4-fast、grok-4-1-fast、およびgrok-4.20-beta-*バリアントは、 バンドル済みカタログ内の現在の image 対応 Grok ref です。/fast onまたはagents.defaults.models["xai/<model>"].params.fastMode: trueは、ネイティブ xAI request を次のように書き換えます:grok-3->grok-3-fastgrok-3-mini->grok-3-mini-fastgrok-4->grok-4-fastgrok-4-0709->grok-4-fast
grok-4-fast-reasoning->grok-4-fastgrok-4-1-fast-reasoning->grok-4-1-fastgrok-4.20-reasoning->grok-4.20-beta-latest-reasoninggrok-4.20-non-reasoning->grok-4.20-beta-latest-non-reasoning
Web search
バンドル済みのgrok web-search provider も XAI_API_KEY を使います。
既知の制限
- Auth は現在 API-key のみです。OpenClaw にはまだ xAI OAuth / device-code フローはありません。
grok-4.20-multi-agent-experimental-beta-0304は、標準の OpenClaw xAI 転送とは異なる上流 API surface を必要とするため、通常の xAI provider path ではサポートされません。
注意
- OpenClaw は、共有 runner path 上で xAI 固有の tool-schema および tool-call 互換性修正を自動で適用します。
- ネイティブ xAI request はデフォルトで
tool_stream: trueです。これを無効にするにはagents.defaults.models["xai/<model>"].params.tool_streamをfalseに設定してください。 - バンドル済み xAI wrapper は、ネイティブ xAI request を送信する前に、未対応の strict tool-schema フラグと reasoning payload key を除去します。
web_search、x_search、code_executionは OpenClaw tools として公開されます。OpenClaw は、各 tool request の中で必要な特定の xAI built-in のみを有効化し、すべてのネイティブ tool をすべての chat turn に付与することはありません。x_searchとcode_executionは、core model runtime にハードコードされているのではなく、バンドル済み xAI plugin が所有しています。code_executionはリモートの xAI sandbox 実行であり、ローカルのexecではありません。- より広い provider 概要については、Model providers を参照してください。