@ai-sdk/openai 3.0.32 → 3.0.33
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 +6 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +2 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +2 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/chat/openai-chat-options.ts +13 -2
- package/src/completion/openai-completion-options.ts +4 -1
- package/src/image/openai-image-options.ts +2 -0
- package/src/responses/openai-responses-options.ts +5 -0
- package/src/speech/openai-speech-options.ts +4 -0
- package/src/transcription/openai-transcription-options.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"tsup": "^8",
|
|
45
45
|
"typescript": "5.8.3",
|
|
46
46
|
"zod": "3.25.76",
|
|
47
|
-
"@ai-
|
|
48
|
-
"@
|
|
47
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
48
|
+
"@ai-sdk/test-server": "1.0.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -21,17 +21,25 @@ export type OpenAIChatModelId =
|
|
|
21
21
|
| 'gpt-4o-2024-05-13'
|
|
22
22
|
| 'gpt-4o-2024-08-06'
|
|
23
23
|
| 'gpt-4o-2024-11-20'
|
|
24
|
+
| 'gpt-4o-audio-preview'
|
|
25
|
+
| 'gpt-4o-audio-preview-2024-12-17'
|
|
26
|
+
| 'gpt-4o-audio-preview-2025-06-03'
|
|
24
27
|
| 'gpt-4o-mini'
|
|
25
28
|
| 'gpt-4o-mini-2024-07-18'
|
|
29
|
+
| 'gpt-4o-mini-audio-preview'
|
|
30
|
+
| 'gpt-4o-mini-audio-preview-2024-12-17'
|
|
31
|
+
| 'gpt-4o-search-preview'
|
|
32
|
+
| 'gpt-4o-search-preview-2025-03-11'
|
|
33
|
+
| 'gpt-4o-mini-search-preview'
|
|
34
|
+
| 'gpt-4o-mini-search-preview-2025-03-11'
|
|
26
35
|
| 'gpt-4-turbo'
|
|
27
36
|
| 'gpt-4-turbo-2024-04-09'
|
|
28
37
|
| 'gpt-4'
|
|
29
38
|
| 'gpt-4-0613'
|
|
30
|
-
| 'gpt-4.5-preview'
|
|
31
|
-
| 'gpt-4.5-preview-2025-02-27'
|
|
32
39
|
| 'gpt-3.5-turbo-0125'
|
|
33
40
|
| 'gpt-3.5-turbo'
|
|
34
41
|
| 'gpt-3.5-turbo-1106'
|
|
42
|
+
| 'gpt-3.5-turbo-16k'
|
|
35
43
|
| 'chatgpt-4o-latest'
|
|
36
44
|
| 'gpt-5'
|
|
37
45
|
| 'gpt-5-2025-08-07'
|
|
@@ -41,10 +49,13 @@ export type OpenAIChatModelId =
|
|
|
41
49
|
| 'gpt-5-nano-2025-08-07'
|
|
42
50
|
| 'gpt-5-chat-latest'
|
|
43
51
|
| 'gpt-5.1'
|
|
52
|
+
| 'gpt-5.1-2025-11-13'
|
|
44
53
|
| 'gpt-5.1-chat-latest'
|
|
45
54
|
| 'gpt-5.2'
|
|
55
|
+
| 'gpt-5.2-2025-12-11'
|
|
46
56
|
| 'gpt-5.2-chat-latest'
|
|
47
57
|
| 'gpt-5.2-pro'
|
|
58
|
+
| 'gpt-5.2-pro-2025-12-11'
|
|
48
59
|
| (string & {});
|
|
49
60
|
|
|
50
61
|
export const openaiLanguageModelChatOptions = lazySchema(() =>
|
|
@@ -2,7 +2,10 @@ import { InferSchema, lazySchema, zodSchema } from '@ai-sdk/provider-utils';
|
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
|
|
4
4
|
// https://platform.openai.com/docs/models
|
|
5
|
-
export type OpenAICompletionModelId =
|
|
5
|
+
export type OpenAICompletionModelId =
|
|
6
|
+
| 'gpt-3.5-turbo-instruct'
|
|
7
|
+
| 'gpt-3.5-turbo-instruct-0914'
|
|
8
|
+
| (string & {});
|
|
6
9
|
|
|
7
10
|
export const openaiLanguageModelCompletionOptions = lazySchema(() =>
|
|
8
11
|
zodSchema(
|
|
@@ -4,6 +4,7 @@ export type OpenAIImageModelId =
|
|
|
4
4
|
| 'gpt-image-1'
|
|
5
5
|
| 'gpt-image-1-mini'
|
|
6
6
|
| 'gpt-image-1.5'
|
|
7
|
+
| 'chatgpt-image-latest'
|
|
7
8
|
| (string & {});
|
|
8
9
|
|
|
9
10
|
// https://platform.openai.com/docs/guides/images
|
|
@@ -13,6 +14,7 @@ export const modelMaxImagesPerCall: Record<OpenAIImageModelId, number> = {
|
|
|
13
14
|
'gpt-image-1': 10,
|
|
14
15
|
'gpt-image-1-mini': 10,
|
|
15
16
|
'gpt-image-1.5': 10,
|
|
17
|
+
'chatgpt-image-latest': 10,
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const defaultResponseFormatPrefixes = [
|
|
@@ -105,13 +105,16 @@ export type OpenAIResponsesModelId =
|
|
|
105
105
|
| 'gpt-4o-mini'
|
|
106
106
|
| 'gpt-4o'
|
|
107
107
|
| 'gpt-5.1'
|
|
108
|
+
| 'gpt-5.1-2025-11-13'
|
|
108
109
|
| 'gpt-5.1-chat-latest'
|
|
109
110
|
| 'gpt-5.1-codex-mini'
|
|
110
111
|
| 'gpt-5.1-codex'
|
|
111
112
|
| 'gpt-5.1-codex-max'
|
|
112
113
|
| 'gpt-5.2'
|
|
114
|
+
| 'gpt-5.2-2025-12-11'
|
|
113
115
|
| 'gpt-5.2-chat-latest'
|
|
114
116
|
| 'gpt-5.2-pro'
|
|
117
|
+
| 'gpt-5.2-pro-2025-12-11'
|
|
115
118
|
| 'gpt-5.2-codex'
|
|
116
119
|
| 'gpt-5.3-codex'
|
|
117
120
|
| 'gpt-5-2025-08-07'
|
|
@@ -130,6 +133,8 @@ export type OpenAIResponsesModelId =
|
|
|
130
133
|
| 'o3-mini-2025-01-31'
|
|
131
134
|
| 'o3-mini'
|
|
132
135
|
| 'o3'
|
|
136
|
+
| 'o4-mini'
|
|
137
|
+
| 'o4-mini-2025-04-16'
|
|
133
138
|
| (string & {});
|
|
134
139
|
|
|
135
140
|
// TODO AI SDK 6: use optional here instead of nullish
|
|
@@ -3,8 +3,12 @@ import { z } from 'zod/v4';
|
|
|
3
3
|
|
|
4
4
|
export type OpenAISpeechModelId =
|
|
5
5
|
| 'tts-1'
|
|
6
|
+
| 'tts-1-1106'
|
|
6
7
|
| 'tts-1-hd'
|
|
8
|
+
| 'tts-1-hd-1106'
|
|
7
9
|
| 'gpt-4o-mini-tts'
|
|
10
|
+
| 'gpt-4o-mini-tts-2025-03-20'
|
|
11
|
+
| 'gpt-4o-mini-tts-2025-12-15'
|
|
8
12
|
| (string & {});
|
|
9
13
|
|
|
10
14
|
// https://platform.openai.com/docs/api-reference/audio/createSpeech
|
|
@@ -4,7 +4,10 @@ import { z } from 'zod/v4';
|
|
|
4
4
|
export type OpenAITranscriptionModelId =
|
|
5
5
|
| 'whisper-1'
|
|
6
6
|
| 'gpt-4o-mini-transcribe'
|
|
7
|
+
| 'gpt-4o-mini-transcribe-2025-03-20'
|
|
8
|
+
| 'gpt-4o-mini-transcribe-2025-12-15'
|
|
7
9
|
| 'gpt-4o-transcribe'
|
|
10
|
+
| 'gpt-4o-transcribe-diarize'
|
|
8
11
|
| (string & {});
|
|
9
12
|
|
|
10
13
|
// https://platform.openai.com/docs/api-reference/audio/createTranscription
|