@ai-sdk/openai 4.0.9 → 4.0.11

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - b2b1bb9: feat(provider/openai): add GPT-5.6 reasoning and prompt cache controls
8
+
9
+ ## 4.0.10
10
+
11
+ ### Patch Changes
12
+
13
+ - fdb6d5d: feat(provider/openai,provider/gateway): add gpt-5.6 model ids
14
+ - Updated dependencies [0f93c57]
15
+ - @ai-sdk/provider@4.0.3
16
+ - @ai-sdk/provider-utils@5.0.7
17
+
3
18
  ## 4.0.9
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -3,13 +3,13 @@ import { JSONValue, ProviderV4, LanguageModelV4, EmbeddingModelV4, ImageModelV4,
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { InferSchema, FetchFunction, WebSocketConstructor } from '@ai-sdk/provider-utils';
5
5
 
6
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | (string & {});
6
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | (string & {});
7
7
  declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<{
8
8
  logitBias?: Record<number, number> | undefined;
9
9
  logprobs?: number | boolean | undefined;
10
10
  parallelToolCalls?: boolean | undefined;
11
11
  user?: string | undefined;
12
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
12
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
13
13
  maxCompletionTokens?: number | undefined;
14
14
  store?: boolean | undefined;
15
15
  metadata?: Record<string, string> | undefined;
@@ -18,6 +18,10 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
18
18
  strictJsonSchema?: boolean | undefined;
19
19
  textVerbosity?: "low" | "medium" | "high" | undefined;
20
20
  promptCacheKey?: string | undefined;
21
+ promptCacheOptions?: {
22
+ mode?: "explicit" | "implicit" | undefined;
23
+ ttl?: "30m" | undefined;
24
+ } | undefined;
21
25
  promptCacheRetention?: "in_memory" | "24h" | undefined;
22
26
  safetyIdentifier?: string | undefined;
23
27
  systemMessageMode?: "remove" | "system" | "developer" | undefined;
@@ -244,6 +248,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
244
248
  output_tokens: number;
245
249
  input_tokens_details?: {
246
250
  cached_tokens?: number | null | undefined;
251
+ cache_write_tokens?: number | null | undefined;
247
252
  orchestration_input_tokens?: number | null | undefined;
248
253
  orchestration_input_cached_tokens?: number | null | undefined;
249
254
  } | null | undefined;
@@ -255,6 +260,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
255
260
  incomplete_details?: {
256
261
  reason: string;
257
262
  } | null | undefined;
263
+ reasoning?: {
264
+ context?: string | null | undefined;
265
+ } | null | undefined;
258
266
  service_tier?: string | null | undefined;
259
267
  };
260
268
  } | {
@@ -273,6 +281,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
273
281
  output_tokens: number;
274
282
  input_tokens_details?: {
275
283
  cached_tokens?: number | null | undefined;
284
+ cache_write_tokens?: number | null | undefined;
276
285
  orchestration_input_tokens?: number | null | undefined;
277
286
  orchestration_input_cached_tokens?: number | null | undefined;
278
287
  } | null | undefined;
@@ -281,6 +290,9 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
281
290
  orchestration_output_tokens?: number | null | undefined;
282
291
  } | null | undefined;
283
292
  } | null | undefined;
293
+ reasoning?: {
294
+ context?: string | null | undefined;
295
+ } | null | undefined;
284
296
  service_tier?: string | null | undefined;
285
297
  };
286
298
  } | {
@@ -1061,7 +1073,7 @@ declare const openaiTools: {
1061
1073
  }, {}>;
1062
1074
  };
1063
1075
 
1064
- type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
1076
+ type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5.5' | 'gpt-5.5-2026-04-23' | 'gpt-5.6' | 'gpt-5.6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
1065
1077
  declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
1066
1078
  conversation?: string | null | undefined;
1067
1079
  include?: ("web_search_call.results" | "file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
@@ -1072,8 +1084,14 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
1072
1084
  parallelToolCalls?: boolean | null | undefined;
1073
1085
  previousResponseId?: string | null | undefined;
1074
1086
  promptCacheKey?: string | null | undefined;
1087
+ promptCacheOptions?: {
1088
+ mode?: "explicit" | "implicit" | undefined;
1089
+ ttl?: "30m" | undefined;
1090
+ } | undefined;
1075
1091
  promptCacheRetention?: "in_memory" | "24h" | null | undefined;
1076
1092
  reasoningEffort?: string | null | undefined;
1093
+ reasoningMode?: "standard" | "pro" | undefined;
1094
+ reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
1077
1095
  reasoningSummary?: string | null | undefined;
1078
1096
  safetyIdentifier?: string | null | undefined;
1079
1097
  serviceTier?: "default" | "auto" | "flex" | "priority" | null | undefined;
@@ -1269,6 +1287,7 @@ type ResponsesProviderMetadata = {
1269
1287
  responseId: string | null | undefined;
1270
1288
  logprobs?: Array<OpenAIResponsesLogprobs>;
1271
1289
  serviceTier?: string;
1290
+ reasoningContext?: string;
1272
1291
  };
1273
1292
  type ResponsesReasoningProviderMetadata = {
1274
1293
  itemId: string;