




















@@ -9,14 +9,14 @@ title: "Code execution"
991010`code_execution` runs sandboxed remote Python analysis on xAI's Responses API. It is registered by the bundled `xai` plugin (under the `tools` contract) and dispatches to the same `https://api.x.ai/v1/responses` endpoint used by `x_search`.
111112-| Property | Value |
13-| ------------------ | --------------------------------------------------------------------------------------- |
14-| Tool name | `code_execution` |
15-| Provider plugin | `xai` (bundled, `enabledByDefault: true`) |
16-| Auth | xAI OAuth auth profile, `XAI_API_KEY`, or `plugins.entries.xai.config.webSearch.apiKey` |
17-| Default model | `grok-4-1-fast` |
18-| Default timeout | 30 seconds |
19-| Default `maxTurns` | unset (xAI applies its own internal limit) |
12+| Property | Value |
13+| ------------------ | --------------------------------------------------------------------------------- |
14+| Tool name | `code_execution` |
15+| Provider plugin | `xai` (bundled, `enabledByDefault: true`) |
16+| Auth | xAI auth profile, `XAI_API_KEY`, or `plugins.entries.xai.config.webSearch.apiKey` |
17+| Default model | `grok-4-1-fast` |
18+| Default timeout | 30 seconds |
19+| Default `maxTurns` | unset (xAI applies its own internal limit) |
20202121This is different from local [`exec`](/tools/exec):
2222@@ -143,7 +143,7 @@ When the tool runs without auth, it returns a structured `missing_xai_api_key` e
143143```json
144144{
145145"error": "missing_xai_api_key",
146-"message": "code_execution needs xAI credentials. Run `openclaw models auth login --provider xai --method oauth` to sign in with Grok, run `openclaw models auth login --provider xai --method api-key`, set `XAI_API_KEY` in the Gateway environment, or configure `plugins.entries.xai.config.webSearch.apiKey`.",
146+"message": "code_execution needs xAI credentials. Run `openclaw onboard --auth-choice xai-oauth` to sign in with Grok, run `openclaw onboard --auth-choice xai-api-key`, set `XAI_API_KEY` in the Gateway environment, or configure `plugins.entries.xai.config.webSearch.apiKey`.",
147147"docs": "https://docs.openclaw.ai/tools/code-execution"
148148}
149149```
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。