@ai-sdk/xai 3.0.95 → 3.0.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/01-xai.mdx CHANGED
@@ -121,9 +121,16 @@ await generateText({
121
121
 
122
122
  The following optional provider options are available for xAI chat models:
123
123
 
124
- - **reasoningEffort** _'low' | 'high'_
124
+ - **reasoningEffort** _'none' | 'low' | 'medium' | 'high'_
125
125
 
126
- Reasoning effort for reasoning models.
126
+ Reasoning effort for reasoning models. `'none'` disables reasoning entirely.
127
+
128
+ <Note>
129
+ Not every Grok model accepts every reasoning effort, for example
130
+ `grok-build-0.1` does not support reasoning effort. See xAI's [reasoning
131
+ docs](https://docs.x.ai/docs/guides/reasoning) for the values each model
132
+ accepts.
133
+ </Note>
127
134
 
128
135
  - **logprobs** _boolean_
129
136
 
@@ -454,9 +461,16 @@ const result = await generateText({
454
461
 
455
462
  The following provider options are available:
456
463
 
457
- - **reasoningEffort** _'low' | 'medium' | 'high'_
464
+ - **reasoningEffort** _'none' | 'low' | 'medium' | 'high'_
458
465
 
459
- Control the reasoning effort for the model. Higher effort may produce more thorough results at the cost of increased latency and token usage.
466
+ Control the reasoning effort for the model. Higher effort may produce more thorough results at the cost of increased latency and token usage. `'none'` disables reasoning entirely.
467
+
468
+ <Note>
469
+ Not every Grok model accepts every reasoning effort, for example
470
+ `grok-build-0.1` does not support reasoning effort. See xAI's [reasoning
471
+ docs](https://docs.x.ai/docs/guides/reasoning) for the values each model
472
+ accepts.
473
+ </Note>
460
474
 
461
475
  - **logprobs** _boolean_
462
476
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/xai",
3
- "version": "3.0.95",
3
+ "version": "3.0.97",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@ai-sdk/openai-compatible": "2.0.50",
32
+ "@ai-sdk/openai-compatible": "2.0.51",
33
33
  "@ai-sdk/provider": "3.0.10",
34
- "@ai-sdk/provider-utils": "4.0.29"
34
+ "@ai-sdk/provider-utils": "4.0.30"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "20.17.24",
@@ -1,14 +1,11 @@
1
1
  import { z } from 'zod/v4';
2
2
 
3
3
  export type XaiResponsesModelId =
4
- | 'grok-4-1-fast-reasoning'
5
- | 'grok-4-1-fast-non-reasoning'
6
- | 'grok-4'
7
- | 'grok-4-fast-non-reasoning'
8
- | 'grok-4-fast-reasoning'
9
- | 'grok-4.20-0309-non-reasoning'
4
+ | 'grok-4.3'
10
5
  | 'grok-4.20-0309-reasoning'
6
+ | 'grok-4.20-0309-non-reasoning'
11
7
  | 'grok-4.20-multi-agent-0309'
8
+ | 'grok-build-0.1'
12
9
  | (string & {});
13
10
 
14
11
  /**
@@ -17,9 +14,11 @@ export type XaiResponsesModelId =
17
14
  export const xaiLanguageModelResponsesOptions = z.object({
18
15
  /**
19
16
  * Constrains how hard a reasoning model thinks before responding.
20
- * Possible values are `low` (uses fewer reasoning tokens), `medium` and `high` (uses more reasoning tokens).
17
+ * Possible values are `none` (disables reasoning), `low` (uses fewer reasoning
18
+ * tokens), `medium` and `high` (uses more reasoning tokens). Not all models
19
+ * support reasoning effort; see xAI's docs for the values each model accepts.
21
20
  */
22
- reasoningEffort: z.enum(['low', 'medium', 'high']).optional(),
21
+ reasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(),
23
22
  logprobs: z.boolean().optional(),
24
23
  topLogprobs: z.number().int().min(0).max(8).optional(),
25
24
  /**
@@ -2,21 +2,11 @@ import { z } from 'zod/v4';
2
2
 
3
3
  // https://docs.x.ai/docs/models
4
4
  export type XaiChatModelId =
5
- | 'grok-4-1-fast-reasoning'
6
- | 'grok-4-1-fast-non-reasoning'
7
- | 'grok-4-fast-non-reasoning'
8
- | 'grok-4-fast-reasoning'
9
- | 'grok-4.20-0309-non-reasoning'
5
+ | 'grok-4.3'
10
6
  | 'grok-4.20-0309-reasoning'
7
+ | 'grok-4.20-0309-non-reasoning'
11
8
  | 'grok-4.20-multi-agent-0309'
12
- | 'grok-code-fast-1'
13
- | 'grok-4'
14
- | 'grok-4-0709'
15
- | 'grok-4-latest'
16
- | 'grok-3'
17
- | 'grok-3-latest'
18
- | 'grok-3-mini'
19
- | 'grok-3-mini-latest'
9
+ | 'grok-build-0.1'
20
10
  | (string & {});
21
11
 
22
12
  // search source schemas
@@ -61,7 +51,7 @@ const searchSourceSchema = z.discriminatedUnion('type', [
61
51
 
62
52
  // xai-specific provider options
63
53
  export const xaiLanguageModelChatOptions = z.object({
64
- reasoningEffort: z.enum(['low', 'high']).optional(),
54
+ reasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(),
65
55
  logprobs: z.boolean().optional(),
66
56
  topLogprobs: z.number().int().min(0).max(8).optional(),
67
57
 
@@ -1,4 +1,4 @@
1
1
  export type XaiImageModelId =
2
2
  | 'grok-imagine-image'
3
- | 'grok-imagine-image-pro'
3
+ | 'grok-imagine-image-quality'
4
4
  | (string & {});