@ai-sdk/openai 4.0.0-beta.9 → 4.0.0-canary.46

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +405 -22
  2. package/README.md +2 -0
  3. package/dist/index.d.ts +133 -51
  4. package/dist/index.js +2318 -1679
  5. package/dist/index.js.map +1 -1
  6. package/dist/internal/index.d.ts +151 -27
  7. package/dist/internal/index.js +2100 -1702
  8. package/dist/internal/index.js.map +1 -1
  9. package/docs/03-openai.mdx +166 -29
  10. package/package.json +13 -14
  11. package/src/chat/convert-openai-chat-usage.ts +1 -1
  12. package/src/chat/convert-to-openai-chat-messages.ts +96 -68
  13. package/src/chat/map-openai-finish-reason.ts +1 -1
  14. package/src/chat/openai-chat-api.ts +6 -2
  15. package/src/chat/{openai-chat-options.ts → openai-chat-language-model-options.ts} +9 -1
  16. package/src/chat/openai-chat-language-model.ts +46 -142
  17. package/src/chat/openai-chat-prepare-tools.ts +3 -3
  18. package/src/completion/convert-openai-completion-usage.ts +1 -1
  19. package/src/completion/convert-to-openai-completion-prompt.ts +1 -2
  20. package/src/completion/map-openai-finish-reason.ts +1 -1
  21. package/src/completion/openai-completion-api.ts +5 -2
  22. package/src/completion/{openai-completion-options.ts → openai-completion-language-model-options.ts} +5 -1
  23. package/src/completion/openai-completion-language-model.ts +27 -11
  24. package/src/embedding/{openai-embedding-options.ts → openai-embedding-model-options.ts} +5 -1
  25. package/src/embedding/openai-embedding-model.ts +22 -5
  26. package/src/files/openai-files-api.ts +17 -0
  27. package/src/files/openai-files-options.ts +22 -0
  28. package/src/files/openai-files.ts +100 -0
  29. package/src/image/openai-image-model-options.ts +123 -0
  30. package/src/image/openai-image-model.ts +62 -83
  31. package/src/index.ts +13 -6
  32. package/src/internal/index.ts +6 -6
  33. package/src/openai-config.ts +7 -7
  34. package/src/openai-language-model-capabilities.ts +2 -2
  35. package/src/openai-provider.ts +42 -9
  36. package/src/openai-tools.ts +0 -1
  37. package/src/responses/convert-openai-responses-usage.ts +1 -1
  38. package/src/responses/convert-to-openai-responses-input.ts +159 -73
  39. package/src/responses/map-openai-responses-finish-reason.ts +1 -1
  40. package/src/responses/openai-responses-api.ts +58 -3
  41. package/src/responses/{openai-responses-options.ts → openai-responses-language-model-options.ts} +25 -1
  42. package/src/responses/openai-responses-language-model.ts +131 -46
  43. package/src/responses/openai-responses-prepare-tools.ts +18 -10
  44. package/src/responses/openai-responses-provider-metadata.ts +12 -2
  45. package/src/skills/openai-skills-api.ts +31 -0
  46. package/src/skills/openai-skills.ts +83 -0
  47. package/src/speech/{openai-speech-options.ts → openai-speech-model-options.ts} +5 -1
  48. package/src/speech/openai-speech-model.ts +23 -7
  49. package/src/tool/apply-patch.ts +33 -32
  50. package/src/tool/code-interpreter.ts +40 -41
  51. package/src/tool/custom.ts +2 -8
  52. package/src/tool/file-search.ts +3 -3
  53. package/src/tool/image-generation.ts +2 -2
  54. package/src/tool/local-shell.ts +2 -2
  55. package/src/tool/mcp.ts +3 -3
  56. package/src/tool/shell.ts +9 -4
  57. package/src/tool/tool-search.ts +4 -4
  58. package/src/tool/web-search-preview.ts +2 -2
  59. package/src/tool/web-search.ts +2 -2
  60. package/src/transcription/{openai-transcription-options.ts → openai-transcription-model-options.ts} +5 -1
  61. package/src/transcription/openai-transcription-model.ts +23 -7
  62. package/dist/index.d.mts +0 -1171
  63. package/dist/index.mjs +0 -6801
  64. package/dist/index.mjs.map +0 -1
  65. package/dist/internal/index.d.mts +0 -1165
  66. package/dist/internal/index.mjs +0 -6603
  67. package/dist/internal/index.mjs.map +0 -1
  68. package/src/image/openai-image-options.ts +0 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,388 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.0-canary.46
