@ai-sdk/openai 4.0.0-beta.3 → 4.0.0-beta.30
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/CHANGELOG.md +302 -22
- package/README.md +2 -0
- package/dist/index.d.ts +139 -36
- package/dist/index.js +2200 -1436
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +107 -41
- package/dist/internal/index.js +1969 -1457
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +274 -9
- package/package.json +9 -12
- package/src/chat/convert-openai-chat-usage.ts +2 -2
- package/src/chat/convert-to-openai-chat-messages.ts +26 -15
- package/src/chat/map-openai-finish-reason.ts +2 -2
- package/src/chat/openai-chat-language-model.ts +32 -25
- package/src/chat/openai-chat-options.ts +5 -0
- package/src/chat/openai-chat-prepare-tools.ts +6 -6
- package/src/completion/convert-openai-completion-usage.ts +2 -2
- package/src/completion/convert-to-openai-completion-prompt.ts +2 -2
- package/src/completion/map-openai-finish-reason.ts +2 -2
- package/src/completion/openai-completion-language-model.ts +20 -20
- package/src/embedding/openai-embedding-model.ts +5 -5
- package/src/files/openai-files-api.ts +17 -0
- package/src/files/openai-files-options.ts +18 -0
- package/src/files/openai-files.ts +102 -0
- package/src/image/openai-image-model.ts +9 -9
- package/src/index.ts +2 -0
- package/src/openai-config.ts +5 -5
- package/src/openai-language-model-capabilities.ts +3 -2
- package/src/openai-provider.ts +54 -21
- package/src/openai-tools.ts +12 -1
- package/src/responses/convert-openai-responses-usage.ts +2 -2
- package/src/responses/convert-to-openai-responses-input.ts +188 -14
- package/src/responses/map-openai-responses-finish-reason.ts +2 -2
- package/src/responses/openai-responses-api.ts +136 -2
- package/src/responses/openai-responses-language-model.ts +233 -37
- package/src/responses/openai-responses-options.ts +24 -2
- package/src/responses/openai-responses-prepare-tools.ts +47 -14
- package/src/responses/openai-responses-provider-metadata.ts +10 -0
- package/src/skills/openai-skills-api.ts +31 -0
- package/src/skills/openai-skills.ts +87 -0
- package/src/speech/openai-speech-model.ts +7 -7
- package/src/tool/custom.ts +0 -6
- package/src/tool/shell.ts +7 -2
- package/src/tool/tool-search.ts +98 -0
- package/src/transcription/openai-transcription-model.ts +8 -8
- package/dist/index.d.mts +0 -1107
- package/dist/index.mjs +0 -6497
- package/dist/index.mjs.map +0 -1
- package/dist/internal/index.d.mts +0 -1137
- package/dist/internal/index.mjs +0 -6310
- package/dist/internal/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,285 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.30
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [ef992f8]
|
|
12
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
13
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
14
|
+
|
|
15
|
+
## 4.0.0-beta.29
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
|
|
20
|
+
- Updated dependencies [90e2d8a]
|
|
21
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
22
|
+
|
|
23
|
+
## 4.0.0-beta.28
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [3ae1786]
|
|
28
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
29
|
+
|
|
30
|
+
## 4.0.0-beta.27
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [176466a]
|
|
35
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
36
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
37
|
+
|
|
38
|
+
## 4.0.0-beta.26
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- e311194: feat(ai): allow passing provider instance to `uploadFile` and `uploadSkill` as shorthand
|
|
43
|
+
- Updated dependencies [e311194]
|
|
44
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
45
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
46
|
+
|
|
47
|
+
## 4.0.0-beta.25
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- 34bd95d: feat(ai): add support for uploading provider skills using the provider references abstraction
|
|
52
|
+
- Updated dependencies [34bd95d]
|
|
53
|
+
- Updated dependencies [008271d]
|
|
54
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
55
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
56
|
+
|
|
57
|
+
## 4.0.0-beta.24
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [b0c2869]
|
|
62
|
+
- Updated dependencies [7e26e81]
|
|
63
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
64
|
+
|
|
65
|
+
## 4.0.0-beta.23
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [46d1149]
|
|
70
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
71
|
+
|
|
72
|
+
## 4.0.0-beta.22
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
|
|
77
|
+
- Updated dependencies [6fd51c0]
|
|
78
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
79
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
80
|
+
|
|
81
|
+
## 4.0.0-beta.21
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
86
|
+
- Updated dependencies [c29a26f]
|
|
87
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
88
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
89
|
+
|
|
90
|
+
## 4.0.0-beta.20
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
95
|
+
|
|
96
|
+
## 4.0.0-beta.19
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- Updated dependencies [2e17091]
|
|
101
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
102
|
+
|
|
103
|
+
## 4.0.0-beta.18
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [986c6fd]
|
|
108
|
+
- Updated dependencies [493295c]
|
|
109
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
110
|
+
|
|
111
|
+
## 4.0.0-beta.17
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- 817a1a6: fix(openai): support file-url parts in tool output content
|
|
116
|
+
|
|
117
|
+
## 4.0.0-beta.16
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- 1f509d4: fix(ai): force template check on 'kind' param
|
|
122
|
+
- Updated dependencies [1f509d4]
|
|
123
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
124
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
125
|
+
|
|
126
|
+
## 4.0.0-beta.15
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- 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.
|
|
131
|
+
|
|
132
|
+
## 4.0.0-beta.14
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- e6376c2: fix(openai): preserve raw finish reason for failed responses stream events
|
|
137
|
+
|
|
138
|
+
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`.
|
|
139
|
+
|
|
140
|
+
## 4.0.0-beta.13
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText`
|
|
145
|
+
- Updated dependencies [3887c70]
|
|
146
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
147
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
148
|
+
|
|
149
|
+
## 4.0.0-beta.12
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- d9a1e9a: feat(openai): add server side compaction for openai
|
|
154
|
+
|
|
155
|
+
## 4.0.0-beta.11
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies [776b617]
|
|
160
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
161
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
162
|
+
|
|
163
|
+
## 4.0.0-beta.10
|
|
164
|
+
|
|
165
|
+
### Major Changes
|
|
166
|
+
|
|
167
|
+
- 61753c3: ### `@ai-sdk/openai`: remove redundant `name` argument from `openai.tools.customTool()`
|
|
168
|
+
|
|
169
|
+
`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).
|
|
170
|
+
|
|
171
|
+
migration: remove the `name` property from `customTool()` calls. the object key is now used as the tool name sent to the openai api.
|
|
172
|
+
|
|
173
|
+
before:
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
tools: {
|
|
177
|
+
write_sql: openai.tools.customTool({
|
|
178
|
+
name: 'write_sql',
|
|
179
|
+
description: '...',
|
|
180
|
+
}),
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
after:
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
tools: {
|
|
188
|
+
write_sql: openai.tools.customTool({
|
|
189
|
+
description: '...',
|
|
190
|
+
}),
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### `@ai-sdk/provider-utils`: `createToolNameMapping()` no longer accepts the `resolveProviderToolName` parameter
|
|
195
|
+
|
|
196
|
+
before: tool name can be set dynamically
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
const toolNameMapping = createToolNameMapping({
|
|
200
|
+
tools,
|
|
201
|
+
providerToolNames: {
|
|
202
|
+
"openai.code_interpreter": "code_interpreter",
|
|
203
|
+
"openai.file_search": "file_search",
|
|
204
|
+
"openai.image_generation": "image_generation",
|
|
205
|
+
"openai.local_shell": "local_shell",
|
|
206
|
+
"openai.shell": "shell",
|
|
207
|
+
"openai.web_search": "web_search",
|
|
208
|
+
"openai.web_search_preview": "web_search_preview",
|
|
209
|
+
"openai.mcp": "mcp",
|
|
210
|
+
"openai.apply_patch": "apply_patch",
|
|
211
|
+
},
|
|
212
|
+
resolveProviderToolName: (tool) =>
|
|
213
|
+
tool.id === "openai.custom"
|
|
214
|
+
? (tool.args as { name?: string }).name
|
|
215
|
+
: undefined,
|
|
216
|
+
});
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
after: tool name is static based on `tools` keys
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
const toolNameMapping = createToolNameMapping({
|
|
223
|
+
tools,
|
|
224
|
+
providerToolNames: {
|
|
225
|
+
'openai.code_interpreter': 'code_interpreter',
|
|
226
|
+
'openai.file_search': 'file_search',
|
|
227
|
+
'openai.image_generation': 'image_generation',
|
|
228
|
+
'openai.local_shell': 'local_shell',
|
|
229
|
+
'openai.shell': 'shell',
|
|
230
|
+
'openai.web_search': 'web_search',
|
|
231
|
+
'openai.web_search_preview': 'web_search_preview',
|
|
232
|
+
'openai.mcp': 'mcp',
|
|
233
|
+
'openai.apply_patch': 'apply_patch',
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Patch Changes
|
|
239
|
+
|
|
240
|
+
- Updated dependencies [61753c3]
|
|
241
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
242
|
+
|
|
243
|
+
## 4.0.0-beta.9
|
|
244
|
+
|
|
245
|
+
### Patch Changes
|
|
246
|
+
|
|
247
|
+
- 156cdf0: feat(openai): add new tool search tool
|
|
248
|
+
|
|
249
|
+
## 4.0.0-beta.8
|
|
250
|
+
|
|
251
|
+
### Patch Changes
|
|
252
|
+
|
|
253
|
+
- Updated dependencies [f7d4f01]
|
|
254
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
255
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
256
|
+
|
|
257
|
+
## 4.0.0-beta.7
|
|
258
|
+
|
|
259
|
+
### Patch Changes
|
|
260
|
+
|
|
261
|
+
- Updated dependencies [5c2a5a2]
|
|
262
|
+
- @ai-sdk/provider@4.0.0-beta.1
|
|
263
|
+
- @ai-sdk/provider-utils@5.0.0-beta.2
|
|
264
|
+
|
|
265
|
+
## 4.0.0-beta.6
|
|
266
|
+
|
|
267
|
+
### Patch Changes
|
|
268
|
+
|
|
269
|
+
- 83f9d04: feat(openai): upgrade v3 specs to v4
|
|
270
|
+
|
|
271
|
+
## 4.0.0-beta.5
|
|
272
|
+
|
|
273
|
+
### Patch Changes
|
|
274
|
+
|
|
275
|
+
- ac18f89: feat(provider/openai): add `gpt-5.3-chat-latest`
|
|
276
|
+
|
|
277
|
+
## 4.0.0-beta.4
|
|
278
|
+
|
|
279
|
+
### Patch Changes
|
|
280
|
+
|
|
281
|
+
- a71d345: fix(provider/openai): drop reasoning parts without encrypted content when store: false
|
|
282
|
+
|
|
3
283
|
## 4.0.0-beta.3
|
|
4
284
|
|
|
5
285
|
### Patch Changes
|
|
@@ -370,13 +650,13 @@
|
|
|
370
650
|
Before
|
|
371
651
|
|
|
372
652
|
```ts
|
|
373
|
-
model.textEmbeddingModel(
|
|
653
|
+
model.textEmbeddingModel("my-model-id");
|
|
374
654
|
```
|
|
375
655
|
|
|
376
656
|
After
|
|
377
657
|
|
|
378
658
|
```ts
|
|
379
|
-
model.embeddingModel(
|
|
659
|
+
model.embeddingModel("my-model-id");
|
|
380
660
|
```
|
|
381
661
|
|
|
382
662
|
- 60f4775: fix: remove code for unsuported o1-mini and o1-preview models
|
|
@@ -386,15 +666,15 @@
|
|
|
386
666
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
387
667
|
|
|
388
668
|
```ts
|
|
389
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
390
|
-
import { generateText } from
|
|
669
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
670
|
+
import { generateText } from "ai";
|
|
391
671
|
|
|
392
672
|
await generateText({
|
|
393
|
-
model: openai.chat(
|
|
394
|
-
prompt:
|
|
673
|
+
model: openai.chat("gpt-4o"),
|
|
674
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
395
675
|
providerOptions: {
|
|
396
676
|
openai: {
|
|
397
|
-
user:
|
|
677
|
+
user: "user-123",
|
|
398
678
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
399
679
|
},
|
|
400
680
|
});
|
|
@@ -795,13 +1075,13 @@
|
|
|
795
1075
|
Before
|
|
796
1076
|
|
|
797
1077
|
```ts
|
|
798
|
-
model.textEmbeddingModel(
|
|
1078
|
+
model.textEmbeddingModel("my-model-id");
|
|
799
1079
|
```
|
|
800
1080
|
|
|
801
1081
|
After
|
|
802
1082
|
|
|
803
1083
|
```ts
|
|
804
|
-
model.embeddingModel(
|
|
1084
|
+
model.embeddingModel("my-model-id");
|
|
805
1085
|
```
|
|
806
1086
|
|
|
807
1087
|
- Updated dependencies [8d9e8ad]
|
|
@@ -1271,15 +1551,15 @@
|
|
|
1271
1551
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
1272
1552
|
|
|
1273
1553
|
```ts
|
|
1274
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
1275
|
-
import { generateText } from
|
|
1554
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1555
|
+
import { generateText } from "ai";
|
|
1276
1556
|
|
|
1277
1557
|
await generateText({
|
|
1278
|
-
model: openai.chat(
|
|
1279
|
-
prompt:
|
|
1558
|
+
model: openai.chat("gpt-4o"),
|
|
1559
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
1280
1560
|
providerOptions: {
|
|
1281
1561
|
openai: {
|
|
1282
|
-
user:
|
|
1562
|
+
user: "user-123",
|
|
1283
1563
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
1284
1564
|
},
|
|
1285
1565
|
});
|
|
@@ -1575,7 +1855,7 @@
|
|
|
1575
1855
|
|
|
1576
1856
|
```js
|
|
1577
1857
|
await generateImage({
|
|
1578
|
-
model: luma.image(
|
|
1858
|
+
model: luma.image("photon-flash-1", {
|
|
1579
1859
|
maxImagesPerCall: 5,
|
|
1580
1860
|
pollIntervalMillis: 500,
|
|
1581
1861
|
}),
|
|
@@ -1588,7 +1868,7 @@
|
|
|
1588
1868
|
|
|
1589
1869
|
```js
|
|
1590
1870
|
await generateImage({
|
|
1591
|
-
model: luma.image(
|
|
1871
|
+
model: luma.image("photon-flash-1"),
|
|
1592
1872
|
prompt,
|
|
1593
1873
|
n: 10,
|
|
1594
1874
|
maxImagesPerCall: 5,
|
|
@@ -1650,10 +1930,10 @@
|
|
|
1650
1930
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
1651
1931
|
|
|
1652
1932
|
```js
|
|
1653
|
-
const prompt =
|
|
1933
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
1654
1934
|
|
|
1655
1935
|
const { providerMetadata } = await experimental_generateImage({
|
|
1656
|
-
model: openai.image(
|
|
1936
|
+
model: openai.image("dall-e-3"),
|
|
1657
1937
|
prompt,
|
|
1658
1938
|
});
|
|
1659
1939
|
|
|
@@ -1952,7 +2232,7 @@
|
|
|
1952
2232
|
|
|
1953
2233
|
```js
|
|
1954
2234
|
await generateImage({
|
|
1955
|
-
model: luma.image(
|
|
2235
|
+
model: luma.image("photon-flash-1", {
|
|
1956
2236
|
maxImagesPerCall: 5,
|
|
1957
2237
|
pollIntervalMillis: 500,
|
|
1958
2238
|
}),
|
|
@@ -1965,7 +2245,7 @@
|
|
|
1965
2245
|
|
|
1966
2246
|
```js
|
|
1967
2247
|
await generateImage({
|
|
1968
|
-
model: luma.image(
|
|
2248
|
+
model: luma.image("photon-flash-1"),
|
|
1969
2249
|
prompt,
|
|
1970
2250
|
n: 10,
|
|
1971
2251
|
maxImagesPerCall: 5,
|
|
@@ -2010,10 +2290,10 @@
|
|
|
2010
2290
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
2011
2291
|
|
|
2012
2292
|
```js
|
|
2013
|
-
const prompt =
|
|
2293
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
2014
2294
|
|
|
2015
2295
|
const { providerMetadata } = await experimental_generateImage({
|
|
2016
|
-
model: openai.image(
|
|
2296
|
+
model: openai.image("dall-e-3"),
|
|
2017
2297
|
prompt,
|
|
2018
2298
|
});
|
|
2019
2299
|
|
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
|