improve(xai): use Grok 4.5 as the API-key default

This commit is contained in:
Hannes Rudolph
2026-08-12 09:18:49 -06:00
parent 08454c9bab
commit ff8cb4ed7b
15 changed files with 36 additions and 36 deletions
+2 -2
View File
@@ -298,7 +298,7 @@ messages and normalizes `stats.cached` into `cacheRead`; legacy
| Venice | `venice` | `VENICE_API_KEY` | - |
| Vercel AI Gateway | `vercel-ai-gateway` | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway/anthropic/claude-opus-4.6` |
| Volcano Engine (Doubao) | `volcengine` / `volcengine-plan` | `VOLCANO_ENGINE_API_KEY` | `volcengine-plan/ark-code-latest` |
| xAI | `xai` | SuperGrok/X Premium OAuth or `XAI_API_KEY` | OAuth: `xai/auto`; API key: `xai/grok-4.3` |
| xAI | `xai` | SuperGrok/X Premium OAuth or `XAI_API_KEY` | OAuth: `xai/auto`; API key: `xai/grok-4.5` |
| Xiaomi | `xiaomi` / `xiaomi-token-plan` | `XIAOMI_API_KEY` / `XIAOMI_TOKEN_PLAN_API_KEY` | `xiaomi/mimo-v2.5` / `xiaomi-token-plan/mimo-v2.5-pro` |
#### Quirks worth knowing
@@ -317,7 +317,7 @@ messages and normalizes `stats.cached` into `cacheRead`; legacy
Model ids use a `nvidia/<vendor>/<model>` namespace (for example `nvidia/nvidia/nemotron-...`); pickers preserve the literal `<provider>/<model-id>` composition while the canonical key sent to the API stays single-prefixed.
</Accordion>
<Accordion title="xAI">
Uses the xAI Responses path. The recommended path is SuperGrok/X Premium OAuth; fresh setup selects `xai/auto`, which follows xAI's authenticated default model without an OpenClaw update. Existing concrete model ids stay pinned. API keys still work via `XAI_API_KEY` or plugin config and keep `grok-4.3` as the regional-safe setup default. Grok `web_search` reuses the same auth profile before API-key fallback. Older `/fast` and `params.fastMode: true` configurations still resolve through xAI's Grok 4.3 compatibility redirects, but new configurations should select a current model directly. `tool_stream` defaults on; disable via `agents.defaults.models["xai/<model>"].params.tool_stream=false`.
Uses the xAI Responses path. The recommended path is SuperGrok/X Premium OAuth; fresh setup selects `xai/auto`, which follows xAI's authenticated default model without an OpenClaw update. Existing concrete model ids stay pinned. API keys still work via `XAI_API_KEY` or plugin config and use `grok-4.5` as the setup default. Grok `web_search` reuses the same auth profile before API-key fallback. Older `/fast` and `params.fastMode: true` configurations still resolve through xAI's Grok 4.3 compatibility redirects, but new configurations should select a current model directly. `tool_stream` defaults on; disable via `agents.defaults.models["xai/<model>"].params.tool_stream=false`.
</Accordion>
</AccordionGroup>
+1 -1
View File
@@ -396,7 +396,7 @@ cannot be read, account-wide exposure fails closed.
- `timeoutSeconds`: scrape request timeout in seconds (default: `60`).
- `plugins.entries.xai.config.xSearch`: xAI X Search (Grok web search) settings.
- `enabled`: enable the X Search provider.
- `model`: Grok model to use for search (e.g. `"grok-4.3"`).
- `model`: Grok model to use for search (e.g. `"grok-4.5"`).
- `plugins.entries.memory-core.config.dreaming`: memory dreaming settings. See [Dreaming](/concepts/dreaming) for phases and thresholds.
- `enabled`: master dreaming switch (default `false`).
- `frequency`: cron cadence for each full dreaming sweep (`"0 3 * * *"` by default).
+8 -8
View File
@@ -56,8 +56,8 @@ OAuth client.
</Step>
<Step title="API-key path">
API-key setup still works for xAI Console keys and for media surfaces
that need key-backed provider config. It keeps Grok 4.3 as the
regional-safe setup default:
that need key-backed provider config. It uses Grok 4.5 as the setup
default:
```bash
openclaw models auth login --provider xai --method api-key
@@ -122,8 +122,8 @@ see [legacy compatibility and moving aliases](#legacy-compatibility-and-moving-a
<Tip>
Use `xai/auto` to follow xAI's authenticated OAuth default, or select a concrete
id such as `xai/grok-4.5` to remain pinned. API-key setup keeps Grok 4.3 as the
regional-safe default; `grok-build-0.1` and both dated Grok 4.20 variants remain
id such as `xai/grok-4.5` to remain pinned. API-key setup uses Grok 4.5 by
default; `grok-build-0.1`, Grok 4.3, and both dated Grok 4.20 variants remain
selectable.
</Tip>
@@ -537,7 +537,7 @@ stale context metadata on active 4.20 rows. It does not pin active 4.20
| Key | Type | Default | Description |
| ----------------- | ------- | ------------------------- | ------------------------------------------------ |
| `enabled` | boolean | Automatic for xAI models | Disable, or opt in for a known non-xAI provider |
| `model` | string | `grok-4.3` | Model used for x_search requests |
| `model` | string | `grok-4.5` | Model used for x_search requests |
| `baseUrl` | string | - | xAI Responses base URL override |
| `inlineCitations` | boolean | - | Include inline citations in results |
| `maxTurns` | number | - | Maximum conversation turns |
@@ -552,7 +552,7 @@ stale context metadata on active 4.20 rows. It does not pin active 4.20
config: {
xSearch: {
enabled: true,
model: "grok-4.3",
model: "grok-4.5",
baseUrl: "https://api.x.ai/v1",
inlineCitations: true,
},
@@ -574,7 +574,7 @@ stale context metadata on active 4.20 rows. It does not pin active 4.20
| Key | Type | Default | Description |
| ---------------- | ------- | ------------------------ | ------------------------------------------------ |
| `enabled` | boolean | Automatic for xAI models | Disable, or opt in for a known non-xAI provider |
| `model` | string | `grok-4.3` | Model used for code execution requests |
| `model` | string | `grok-4.5` | Model used for code execution requests |
| `maxTurns` | number | - | Maximum conversation turns |
| `timeoutSeconds` | number | `30` | Request timeout in seconds |
@@ -590,7 +590,7 @@ stale context metadata on active 4.20 rows. It does not pin active 4.20
config: {
codeExecution: {
enabled: true,
model: "grok-4.3",
model: "grok-4.5",
},
},
},
+2 -2
View File
@@ -21,7 +21,7 @@ registered by the bundled `xai` plugin under the `tools` contract.
| Tool name | `code_execution` |
| Provider plugin | `xai` (bundled, `enabledByDefault: true`) |
| Auth | xAI auth profile, `XAI_API_KEY`, or `plugins.entries.xai.config.webSearch.apiKey` |
| Default model | `grok-4.3` |
| Default model | `grok-4.5` |
| Default timeout | 30 seconds |
| Default `maxTurns` | unset (xAI applies its own internal limit) |
@@ -100,7 +100,7 @@ For local execution, use [`exec`](/tools/exec) instead.
config: {
codeExecution: {
enabled: true, // required for a known non-xAI model provider
model: "grok-4.3", // override the default xAI code-execution model
model: "grok-4.5", // optional explicit model pin
maxTurns: 2, // optional cap on internal tool turns
timeoutSeconds: 30, // request timeout (default: 30)
},
+1 -1
View File
@@ -532,7 +532,7 @@ every provider. xAI credentials are always required.
config: {
xSearch: {
enabled: true, // required for a known non-xAI model provider
model: "grok-4.3",
model: "grok-4.5",
baseUrl: "https://api.x.ai/v1", // optional, overrides webSearch.baseUrl
inlineCitations: false,
maxTurns: 2,
+1 -1
View File
@@ -155,7 +155,7 @@ describe("xai code_execution tool", () => {
expect(mockFetch).toHaveBeenCalled();
expect(firstFetchUrl(mockFetch)).toContain("api.x.ai/v1/responses");
const body = parseFirstRequestBody(mockFetch);
expect(body.model).toBe("grok-4.3");
expect(body.model).toBe("grok-4.5");
expect(body.store).toBe(false);
expect(body.reasoning).toEqual({ effort: "low" });
expect(body.max_turns).toBe(2);
+2 -2
View File
@@ -64,8 +64,8 @@ describe("xAI doctor contract", () => {
expect(result.changes).toHaveLength(4);
expect(result.config).not.toBe(config);
expect(result.config.plugins?.entries?.xai?.config).toEqual({
webSearch: { model: "grok-4.3", timeoutSeconds: 60 },
xSearch: { model: "grok-4.3", inlineCitations: true },
webSearch: { model: "grok-4.5", timeoutSeconds: 60 },
xSearch: { model: "grok-4.5", inlineCitations: true },
codeExecution: { model: "grok-build-0.1", maxTurns: 2 },
});
expect(result.config.tools?.web).toEqual(config.tools?.web);
+4 -4
View File
@@ -1,7 +1,7 @@
// Xai doctor contract repairs plugin-owned model configuration.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
import { isLegacyXaiBuiltinModel } from "./model-definitions.js";
import { isLegacyXaiBuiltinModel, XAI_DEFAULT_MODEL_ID } from "./model-definitions.js";
type LegacyConfigRule = {
path: Array<string | number>;
@@ -37,17 +37,17 @@ const PLUGIN_MODEL_MIGRATIONS: PluginModelMigration[] = [
{
path: ["plugins", "entries", "xai", "config", "webSearch"],
retiredModels: RETIRED_REASONING_MODELS,
targetModel: "grok-4.3",
targetModel: XAI_DEFAULT_MODEL_ID,
},
{
path: ["plugins", "entries", "xai", "config", "codeExecution"],
retiredModels: RETIRED_REASONING_MODELS,
targetModel: "grok-4.3",
targetModel: XAI_DEFAULT_MODEL_ID,
},
{
path: ["plugins", "entries", "xai", "config", "xSearch"],
retiredModels: RETIRED_NON_REASONING_MODELS,
targetModel: "grok-4.3",
targetModel: XAI_DEFAULT_MODEL_ID,
},
...[
["plugins", "entries", "xai", "config", "webSearch"],
+4 -4
View File
@@ -13,7 +13,7 @@ export const XAI_DEFAULT_CONTEXT_WINDOW = 1_000_000;
const XAI_GROK_45_CONTEXT_WINDOW = 500_000;
const XAI_CODE_CONTEXT_WINDOW = 256_000;
export const XAI_DEFAULT_MAX_TOKENS = 64_000;
export const XAI_DEFAULT_MODEL_ID = "grok-4.3";
export const XAI_DEFAULT_MODEL_ID = "grok-4.5";
type XaiCost = ModelDefinitionConfig["cost"];
@@ -254,12 +254,12 @@ export function buildXaiModelDefinition(): ModelDefinitionConfig {
return toModelDefinition(
XAI_MODEL_CATALOG.find((entry) => entry.id === XAI_DEFAULT_MODEL_ID) ?? {
id: XAI_DEFAULT_MODEL_ID,
name: "Grok 4.3",
name: "Grok 4.5",
reasoning: true,
input: ["text", "image"],
contextWindow: XAI_DEFAULT_CONTEXT_WINDOW,
contextWindow: XAI_GROK_45_CONTEXT_WINDOW,
maxTokens: XAI_DEFAULT_MAX_TOKENS,
cost: XAI_GROK_43_COST,
cost: XAI_GROK_45_COST,
},
);
}
+1 -1
View File
@@ -22,7 +22,7 @@ describe("xai onboard", () => {
const cfg = applyXaiConfig({});
expect(cfg.models?.providers?.xai?.baseUrl).toBe("https://api.x.ai/v1");
expect(cfg.models?.providers?.xai?.api).toBe("openai-responses");
expect(XAI_DEFAULT_MODEL_REF).toBe("xai/grok-4.3");
expect(XAI_DEFAULT_MODEL_REF).toBe("xai/grok-4.5");
expect(resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model)).toBe(XAI_DEFAULT_MODEL_REF);
});
+1 -1
View File
@@ -137,7 +137,7 @@ export async function requestXaiXSearch(params: {
inputText: params.options.query,
tools: [buildXSearchTool(params.options)],
maxTurns: params.maxTurns,
reasoningEffort: params.model === XAI_DEFAULT_X_SEARCH_MODEL ? "none" : undefined,
reasoningEffort: params.model === XAI_DEFAULT_X_SEARCH_MODEL ? "low" : undefined,
}),
errorLabel: "xAI",
},
+4 -4
View File
@@ -244,7 +244,7 @@ describe("xai web search config resolution", () => {
it("prefers configured api keys and resolves grok scoped defaults", () => {
expect(resolveXaiWebSearchCredential({ grok: { apiKey: "xai-secret" } })).toBe("xai-secret");
expect(resolveXaiWebSearchModel()).toBe("grok-4.3");
expect(resolveXaiWebSearchModel()).toBe("grok-4.5");
expect(resolveXaiInlineCitations()).toBe(false);
});
@@ -644,8 +644,8 @@ describe("xai web search config resolution", () => {
});
it("uses default model when not specified", () => {
expect(resolveXaiWebSearchModel({})).toBe("grok-4.3");
expect(resolveXaiWebSearchModel(undefined)).toBe("grok-4.3");
expect(resolveXaiWebSearchModel({})).toBe("grok-4.5");
expect(resolveXaiWebSearchModel(undefined)).toBe("grok-4.5");
});
it("uses a Grok-specific 60s default timeout while preserving overrides", () => {
@@ -676,7 +676,7 @@ describe("xai web search config resolution", () => {
expect(firstFetchUrl(mockFetch)).toBe("https://api.x.ai/proxy/v1/responses");
expect(firstFetchBody(mockFetch)).toMatchObject({
model: "grok-4.3",
model: "grok-4.5",
store: false,
reasoning: { effort: "low" },
tools: [{ type: "web_search" }],
+1 -1
View File
@@ -67,7 +67,7 @@ describeLive("xai x_search live", () => {
expect(details.error, details.message).toBeUndefined();
expect(details.provider).toBe("xai");
expect(details.model).toBe("grok-4.3");
expect(details.model).toBe("grok-4.5");
expect(details.content?.trim().length ?? 0).toBeGreaterThan(0);
const citationCount =
+2 -2
View File
@@ -291,9 +291,9 @@ describe("xai x_search tool", () => {
expect(mockFetch).toHaveBeenCalled();
expect(firstFetchUrl(mockFetch)).toContain("api.x.ai/v1/responses");
const body = parseFirstRequestBody(mockFetch);
expect(body.model).toBe("grok-4.3");
expect(body.model).toBe("grok-4.5");
expect(body.store).toBe(false);
expect(body.reasoning).toEqual({ effort: "none" });
expect(body.reasoning).toEqual({ effort: "low" });
expect(body.max_turns).toBe(2);
expect(body.tools).toEqual([
{
+2 -2
View File
@@ -222,7 +222,7 @@ describeLive("xai plugin live", () => {
usedCodeExecution?: boolean;
};
expect(details.model).toBe("grok-4.3");
expect(details.model).toBe("grok-4.5");
expect(details.usedCodeExecution).toBe(true);
expect(details.content).toContain("42");
});
@@ -257,7 +257,7 @@ describeLive("xai plugin live", () => {
usedCodeExecution?: boolean;
};
expect(details.model).toBe("grok-4.3");
expect(details.model).toBe("grok-4.5");
expect(details.usedCodeExecution).toBe(true);
expect(details.content).toContain("5050");
});