4
+
5
+ ### Patch Changes
6
+
7
+ - cd9c311: fix(openai, openai-compatible): only send null content for assistant messages with tool calls
8
+
9
+ ## 4.0.0-canary.45
10
+
11
+ ### Patch Changes
12
+
13
+ - 0c4c275: trigger initial canary release
14
+ - Updated dependencies [0c4c275]
15
+ - @ai-sdk/provider-utils@5.0.0-canary.31
16
+ - @ai-sdk/provider@4.0.0-canary.15
17
+
18
+ ## 4.0.0-beta.44
19
+
20
+ ### Patch Changes
21
+
22
+ - bada0f3: feat(openai): preserve `namespace` on function_call output items
23
+
24
+ ## 4.0.0-beta.43
25
+
26
+ ### Patch Changes
27
+
28
+ - 9ea40e0: chore(provider/openai): add type for image model options for type-safe processing
29
+
30
+ ## 4.0.0-beta.42
31
+
32
+ ### Major Changes
33
+
34
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
35
+
36
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [08d2129]
41
+ - @ai-sdk/provider-utils@5.0.0-beta.30
42
+
43
+ ## 4.0.0-beta.41
44
+
45
+ ### Patch Changes
46
+
47
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
48
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
49
+ - Updated dependencies [9bd6512]
50
+ - Updated dependencies [258c093]
51
+ - Updated dependencies [b6783da]
52
+ - @ai-sdk/provider-utils@5.0.0-beta.29
53
+ - @ai-sdk/provider@4.0.0-beta.14
54
+
55
+ ## 4.0.0-beta.40
56
+
57
+ ### Patch Changes
58
+
59
+ - 9f0e36c: trigger release for all packages after provenance setup
60
+ - Updated dependencies [9f0e36c]
61
+ - @ai-sdk/provider@4.0.0-beta.13
62
+ - @ai-sdk/provider-utils@5.0.0-beta.28
63
+
64
+ ## 4.0.0-beta.39
65
+
66
+ ### Patch Changes
67
+
68
+ - 58a2ad7: fix: more precise default message for tool execution denial
69
+ - f9acbc0: feat(provider/openai): add gpt-image-2 model support
70
+ - Updated dependencies [785fe16]
71
+ - Updated dependencies [67df0a0]
72
+ - Updated dependencies [befb78c]
73
+ - Updated dependencies [0458559]
74
+ - Updated dependencies [5852c0a]
75
+ - Updated dependencies [fc92055]
76
+ - @ai-sdk/provider-utils@5.0.0-beta.27
77
+
78
+ ## 4.0.0-beta.38
79
+
80
+ ### Patch Changes
81
+
82
+ - bfb756d: patch - send content: null instead of empty string for tool-only assistant messages
83
+ - Updated dependencies [2e98477]
84
+ - @ai-sdk/provider-utils@5.0.0-beta.26
85
+
86
+ ## 4.0.0-beta.37
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [eea8d98]
91
+ - @ai-sdk/provider-utils@5.0.0-beta.25
92
+
93
+ ## 4.0.0-beta.36
94
+
95
+ ### Patch Changes
96
+
97
+ - f807e45: Extract shared `StreamingToolCallTracker` class into `@ai-sdk/provider-utils` to deduplicate streaming tool call handling across OpenAI-compatible providers. Also adds missing `generateId()` fallback for `toolCallId` in Alibaba's `doGenerate` path and ensures all providers finalize unfinished tool calls during stream flush.
98
+ - Updated dependencies [f807e45]
99
+ - @ai-sdk/provider-utils@5.0.0-beta.24
100
+
101
+ ## 4.0.0-beta.35
102
+
103
+ ### Patch Changes
104
+
105
+ - Updated dependencies [350ea38]
106
+ - @ai-sdk/provider-utils@5.0.0-beta.23
107
+
108
+ ## 4.0.0-beta.34
109
+
110
+ ### Patch Changes
111
+
112
+ - Updated dependencies [083947b]
113
+ - @ai-sdk/provider-utils@5.0.0-beta.22
114
+
115
+ ## 4.0.0-beta.33
116
+
117
+ ### Patch Changes
118
+
119
+ - Updated dependencies [add1126]
120
+ - @ai-sdk/provider-utils@5.0.0-beta.21
121
+
122
+ ## 4.0.0-beta.32
123
+
124
+ ### Patch Changes
125
+
126
+ - 0c4ac8a: fix(openai): default undefined tool-call input to empty object before serializing tool arguments
127
+
128
+ ## 4.0.0-beta.31
129
+
130
+ ### Patch Changes
131
+
132
+ - b3976a2: Add workflow serialization support to all provider models.
133
+
134
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
135
+
136
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
137
+
138
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
139
+
140
+ - ff5eba1: feat: roll `image-*` tool output types into their equivalent `file-*` types
141
+ - Updated dependencies [b3976a2]
142
+ - Updated dependencies [ff5eba1]
143
+ - @ai-sdk/provider-utils@5.0.0-beta.20
144
+ - @ai-sdk/provider@4.0.0-beta.12
145
+
146
+ ## 4.0.0-beta.30
147
+
148
+ ### Major Changes
149
+
150
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [ef992f8]
155
+ - @ai-sdk/provider@4.0.0-beta.11
156
+ - @ai-sdk/provider-utils@5.0.0-beta.19
157
+
158
+ ## 4.0.0-beta.29
159
+
160
+ ### Patch Changes
161
+
162
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
163
+ - Updated dependencies [90e2d8a]
164
+ - @ai-sdk/provider-utils@5.0.0-beta.18
165
+
166
+ ## 4.0.0-beta.28
167
+
168
+ ### Patch Changes
169
+
170
+ - Updated dependencies [3ae1786]
171
+ - @ai-sdk/provider-utils@5.0.0-beta.17
172
+
173
+ ## 4.0.0-beta.27
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies [176466a]
178
+ - @ai-sdk/provider@4.0.0-beta.10
179
+ - @ai-sdk/provider-utils@5.0.0-beta.16
180
+
181
+ ## 4.0.0-beta.26
182
+
183
+ ### Patch Changes
184
+
185
+ - e311194: feat(ai): allow passing provider instance to `uploadFile` and `uploadSkill` as shorthand
186
+ - Updated dependencies [e311194]
187
+ - @ai-sdk/provider@4.0.0-beta.9
188
+ - @ai-sdk/provider-utils@5.0.0-beta.15
189
+
190
+ ## 4.0.0-beta.25
191
+
192
+ ### Patch Changes
193
+
194
+ - 34bd95d: feat(ai): add support for uploading provider skills using the provider references abstraction
195
+ - Updated dependencies [34bd95d]
196
+ - Updated dependencies [008271d]
197
+ - @ai-sdk/provider@4.0.0-beta.8
198
+ - @ai-sdk/provider-utils@5.0.0-beta.14
199
+
200
+ ## 4.0.0-beta.24
201
+
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies [b0c2869]
205
+ - Updated dependencies [7e26e81]
206
+ - @ai-sdk/provider-utils@5.0.0-beta.13
207
+
208
+ ## 4.0.0-beta.23
209
+
210
+ ### Patch Changes
211
+
212
+ - Updated dependencies [46d1149]
213
+ - @ai-sdk/provider-utils@5.0.0-beta.12
214
+
215
+ ## 4.0.0-beta.22
216
+
217
+ ### Patch Changes
218
+
219
+ - 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
220
+ - Updated dependencies [6fd51c0]
221
+ - @ai-sdk/provider-utils@5.0.0-beta.11
222
+ - @ai-sdk/provider@4.0.0-beta.7
223
+
224
+ ## 4.0.0-beta.21
225
+
226
+ ### Patch Changes
227
+
228
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
229
+ - Updated dependencies [c29a26f]
230
+ - @ai-sdk/provider-utils@5.0.0-beta.10
231
+ - @ai-sdk/provider@4.0.0-beta.6
232
+
233
+ ## 4.0.0-beta.20
234
+
235
+ ### Patch Changes
236
+
237
+ - 38fc777: Add AI Gateway hint to provider READMEs
238
+
239
+ ## 4.0.0-beta.19
240
+
241
+ ### Patch Changes
242
+
243
+ - Updated dependencies [2e17091]
244
+ - @ai-sdk/provider-utils@5.0.0-beta.9
245
+
246
+ ## 4.0.0-beta.18
247
+
248
+ ### Patch Changes
249
+
250
+ - Updated dependencies [986c6fd]
251
+ - Updated dependencies [493295c]
252
+ - @ai-sdk/provider-utils@5.0.0-beta.8
253
+
254
+ ## 4.0.0-beta.17
255
+
256
+ ### Patch Changes
257
+
258
+ - 817a1a6: fix(openai): support file-url parts in tool output content
259
+
260
+ ## 4.0.0-beta.16
261
+
262
+ ### Patch Changes
263
+
264
+ - 1f509d4: fix(ai): force template check on 'kind' param
265
+ - Updated dependencies [1f509d4]
266
+ - @ai-sdk/provider-utils@5.0.0-beta.7
267
+ - @ai-sdk/provider@4.0.0-beta.5
268
+
269
+ ## 4.0.0-beta.15
270
+
271
+ ### Patch Changes
272
+
273
+ - 365da1a: Add `gpt-5.4-mini`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano`, and `gpt-5.4-nano-2026-03-17` models.
274
+
275
+ ## 4.0.0-beta.14
276
+
277
+ ### Patch Changes
278
+
279
+ - e6376c2: fix(openai): preserve raw finish reason for failed responses stream events
280
+
281
+ Handle `response.failed` chunks in Responses API streaming so `finishReason.raw` is preserved from `incomplete_details.reason` (e.g. `max_output_tokens`), and map failed-without-reason cases to unified `error` instead of `other`.
282
+
283
+ ## 4.0.0-beta.13
284
+
285
+ ### Patch Changes
286
+
287
+ - 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText`
288
+ - Updated dependencies [3887c70]
289
+ - @ai-sdk/provider-utils@5.0.0-beta.6
290
+ - @ai-sdk/provider@4.0.0-beta.4
291
+
292
+ ## 4.0.0-beta.12
293
+
294
+ ### Patch Changes
295
+
296
+ - d9a1e9a: feat(openai): add server side compaction for openai
297
+
298
+ ## 4.0.0-beta.11
299
+
300
+ ### Patch Changes
301
+
302
+ - Updated dependencies [776b617]
303
+ - @ai-sdk/provider-utils@5.0.0-beta.5
304
+ - @ai-sdk/provider@4.0.0-beta.3
305
+
306
+ ## 4.0.0-beta.10
307
+
308
+ ### Major Changes
309
+
310
+ - 61753c3: ### `@ai-sdk/openai`: remove redundant `name` argument from `openai.tools.customTool()`
311
+
312
+ `openai.tools.customTool()` no longer accepts a `name` field. the tool name is now derived from the sdk tool key (the object key in the `tools` object).
313
+
314
+ migration: remove the `name` property from `customTool()` calls. the object key is now used as the tool name sent to the openai api.
315
+
316
+ before:
317
+
318
+ ```ts
319
+ tools: {
320
+ write_sql: openai.tools.customTool({
321
+ name: 'write_sql',
322
+ description: '...',
323
+ }),
324
+ }
325
+ ```
326
+
327
+ after:
328
+
329
+ ```ts
330
+ tools: {
331
+ write_sql: openai.tools.customTool({
332
+ description: '...',
333
+ }),
334
+ }
335
+ ```
336
+
337
+ ### `@ai-sdk/provider-utils`: `createToolNameMapping()` no longer accepts the `resolveProviderToolName` parameter
338
+
339
+ before: tool name can be set dynamically
340
+
341
+ ```ts
342
+ const toolNameMapping = createToolNameMapping({
343
+ tools,
344
+ providerToolNames: {
345
+ "openai.code_interpreter": "code_interpreter",
346
+ "openai.file_search": "file_search",
347
+ "openai.image_generation": "image_generation",
348
+ "openai.local_shell": "local_shell",
349
+ "openai.shell": "shell",
350
+ "openai.web_search": "web_search",
351
+ "openai.web_search_preview": "web_search_preview",
352
+ "openai.mcp": "mcp",
353
+ "openai.apply_patch": "apply_patch",
354
+ },
355
+ resolveProviderToolName: (tool) =>
356
+ tool.id === "openai.custom"
357
+ ? (tool.args as { name?: string }).name
358
+ : undefined,
359
+ });
360
+ ```
361
+
362
+ after: tool name is static based on `tools` keys
363
+
364
+ ```
365
+ const toolNameMapping = createToolNameMapping({
366
+ tools,
367
+ providerToolNames: {
368
+ 'openai.code_interpreter': 'code_interpreter',
369
+ 'openai.file_search': 'file_search',
370
+ 'openai.image_generation': 'image_generation',
371
+ 'openai.local_shell': 'local_shell',
372
+ 'openai.shell': 'shell',
373
+ 'openai.web_search': 'web_search',
374
+ 'openai.web_search_preview': 'web_search_preview',
375
+ 'openai.mcp': 'mcp',
376
+ 'openai.apply_patch': 'apply_patch',
377
+ }
378
+ });
379
+ ```
380
+
381
+ ### Patch Changes
382
+
383
+ - Updated dependencies [61753c3]
384
+ - @ai-sdk/provider-utils@5.0.0-beta.4
385
+
3
386
  ## 4.0.0-beta.9
4
387
 
5
388
  ### Patch Changes
@@ -410,13 +793,13 @@
410
793
  Before
411
794
 
412
795
  ```ts
413
- model.textEmbeddingModel('my-model-id');
796
+ model.textEmbeddingModel("my-model-id");
414
797
  ```
415
798
 
416
799
  After
417
800
 
418
801
  ```ts
419
- model.embeddingModel('my-model-id');
802
+ model.embeddingModel("my-model-id");
420
803
  ```
421
804
 
422
805
  - 60f4775: fix: remove code for unsuported o1-mini and o1-preview models
@@ -426,15 +809,15 @@
426
809
  - 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
427
810
 
428
811
  ```ts
429
- import { openai, type OpenAIChatLanguageModelOptions } from '@ai-sdk/openai';
430
- import { generateText } from 'ai';
812
+ import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
813
+ import { generateText } from "ai";
431
814
 
432
815
  await generateText({
433
- model: openai.chat('gpt-4o'),
434
- prompt: 'Invent a new holiday and describe its traditions.',
816
+ model: openai.chat("gpt-4o"),
817
+ prompt: "Invent a new holiday and describe its traditions.",
435
818
  providerOptions: {
436
819
  openai: {
437
- user: 'user-123',
820
+ user: "user-123",
438
821
  } satisfies OpenAIChatLanguageModelOptions,
439
822
  },
440
823
  });
@@ -835,13 +1218,13 @@
835
1218
  Before
836
1219
 
837
1220
  ```ts
838
- model.textEmbeddingModel('my-model-id');
1221
+ model.textEmbeddingModel("my-model-id");
839
1222
  ```
840
1223
 
841
1224
  After
842
1225
 
843
1226
  ```ts
844
- model.embeddingModel('my-model-id');
1227
+ model.embeddingModel("my-model-id");
845
1228
  ```
846
1229
 
847
1230
  - Updated dependencies [8d9e8ad]
@@ -1311,15 +1694,15 @@
1311
1694
  - 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
1312
1695
 
1313
1696
  ```ts
1314
- import { openai, type OpenAIChatLanguageModelOptions } from '@ai-sdk/openai';
1315
- import { generateText } from 'ai';
1697
+ import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
1698
+ import { generateText } from "ai";
1316
1699
 
1317
1700
  await generateText({
1318
- model: openai.chat('gpt-4o'),
1319
- prompt: 'Invent a new holiday and describe its traditions.',
1701
+ model: openai.chat("gpt-4o"),
1702
+ prompt: "Invent a new holiday and describe its traditions.",
1320
1703
  providerOptions: {
1321
1704
  openai: {
1322
- user: 'user-123',
1705
+ user: "user-123",
1323
1706
  } satisfies OpenAIChatLanguageModelOptions,
1324
1707
  },
1325
1708
  });
@@ -1615,7 +1998,7 @@
1615
1998
 
1616
1999
  ```js
1617
2000
  await generateImage({
1618
- model: luma.image('photon-flash-1', {
2001
+ model: luma.image("photon-flash-1", {
1619
2002
  maxImagesPerCall: 5,
1620
2003
  pollIntervalMillis: 500,
1621
2004
  }),
@@ -1628,7 +2011,7 @@
1628
2011
 
1629
2012
  ```js
1630
2013
  await generateImage({
1631
- model: luma.image('photon-flash-1'),
2014
+ model: luma.image("photon-flash-1"),
1632
2015
  prompt,
1633
2016
  n: 10,
1634
2017
  maxImagesPerCall: 5,
@@ -1690,10 +2073,10 @@
1690
2073
  The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
1691
2074
 
1692
2075
  ```js
1693
- const prompt = 'Santa Claus driving a Cadillac';
2076
+ const prompt = "Santa Claus driving a Cadillac";
1694
2077
 
1695
2078
  const { providerMetadata } = await experimental_generateImage({
1696
- model: openai.image('dall-e-3'),
2079
+ model: openai.image("dall-e-3"),
1697
2080
  prompt,
1698
2081
  });
1699
2082
 
@@ -1992,7 +2375,7 @@
1992
2375
 
1993
2376
  ```js
1994
2377
  await generateImage({
1995
- model: luma.image('photon-flash-1', {
2378
+ model: luma.image("photon-flash-1", {
1996
2379
  maxImagesPerCall: 5,
1997
2380
  pollIntervalMillis: 500,
1998
2381
  }),
@@ -2005,7 +2388,7 @@
2005
2388
 
2006
2389
  ```js
2007
2390
  await generateImage({
2008
- model: luma.image('photon-flash-1'),
2391
+ model: luma.image("photon-flash-1"),
2009
2392
  prompt,
2010
2393
  n: 10,
2011
2394
  maxImagesPerCall: 5,
@@ -2050,10 +2433,10 @@
2050
2433
  The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
2051
2434
 
2052
2435
  ```js
2053
- const prompt = 'Santa Claus driving a Cadillac';
2436
+ const prompt = "Santa Claus driving a Cadillac";
2054
2437
 
2055
2438
  const { providerMetadata } = await experimental_generateImage({
2056
- model: openai.image('dall-e-3'),
2439
+ model: openai.image("dall-e-3"),
2057
2440
  prompt,
2058
2441
  });
2059
2442
 
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  The **[OpenAI provider](https://ai-sdk.dev/providers/ai-sdk-providers/openai)** for the [AI SDK](https://ai-sdk.dev/docs)
4
4
  contains language model support for the OpenAI chat and completion APIs and embedding model support for the OpenAI embeddings API.
5
5
 
6
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access OpenAI (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
7
+
6
8
  ## Setup
7
9
 
8
10
  The OpenAI provider is available in the `@ai-sdk/openai` module. You can install it with