openai 7.10.0 → 7.12.1

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 (421) hide show
  1. package/CHANGELOG.md +196 -0
  2. package/README.md +7 -5
  3. package/_vendor/partial-json-parser/parser.d.mts.map +1 -1
  4. package/_vendor/partial-json-parser/parser.d.ts.map +1 -1
  5. package/_vendor/partial-json-parser/parser.js +4 -3
  6. package/_vendor/partial-json-parser/parser.js.map +1 -1
  7. package/_vendor/partial-json-parser/parser.mjs +4 -3
  8. package/_vendor/partial-json-parser/parser.mjs.map +1 -1
  9. package/_vendor/zod-to-json-schema/parsers/string.js +1 -1
  10. package/_vendor/zod-to-json-schema/parsers/string.js.map +1 -1
  11. package/_vendor/zod-to-json-schema/parsers/string.mjs +1 -1
  12. package/_vendor/zod-to-json-schema/parsers/string.mjs.map +1 -1
  13. package/_vendor/zod-to-json-schema/parsers/tuple.d.mts.map +1 -1
  14. package/_vendor/zod-to-json-schema/parsers/tuple.d.ts.map +1 -1
  15. package/_vendor/zod-to-json-schema/parsers/tuple.js +19 -12
  16. package/_vendor/zod-to-json-schema/parsers/tuple.js.map +1 -1
  17. package/_vendor/zod-to-json-schema/parsers/tuple.mjs +19 -12
  18. package/_vendor/zod-to-json-schema/parsers/tuple.mjs.map +1 -1
  19. package/_vendor/zod-to-json-schema/zodToJsonSchema.d.mts.map +1 -1
  20. package/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts.map +1 -1
  21. package/_vendor/zod-to-json-schema/zodToJsonSchema.js +6 -2
  22. package/_vendor/zod-to-json-schema/zodToJsonSchema.js.map +1 -1
  23. package/_vendor/zod-to-json-schema/zodToJsonSchema.mjs +6 -2
  24. package/_vendor/zod-to-json-schema/zodToJsonSchema.mjs.map +1 -1
  25. package/auth/subject-token-providers.d.mts.map +1 -1
  26. package/auth/subject-token-providers.d.ts.map +1 -1
  27. package/auth/subject-token-providers.js +10 -5
  28. package/auth/subject-token-providers.js.map +1 -1
  29. package/auth/subject-token-providers.mjs +10 -5
  30. package/auth/subject-token-providers.mjs.map +1 -1
  31. package/auth/workload-identity-auth.d.mts.map +1 -1
  32. package/auth/workload-identity-auth.d.ts.map +1 -1
  33. package/auth/workload-identity-auth.js +21 -11
  34. package/auth/workload-identity-auth.js.map +1 -1
  35. package/auth/workload-identity-auth.mjs +21 -11
  36. package/auth/workload-identity-auth.mjs.map +1 -1
  37. package/azure.d.mts.map +1 -1
  38. package/azure.d.ts.map +1 -1
  39. package/azure.js +31 -2
  40. package/azure.js.map +1 -1
  41. package/azure.mjs +32 -3
  42. package/azure.mjs.map +1 -1
  43. package/beta/realtime/internal-base.d.mts.map +1 -1
  44. package/beta/realtime/internal-base.d.ts.map +1 -1
  45. package/beta/realtime/internal-base.js +3 -2
  46. package/beta/realtime/internal-base.js.map +1 -1
  47. package/beta/realtime/internal-base.mjs +3 -2
  48. package/beta/realtime/internal-base.mjs.map +1 -1
  49. package/beta/realtime/websocket.d.mts +2 -0
  50. package/beta/realtime/websocket.d.mts.map +1 -1
  51. package/beta/realtime/websocket.d.ts +2 -0
  52. package/beta/realtime/websocket.d.ts.map +1 -1
  53. package/beta/realtime/websocket.js +12 -7
  54. package/beta/realtime/websocket.js.map +1 -1
  55. package/beta/realtime/websocket.mjs +12 -7
  56. package/beta/realtime/websocket.mjs.map +1 -1
  57. package/beta/realtime/ws.d.mts +2 -0
  58. package/beta/realtime/ws.d.mts.map +1 -1
  59. package/beta/realtime/ws.d.ts +2 -0
  60. package/beta/realtime/ws.d.ts.map +1 -1
  61. package/beta/realtime/ws.js +7 -5
  62. package/beta/realtime/ws.js.map +1 -1
  63. package/beta/realtime/ws.mjs +7 -5
  64. package/beta/realtime/ws.mjs.map +1 -1
  65. package/client.d.mts +9 -1
  66. package/client.d.mts.map +1 -1
  67. package/client.d.ts +9 -1
  68. package/client.d.ts.map +1 -1
  69. package/client.js +17 -4
  70. package/client.js.map +1 -1
  71. package/client.mjs +17 -4
  72. package/client.mjs.map +1 -1
  73. package/core/EventEmitter.d.mts +2 -1
  74. package/core/EventEmitter.d.mts.map +1 -1
  75. package/core/EventEmitter.d.ts +2 -1
  76. package/core/EventEmitter.d.ts.map +1 -1
  77. package/core/EventEmitter.js +2 -1
  78. package/core/EventEmitter.js.map +1 -1
  79. package/core/EventEmitter.mjs +2 -1
  80. package/core/EventEmitter.mjs.map +1 -1
  81. package/core/pagination.js +1 -1
  82. package/core/pagination.js.map +1 -1
  83. package/core/pagination.mjs +1 -1
  84. package/core/pagination.mjs.map +1 -1
  85. package/core/streaming.d.mts +8 -0
  86. package/core/streaming.d.mts.map +1 -1
  87. package/core/streaming.d.ts +8 -0
  88. package/core/streaming.d.ts.map +1 -1
  89. package/core/streaming.js +68 -15
  90. package/core/streaming.js.map +1 -1
  91. package/core/streaming.mjs +68 -15
  92. package/core/streaming.mjs.map +1 -1
  93. package/helpers/audio.d.mts +1 -1
  94. package/helpers/audio.d.mts.map +1 -1
  95. package/helpers/audio.d.ts +1 -1
  96. package/helpers/audio.d.ts.map +1 -1
  97. package/helpers/audio.js +25 -5
  98. package/helpers/audio.js.map +1 -1
  99. package/helpers/audio.mjs +25 -5
  100. package/helpers/audio.mjs.map +1 -1
  101. package/helpers/zod.d.mts +28 -15
  102. package/helpers/zod.d.mts.map +1 -1
  103. package/helpers/zod.d.ts +28 -15
  104. package/helpers/zod.d.ts.map +1 -1
  105. package/helpers/zod.js +30 -23
  106. package/helpers/zod.js.map +1 -1
  107. package/helpers/zod.mjs +30 -23
  108. package/helpers/zod.mjs.map +1 -1
  109. package/index.js +4 -5
  110. package/internal/bedrock.d.mts +11 -0
  111. package/internal/bedrock.d.mts.map +1 -1
  112. package/internal/bedrock.d.ts +11 -0
  113. package/internal/bedrock.d.ts.map +1 -1
  114. package/internal/bedrock.js +71 -55
  115. package/internal/bedrock.js.map +1 -1
  116. package/internal/bedrock.mjs +70 -55
  117. package/internal/bedrock.mjs.map +1 -1
  118. package/internal/detect-platform.js +2 -2
  119. package/internal/detect-platform.js.map +1 -1
  120. package/internal/detect-platform.mjs +2 -2
  121. package/internal/detect-platform.mjs.map +1 -1
  122. package/internal/errors.d.mts.map +1 -1
  123. package/internal/errors.d.ts.map +1 -1
  124. package/internal/errors.js +3 -2
  125. package/internal/errors.js.map +1 -1
  126. package/internal/errors.mjs +3 -2
  127. package/internal/errors.mjs.map +1 -1
  128. package/internal/headers.d.mts.map +1 -1
  129. package/internal/headers.d.ts.map +1 -1
  130. package/internal/headers.js +4 -5
  131. package/internal/headers.js.map +1 -1
  132. package/internal/headers.mjs +4 -5
  133. package/internal/headers.mjs.map +1 -1
  134. package/internal/parse.js +1 -1
  135. package/internal/parse.js.map +1 -1
  136. package/internal/parse.mjs +1 -1
  137. package/internal/parse.mjs.map +1 -1
  138. package/internal/realtime-credentials.d.mts +15 -0
  139. package/internal/realtime-credentials.d.mts.map +1 -0
  140. package/internal/realtime-credentials.d.ts +15 -0
  141. package/internal/realtime-credentials.d.ts.map +1 -0
  142. package/internal/realtime-credentials.js +23 -0
  143. package/internal/realtime-credentials.js.map +1 -0
  144. package/internal/realtime-credentials.mjs +19 -0
  145. package/internal/realtime-credentials.mjs.map +1 -0
  146. package/internal/responses/response-accumulator.d.mts.map +1 -1
  147. package/internal/responses/response-accumulator.d.ts.map +1 -1
  148. package/internal/responses/response-accumulator.js +2 -1
  149. package/internal/responses/response-accumulator.js.map +1 -1
  150. package/internal/responses/response-accumulator.mjs +2 -1
  151. package/internal/responses/response-accumulator.mjs.map +1 -1
  152. package/internal/to-file.d.mts +2 -1
  153. package/internal/to-file.d.mts.map +1 -1
  154. package/internal/to-file.d.ts +2 -1
  155. package/internal/to-file.d.ts.map +1 -1
  156. package/internal/to-file.js +5 -4
  157. package/internal/to-file.js.map +1 -1
  158. package/internal/to-file.mjs +6 -5
  159. package/internal/to-file.mjs.map +1 -1
  160. package/internal/types.d.mts +3 -3
  161. package/internal/types.d.mts.map +1 -1
  162. package/internal/types.d.ts +3 -3
  163. package/internal/types.d.ts.map +1 -1
  164. package/internal/uploads.d.mts +2 -0
  165. package/internal/uploads.d.mts.map +1 -1
  166. package/internal/uploads.d.ts +2 -0
  167. package/internal/uploads.d.ts.map +1 -1
  168. package/internal/uploads.js +12 -1
  169. package/internal/uploads.js.map +1 -1
  170. package/internal/uploads.mjs +11 -1
  171. package/internal/uploads.mjs.map +1 -1
  172. package/internal/utils/base64.d.mts.map +1 -1
  173. package/internal/utils/base64.d.ts.map +1 -1
  174. package/internal/utils/base64.js +3 -0
  175. package/internal/utils/base64.js.map +1 -1
  176. package/internal/utils/base64.mjs +3 -0
  177. package/internal/utils/base64.mjs.map +1 -1
  178. package/lib/AbstractChatCompletionRunner.d.mts +1 -1
  179. package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
  180. package/lib/AbstractChatCompletionRunner.d.ts +1 -1
  181. package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
  182. package/lib/AbstractChatCompletionRunner.js +31 -9
  183. package/lib/AbstractChatCompletionRunner.js.map +1 -1
  184. package/lib/AbstractChatCompletionRunner.mjs +31 -9
  185. package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
  186. package/lib/AssistantStream.d.mts +4 -1
  187. package/lib/AssistantStream.d.mts.map +1 -1
  188. package/lib/AssistantStream.d.ts +4 -1
  189. package/lib/AssistantStream.d.ts.map +1 -1
  190. package/lib/AssistantStream.js +23 -8
  191. package/lib/AssistantStream.js.map +1 -1
  192. package/lib/AssistantStream.mjs +24 -9
  193. package/lib/AssistantStream.mjs.map +1 -1
  194. package/lib/ChatCompletionRunner.d.mts +6 -3
  195. package/lib/ChatCompletionRunner.d.mts.map +1 -1
  196. package/lib/ChatCompletionRunner.d.ts +6 -3
  197. package/lib/ChatCompletionRunner.d.ts.map +1 -1
  198. package/lib/ChatCompletionRunner.js +7 -4
  199. package/lib/ChatCompletionRunner.js.map +1 -1
  200. package/lib/ChatCompletionRunner.mjs +7 -4
  201. package/lib/ChatCompletionRunner.mjs.map +1 -1
  202. package/lib/ChatCompletionStream.d.mts.map +1 -1
  203. package/lib/ChatCompletionStream.d.ts.map +1 -1
  204. package/lib/ChatCompletionStream.js +6 -0
  205. package/lib/ChatCompletionStream.js.map +1 -1
  206. package/lib/ChatCompletionStream.mjs +7 -1
  207. package/lib/ChatCompletionStream.mjs.map +1 -1
  208. package/lib/ChatCompletionStreamingRunner.d.mts.map +1 -1
  209. package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
  210. package/lib/ChatCompletionStreamingRunner.js +1 -0
  211. package/lib/ChatCompletionStreamingRunner.js.map +1 -1
  212. package/lib/ChatCompletionStreamingRunner.mjs +1 -0
  213. package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
  214. package/lib/EventEmitter.d.mts +3 -1
  215. package/lib/EventEmitter.d.mts.map +1 -1
  216. package/lib/EventEmitter.d.ts +3 -1
  217. package/lib/EventEmitter.d.ts.map +1 -1
  218. package/lib/EventEmitter.js +2 -1
  219. package/lib/EventEmitter.js.map +1 -1
  220. package/lib/EventEmitter.mjs +2 -1
  221. package/lib/EventEmitter.mjs.map +1 -1
  222. package/lib/EventStream.d.mts +2 -1
  223. package/lib/EventStream.d.mts.map +1 -1
  224. package/lib/EventStream.d.ts +2 -1
  225. package/lib/EventStream.d.ts.map +1 -1
  226. package/lib/EventStream.js +99 -46
  227. package/lib/EventStream.js.map +1 -1
  228. package/lib/EventStream.mjs +99 -46
  229. package/lib/EventStream.mjs.map +1 -1
  230. package/lib/ResponsesParser.d.mts +5 -4
  231. package/lib/ResponsesParser.d.mts.map +1 -1
  232. package/lib/ResponsesParser.d.ts +5 -4
  233. package/lib/ResponsesParser.d.ts.map +1 -1
  234. package/lib/ResponsesParser.js +21 -7
  235. package/lib/ResponsesParser.js.map +1 -1
  236. package/lib/ResponsesParser.mjs +21 -7
  237. package/lib/ResponsesParser.mjs.map +1 -1
  238. package/lib/RunnableFunction.d.mts +2 -2
  239. package/lib/RunnableFunction.d.mts.map +1 -1
  240. package/lib/RunnableFunction.d.ts +2 -2
  241. package/lib/RunnableFunction.d.ts.map +1 -1
  242. package/lib/embeddings.d.mts.map +1 -1
  243. package/lib/embeddings.d.ts.map +1 -1
  244. package/lib/embeddings.js +18 -12
  245. package/lib/embeddings.js.map +1 -1
  246. package/lib/embeddings.mjs +18 -12
  247. package/lib/embeddings.mjs.map +1 -1
  248. package/lib/file-processing.d.mts +3 -2
  249. package/lib/file-processing.d.mts.map +1 -1
  250. package/lib/file-processing.d.ts +3 -2
  251. package/lib/file-processing.d.ts.map +1 -1
  252. package/lib/file-processing.js +5 -4
  253. package/lib/file-processing.js.map +1 -1
  254. package/lib/file-processing.mjs +5 -4
  255. package/lib/file-processing.mjs.map +1 -1
  256. package/lib/parser.d.mts +16 -4
  257. package/lib/parser.d.mts.map +1 -1
  258. package/lib/parser.d.ts +16 -4
  259. package/lib/parser.d.ts.map +1 -1
  260. package/lib/parser.js +1 -1
  261. package/lib/parser.js.map +1 -1
  262. package/lib/parser.mjs +1 -1
  263. package/lib/parser.mjs.map +1 -1
  264. package/lib/polling.d.mts +2 -2
  265. package/lib/polling.d.mts.map +1 -1
  266. package/lib/polling.d.ts +2 -2
  267. package/lib/polling.d.ts.map +1 -1
  268. package/lib/polling.js +5 -4
  269. package/lib/polling.js.map +1 -1
  270. package/lib/polling.mjs +5 -4
  271. package/lib/polling.mjs.map +1 -1
  272. package/lib/responses/EventTypes.d.mts +2 -2
  273. package/lib/responses/EventTypes.d.mts.map +1 -1
  274. package/lib/responses/EventTypes.d.ts +2 -2
  275. package/lib/responses/EventTypes.d.ts.map +1 -1
  276. package/lib/responses/ResponseInputItems.d.mts +3 -2
  277. package/lib/responses/ResponseInputItems.d.mts.map +1 -1
  278. package/lib/responses/ResponseInputItems.d.ts +3 -2
  279. package/lib/responses/ResponseInputItems.d.ts.map +1 -1
  280. package/lib/responses/ResponseInputItems.js +27 -4
  281. package/lib/responses/ResponseInputItems.js.map +1 -1
  282. package/lib/responses/ResponseInputItems.mjs +27 -4
  283. package/lib/responses/ResponseInputItems.mjs.map +1 -1
  284. package/lib/transform.d.mts.map +1 -1
  285. package/lib/transform.d.ts.map +1 -1
  286. package/lib/transform.js +1 -0
  287. package/lib/transform.js.map +1 -1
  288. package/lib/transform.mjs +1 -0
  289. package/lib/transform.mjs.map +1 -1
  290. package/lib/vector-store-polling.d.mts +2 -2
  291. package/lib/vector-store-polling.d.ts +2 -2
  292. package/lib/vector-store-polling.js +3 -3
  293. package/lib/vector-store-polling.js.map +1 -1
  294. package/lib/vector-store-polling.mjs +3 -3
  295. package/lib/vector-store-polling.mjs.map +1 -1
  296. package/lib/vector-store-upload.d.mts +2 -1
  297. package/lib/vector-store-upload.d.mts.map +1 -1
  298. package/lib/vector-store-upload.d.ts +2 -1
  299. package/lib/vector-store-upload.d.ts.map +1 -1
  300. package/lib/vector-store-upload.js +5 -1
  301. package/lib/vector-store-upload.js.map +1 -1
  302. package/lib/vector-store-upload.mjs +5 -1
  303. package/lib/vector-store-upload.mjs.map +1 -1
  304. package/package.json +1 -1
  305. package/providers/bedrock/aws.d.mts.map +1 -1
  306. package/providers/bedrock/aws.d.ts.map +1 -1
  307. package/providers/bedrock/aws.js +14 -16
  308. package/providers/bedrock/aws.js.map +1 -1
  309. package/providers/bedrock/aws.mjs +15 -17
  310. package/providers/bedrock/aws.mjs.map +1 -1
  311. package/realtime/internal-base.d.mts.map +1 -1
  312. package/realtime/internal-base.d.ts.map +1 -1
  313. package/realtime/internal-base.js +3 -5
  314. package/realtime/internal-base.js.map +1 -1
  315. package/realtime/internal-base.mjs +3 -5
  316. package/realtime/internal-base.mjs.map +1 -1
  317. package/realtime/websocket.d.mts +2 -0
  318. package/realtime/websocket.d.mts.map +1 -1
  319. package/realtime/websocket.d.ts +2 -0
  320. package/realtime/websocket.d.ts.map +1 -1
  321. package/realtime/websocket.js +12 -6
  322. package/realtime/websocket.js.map +1 -1
  323. package/realtime/websocket.mjs +12 -6
  324. package/realtime/websocket.mjs.map +1 -1
  325. package/realtime/ws.d.mts +2 -0
  326. package/realtime/ws.d.mts.map +1 -1
  327. package/realtime/ws.d.ts +2 -0
  328. package/realtime/ws.d.ts.map +1 -1
  329. package/realtime/ws.js +7 -4
  330. package/realtime/ws.js.map +1 -1
  331. package/realtime/ws.mjs +7 -4
  332. package/realtime/ws.mjs.map +1 -1
  333. package/resources/admin/organization/projects/service-accounts/api-keys.d.mts +9 -0
  334. package/resources/admin/organization/projects/service-accounts/api-keys.d.mts.map +1 -1
  335. package/resources/admin/organization/projects/service-accounts/api-keys.d.ts +9 -0
  336. package/resources/admin/organization/projects/service-accounts/api-keys.d.ts.map +1 -1
  337. package/resources/beta/responses/responses.d.mts +112 -33
  338. package/resources/beta/responses/responses.d.mts.map +1 -1
  339. package/resources/beta/responses/responses.d.ts +112 -33
  340. package/resources/beta/responses/responses.d.ts.map +1 -1
  341. package/resources/beta/responses/responses.js.map +1 -1
  342. package/resources/beta/responses/responses.mjs.map +1 -1
  343. package/resources/conversations/items.d.mts +9 -0
  344. package/resources/conversations/items.d.mts.map +1 -1
  345. package/resources/conversations/items.d.ts +9 -0
  346. package/resources/conversations/items.d.ts.map +1 -1
  347. package/resources/images.d.mts +73 -58
  348. package/resources/images.d.mts.map +1 -1
  349. package/resources/images.d.ts +73 -58
  350. package/resources/images.d.ts.map +1 -1
  351. package/resources/images.js.map +1 -1
  352. package/resources/images.mjs.map +1 -1
  353. package/resources/responses/responses.d.mts +112 -32
  354. package/resources/responses/responses.d.mts.map +1 -1
  355. package/resources/responses/responses.d.ts +112 -32
  356. package/resources/responses/responses.d.ts.map +1 -1
  357. package/resources/responses/responses.js.map +1 -1
  358. package/resources/responses/responses.mjs.map +1 -1
  359. package/resources/webhooks/webhooks.d.mts +6 -4
  360. package/resources/webhooks/webhooks.d.mts.map +1 -1
  361. package/resources/webhooks/webhooks.d.ts +6 -4
  362. package/resources/webhooks/webhooks.d.ts.map +1 -1
  363. package/src/_vendor/partial-json-parser/parser.ts +4 -3
  364. package/src/_vendor/zod-to-json-schema/parsers/string.ts +1 -1
  365. package/src/_vendor/zod-to-json-schema/parsers/tuple.ts +23 -16
  366. package/src/_vendor/zod-to-json-schema/zodToJsonSchema.ts +11 -6
  367. package/src/auth/subject-token-providers.ts +12 -7
  368. package/src/auth/workload-identity-auth.ts +27 -12
  369. package/src/azure.ts +34 -3
  370. package/src/beta/realtime/internal-base.ts +3 -2
  371. package/src/beta/realtime/websocket.ts +17 -7
  372. package/src/beta/realtime/ws.ts +9 -5
  373. package/src/client.ts +19 -4
  374. package/src/core/EventEmitter.ts +5 -8
  375. package/src/core/pagination.ts +1 -1
  376. package/src/core/streaming.ts +69 -13
  377. package/src/helpers/audio.ts +27 -6
  378. package/src/helpers/zod.ts +78 -29
  379. package/src/internal/bedrock.ts +84 -58
  380. package/src/internal/detect-platform.ts +2 -2
  381. package/src/internal/errors.ts +3 -2
  382. package/src/internal/headers.ts +7 -5
  383. package/src/internal/parse.ts +1 -1
  384. package/src/internal/realtime-credentials.ts +27 -0
  385. package/src/internal/responses/response-accumulator.ts +1 -0
  386. package/src/internal/to-file.ts +6 -5
  387. package/src/internal/uploads.ts +12 -1
  388. package/src/internal/utils/base64.ts +3 -0
  389. package/src/lib/AbstractChatCompletionRunner.ts +31 -6
  390. package/src/lib/AssistantStream.ts +25 -11
  391. package/src/lib/ChatCompletionRunner.ts +8 -4
  392. package/src/lib/ChatCompletionStream.ts +8 -0
  393. package/src/lib/ChatCompletionStreamingRunner.ts +1 -0
  394. package/src/lib/EventEmitter.ts +17 -8
  395. package/src/lib/EventStream.ts +105 -52
  396. package/src/lib/ResponsesParser.ts +33 -12
  397. package/src/lib/RunnableFunction.ts +2 -2
  398. package/src/lib/embeddings.ts +18 -12
  399. package/src/lib/file-processing.ts +5 -4
  400. package/src/lib/parser.ts +35 -11
  401. package/src/lib/polling.ts +5 -4
  402. package/src/lib/responses/EventTypes.ts +3 -69
  403. package/src/lib/responses/ResponseInputItems.ts +29 -4
  404. package/src/lib/transform.ts +1 -0
  405. package/src/lib/vector-store-polling.ts +3 -3
  406. package/src/lib/vector-store-upload.ts +5 -1
  407. package/src/providers/bedrock/aws.ts +23 -24
  408. package/src/realtime/internal-base.ts +3 -5
  409. package/src/realtime/websocket.ts +14 -6
  410. package/src/realtime/ws.ts +9 -4
  411. package/src/resources/admin/organization/projects/service-accounts/api-keys.ts +11 -0
  412. package/src/resources/beta/responses/responses.ts +143 -31
  413. package/src/resources/conversations/items.ts +11 -0
  414. package/src/resources/images.ts +76 -57
  415. package/src/resources/responses/responses.ts +143 -30
  416. package/src/resources/webhooks/webhooks.ts +6 -4
  417. package/src/version.ts +1 -1
  418. package/version.d.mts +1 -1
  419. package/version.d.ts +1 -1
  420. package/version.js +1 -1
  421. package/version.mjs +1 -1
@@ -70,6 +70,7 @@ const JSON_SCHEMA_UNSUPPORTED_SCHEMA_KEYWORDS = new Set([
70
70
  'minContains',
71
71
  'minProperties',
72
72
  'not',
73
+ 'oneOf',
73
74
  'patternProperties',
74
75
  'prefixItems',
75
76
  'propertyNames',
@@ -6,8 +6,8 @@ import { pollWithResponse } from './polling';
6
6
  type PollOptions = RequestOptions & { pollIntervalMs?: number };
7
7
 
8
8
  /**
9
- * Polls an attached file through the resource's retrieve method. Failed files are
10
- * returned to the caller, and cancelled files retain their existing retry behavior.
9
+ * Polls an attached file through the resource's retrieve method until it completes,
10
+ * fails, or is cancelled. Retrieval errors are propagated unchanged.
11
11
  *
12
12
  * @internal
13
13
  */
@@ -20,7 +20,7 @@ export function pollVectorStoreFile(
20
20
  return pollWithResponse(
21
21
  (headers) => resource.retrieve(fileID, { vector_store_id: vectorStoreID }, { ...options, headers }),
22
22
  ['in_progress'],
23
- ['failed', 'completed'],
23
+ ['failed', 'cancelled', 'completed'],
24
24
  options,
25
25
  );
26
26
  }
@@ -8,7 +8,8 @@ type UploadOptions = RequestOptions & { pollIntervalMs?: number; maxConcurrency?
8
8
 
9
9
  /**
10
10
  * Uploads files with a shared iterator, then creates and polls the batch. Every
11
- * worker settles before upload failures are propagated.
11
+ * worker settles before upload failures are propagated. Zero concurrency is
12
+ * rejected before any upload or batch-creation request.
12
13
  *
13
14
  * @internal
14
15
  */
@@ -28,6 +29,9 @@ export async function uploadAndPollVectorStoreFileBatch(
28
29
 
29
30
  const configuredConcurrency = options?.maxConcurrency ?? 5;
30
31
  const concurrencyLimit = Math.min(configuredConcurrency, files.length);
32
+ if (concurrencyLimit === 0) {
33
+ throw new RangeError('maxConcurrency must be greater than 0');
34
+ }
31
35
  const fileIterator = files.values();
32
36
  const allFileIds = [...fileIds];
33
37
 
@@ -7,9 +7,9 @@ import type { BodyInit } from '../../internal/builtin-types';
7
7
  import {
8
8
  assertBedrockRequestOrigin,
9
9
  assertProviderOwnsAuthorization,
10
- errorWithCause,
11
10
  normalizeOptionalString,
12
11
  parseBedrockEndpointHostname,
12
+ prepareBedrockAuth,
13
13
  resolveBedrockBearerAuth,
14
14
  resolveBedrockEndpoint,
15
15
  } from '../../internal/bedrock';
@@ -115,7 +115,7 @@ function requestTarget(parsedURL: URL): { path: string; query: Record<string, st
115
115
  } else if (typeof existing === 'string') {
116
116
  query[name] = [existing, value];
117
117
  } else {
118
- query[name] = [...existing, value];
118
+ existing.push(value);
119
119
  }
120
120
  }
121
121
  return { path: parsedURL.pathname, query };
@@ -194,14 +194,14 @@ class BedrockSigV4Auth implements BedrockRequestAuth {
194
194
  }));
195
195
  }
196
196
 
197
- async prepareRequest(request: FinalizedRequestInit, { url }: ProviderRequestContext): Promise<void> {
197
+ async prepareRequest(request: FinalizedRequestInit, context: ProviderRequestContext): Promise<void> {
198
198
  if (Object.prototype.toString.call((globalThis as any).process) !== '[object process]') {
199
199
  throw new Errors.OpenAIError(
200
200
  'Bedrock AWS credential authentication is only supported in Node.js and compatible server runtimes. Use bearer authentication in this runtime.',
201
201
  );
202
202
  }
203
203
 
204
- const parsedURL = new URL(url);
204
+ const parsedURL = new URL(context.url);
205
205
  const canonicalEndpoint = parseBedrockEndpointHostname(parsedURL.hostname);
206
206
  if (canonicalEndpoint && canonicalEndpoint.endpoint !== this.options.endpoint) {
207
207
  throw new Errors.OpenAIError(
@@ -225,27 +225,26 @@ class BedrockSigV4Auth implements BedrockRequestAuth {
225
225
  const body = signableBody(request.body);
226
226
  const target = requestTarget(parsedURL);
227
227
 
228
- let signed: { headers: Record<string, string> };
229
- try {
230
- signed = await this.signatureV4().sign({
231
- protocol: parsedURL.protocol,
232
- hostname: parsedURL.hostname,
233
- ...(parsedURL.port ? { port: Number(parsedURL.port) } : {}),
234
- method,
235
- ...target,
236
- headers: Object.fromEntries(headers.entries()),
237
- ...(body === undefined ? {} : { body }),
238
- });
239
- } catch (cause) {
240
- const message = this.options.usesDefaultChain
228
+ await prepareBedrockAuth(request, context, {
229
+ resolve: () =>
230
+ this.signatureV4().sign({
231
+ protocol: parsedURL.protocol,
232
+ hostname: parsedURL.hostname,
233
+ ...(parsedURL.port ? { port: Number(parsedURL.port) } : {}),
234
+ method,
235
+ ...target,
236
+ headers: Object.fromEntries(headers.entries()),
237
+ ...(body === undefined ? {} : { body }),
238
+ }),
239
+ failureMessage: this.options.usesDefaultChain
241
240
  ? 'Could not find credentials for Bedrock. Pass AWS credentials to `bedrock(...)` or configure the default AWS credential chain.'
242
- : 'Failed to resolve AWS credentials for Bedrock. Verify your AWS profile, environment variables, or runtime identity configuration and try again.';
243
- throw errorWithCause(message, cause);
244
- }
245
-
246
- request.method = method;
247
- request.redirect = 'manual';
248
- request.headers = new Headers(signed.headers);
241
+ : 'Failed to resolve AWS credentials for Bedrock. Verify your AWS profile, environment variables, or runtime identity configuration and try again.',
242
+ apply: (signed) => {
243
+ request.method = method;
244
+ request.redirect = 'manual';
245
+ request.headers = new Headers(signed.headers);
246
+ },
247
+ });
249
248
  }
250
249
  }
251
250
 
@@ -281,19 +281,17 @@ export function buildRealtimeURL(
281
281
  return url;
282
282
  }
283
283
 
284
- let url: URL;
284
+ const url = new URL(baseURL);
285
285
  if (azure) {
286
- url = new URL(baseURL);
287
286
  const basePath = url.pathname.replace(/\/+/g, '/').replace(/\/+$/, '');
288
287
  const versionedPath = basePath.endsWith('/v1') ? basePath : `${basePath}/v1`;
289
288
  url.pathname = `${versionedPath}/realtime`;
290
289
  url.search = '';
291
- url.hash = '';
292
290
  } else {
293
- const path = '/realtime';
294
- url = new URL(baseURL + (baseURL.endsWith('/') ? path.slice(1) : path));
291
+ url.pathname += url.pathname.endsWith('/') ? 'realtime' : '/realtime';
295
292
  }
296
293
 
294
+ url.hash = '';
297
295
  url.protocol = 'wss';
298
296
  // Sideband control connections attach to an existing call via `call_id`.
299
297
  if (hasCallID) {
@@ -1,3 +1,4 @@
1
+ import { getRealtimeAPIKey, resolveRealtimeAPIKey } from '../internal/realtime-credentials';
1
2
  import type { AzureOpenAI } from '../index';
2
3
  import { assertBedrockWebSocketOrigin } from '../internal/bedrock';
3
4
  import { OpenAI } from '../index';
@@ -175,15 +176,18 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
175
176
  onURL?: (url: URL) => void;
176
177
  /** Indicates the token was resolved by the factory just before connecting. @internal */
177
178
  __resolvedApiKey?: boolean;
179
+ /** Credential captured by an async factory for this connection. @internal */
180
+ __apiKey?: string | null;
178
181
  },
179
182
  client?: Pick<OpenAI, 'apiKey' | 'baseURL'>,
180
183
  ) {
181
184
  super();
185
+ let apiKey = getRealtimeAPIKey(client, props.__apiKey);
182
186
  const hasProvider = typeof (client as any)?._options?.apiKey === 'function';
183
187
  const dangerouslyAllowBrowser =
184
188
  props.dangerouslyAllowBrowser ??
185
189
  (client as any)?._options?.dangerouslyAllowBrowser ??
186
- (client?.apiKey?.startsWith('ek_') ? true : null);
190
+ (apiKey?.startsWith('ek_') ? true : null);
187
191
  if (!dangerouslyAllowBrowser && isRunningInBrowserOrBrowserWorker()) {
188
192
  throw new OpenAIError(
189
193
  "It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\n\nYou can avoid this error by creating an ephemeral session token:\nhttps://platform.openai.com/docs/api-reference/realtime-sessions\n",
@@ -191,6 +195,9 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
191
195
  }
192
196
 
193
197
  client ??= new OpenAI({ dangerouslyAllowBrowser });
198
+ if (apiKey === undefined) {
199
+ apiKey = client.apiKey;
200
+ }
194
201
 
195
202
  if (hasProvider && !props?.__resolvedApiKey) {
196
203
  throw new Error(
@@ -209,10 +216,10 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
209
216
  assertBedrockWebSocketOrigin(client, this.url);
210
217
 
211
218
  const azure = isAzure(client);
212
- const protocols = ['realtime', ...(azure ? [] : [`openai-insecure-api-key.${client.apiKey}`])];
219
+ const protocols = ['realtime', ...(azure ? [] : [`openai-insecure-api-key.${apiKey}`])];
213
220
 
214
221
  this.socket = azure
215
- ? createAzureWebSocket(this.url, client.apiKey, props.__resolvedApiKey === true, protocols)
222
+ ? createAzureWebSocket(this.url, apiKey, props.__resolvedApiKey === true, protocols)
216
223
  : new WebSocket(this.url.toString(), protocols);
217
224
 
218
225
  this.socket.addEventListener('message', (websocketEvent: MessageEvent) => {
@@ -269,7 +276,7 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
269
276
  dangerouslyAllowBrowser?: boolean;
270
277
  },
271
278
  ): Promise<OpenAIRealtimeWebSocket> {
272
- const resolvedApiKey = await client._callApiKey();
279
+ const { apiKey, isProvider: resolvedApiKey } = await resolveRealtimeAPIKey(client);
273
280
  const url = buildRealtimeURL(client, props);
274
281
  assertBedrockWebSocketOrigin(client, url);
275
282
  return new OpenAIRealtimeWebSocket(
@@ -277,6 +284,7 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
277
284
  ...props,
278
285
  buildRealtimeURL: () => url,
279
286
  __resolvedApiKey: resolvedApiKey,
287
+ __apiKey: apiKey,
280
288
  },
281
289
  client,
282
290
  );
@@ -301,8 +309,7 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
301
309
  } = {},
302
310
  ): Promise<OpenAIRealtimeWebSocket> {
303
311
  const connection = getAzureRealtimeConnection(client, options);
304
- const isApiKeyProvider = await client._callApiKey();
305
- const apiKey = client.apiKey;
312
+ const { apiKey, isProvider: isApiKeyProvider } = await resolveRealtimeAPIKey(client);
306
313
  if (!apiKey) {
307
314
  throw new Error('Azure OpenAI Realtime requires an API key');
308
315
  }
@@ -312,6 +319,7 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
312
319
  ...connection,
313
320
  ...(dangerouslyAllowBrowser === undefined ? {} : { dangerouslyAllowBrowser }),
314
321
  __resolvedApiKey: isApiKeyProvider,
322
+ __apiKey: apiKey,
315
323
  },
316
324
  client,
317
325
  );
@@ -1,3 +1,4 @@
1
+ import { resolveRealtimeAPIKey } from '../internal/realtime-credentials';
1
2
  import * as WS from 'ws';
2
3
  import { assertBedrockWebSocketOrigin } from '../internal/bedrock';
3
4
  import { protectWebSocketOptionsFromCredentialRedirects } from '../internal/ws';
@@ -46,11 +47,14 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
46
47
 
47
48
  /** Indicates that a function-based credential was resolved by an async factory. @internal */
48
49
  __resolvedApiKey?: boolean;
50
+ /** Credential captured by an async factory for this connection. @internal */
51
+ __apiKey?: string | null;
49
52
  },
50
53
  client?: Pick<OpenAI, 'apiKey' | 'baseURL'>,
51
54
  ) {
52
55
  super();
53
56
  client ??= new OpenAI();
57
+ const apiKey = props.__apiKey === undefined ? client.apiKey : props.__apiKey;
54
58
  const hasProvider = typeof (client as any)?._options?.apiKey === 'function';
55
59
  if (hasProvider && !props.__resolvedApiKey) {
56
60
  throw new Error(
@@ -65,7 +69,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
65
69
  const headers = {
66
70
  'User-Agent': `${client.constructor.name}/JS ${VERSION}`,
67
71
  ...props.options?.headers,
68
- ...(isAzure(client) && !props.__resolvedApiKey ? {} : { Authorization: `Bearer ${client.apiKey}` }),
72
+ ...(isAzure(client) && !props.__resolvedApiKey ? {} : { Authorization: `Bearer ${apiKey}` }),
69
73
  };
70
74
 
71
75
  this.socket = new WS.WebSocket(
@@ -130,7 +134,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
130
134
  options?: WS.ClientOptions | undefined;
131
135
  },
132
136
  ): Promise<OpenAIRealtimeWS> {
133
- const resolvedApiKey = await client._callApiKey();
137
+ const { apiKey, isProvider: resolvedApiKey } = await resolveRealtimeAPIKey(client);
134
138
  const url = buildRealtimeURL(client, props);
135
139
  assertBedrockWebSocketOrigin(client, url);
136
140
  return new OpenAIRealtimeWS(
@@ -138,6 +142,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
138
142
  ...props,
139
143
  buildRealtimeURL: () => url,
140
144
  __resolvedApiKey: resolvedApiKey,
145
+ __apiKey: apiKey,
141
146
  },
142
147
  client,
143
148
  );
@@ -162,8 +167,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
162
167
  } = {},
163
168
  ): Promise<OpenAIRealtimeWS> {
164
169
  const connection = getAzureRealtimeConnection(client, props);
165
- const isApiKeyProvider = await client._callApiKey();
166
- const apiKey = client.apiKey;
170
+ const { apiKey, isProvider: isApiKeyProvider } = await resolveRealtimeAPIKey(client);
167
171
  if (!apiKey) {
168
172
  throw new Error('Azure OpenAI Realtime requires an API key');
169
173
  }
@@ -178,6 +182,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
178
182
  },
179
183
  },
180
184
  __resolvedApiKey: isApiKeyProvider,
185
+ __apiKey: apiKey,
181
186
  },
182
187
  client,
183
188
  );
@@ -56,6 +56,12 @@ export interface APIKeyCreateResponse {
56
56
  * The unredacted API key value.
57
57
  */
58
58
  value: string;
59
+
60
+ /**
61
+ * The Unix timestamp (in seconds) when the API key expires, or null if it does not
62
+ * expire.
63
+ */
64
+ expires_at?: number | null;
59
65
  }
60
66
 
61
67
  export interface APIKeyCreateParams {
@@ -64,6 +70,11 @@ export interface APIKeyCreateParams {
64
70
  */
65
71
  project_id: string;
66
72
 
73
+ /**
74
+ * Body param: Number of seconds until the API key expires.
75
+ */
76
+ expires_in_seconds?: number | null;
77
+
67
78
  /**
68
79
  * Body param: API key name.
69
80
  */
@@ -1378,6 +1378,15 @@ export interface BetaResponse {
1378
1378
  */
1379
1379
  prompt?: BetaResponsePrompt | null;
1380
1380
 
1381
+ /**
1382
+ * Prompt cache diagnostics requested for this response.
1383
+ */
1384
+ prompt_cache_diagnostics?:
1385
+ | BetaResponse.CacheMiss
1386
+ | BetaResponse.CacheHit
1387
+ | BetaResponse.ComparisonResponseNotFound
1388
+ | BetaResponse.Unavailable;
1389
+
1381
1390
  /**
1382
1391
  * Used by OpenAI to cache responses for similar requests to optimize your cache
1383
1392
  * hit rates. Replaces the `user` field.
@@ -1669,6 +1678,47 @@ export namespace BetaResponse {
1669
1678
  }
1670
1679
  }
1671
1680
 
1681
+ export interface CacheMiss {
1682
+ /**
1683
+ * The estimated number of input tokens affected after the first detected
1684
+ * divergence.
1685
+ */
1686
+ cache_missed_tokens: number;
1687
+
1688
+ /**
1689
+ * The reason prompt cache reuse did not occur.
1690
+ */
1691
+ reason:
1692
+ | 'model_changed'
1693
+ | 'prompt_cache_key_changed'
1694
+ | 'tools_changed'
1695
+ | 'text_format_changed'
1696
+ | 'reasoning_effort_changed'
1697
+ | 'verbosity_changed'
1698
+ | 'context_compacted'
1699
+ | 'input_changed'
1700
+ | 'service_tier_changed';
1701
+
1702
+ type: 'cache_miss';
1703
+
1704
+ /**
1705
+ * The raw token count of the reusable prefix in the compared response.
1706
+ */
1707
+ comparison_reusable_tokens?: number;
1708
+ }
1709
+
1710
+ export interface CacheHit {
1711
+ type: 'cache_hit';
1712
+ }
1713
+
1714
+ export interface ComparisonResponseNotFound {
1715
+ type: 'comparison_response_not_found';
1716
+ }
1717
+
1718
+ export interface Unavailable {
1719
+ type: 'unavailable';
1720
+ }
1721
+
1672
1722
  /**
1673
1723
  * The prompt-caching options that were applied to the response. Supported for
1674
1724
  * `gpt-5.6` and later models.
@@ -1683,6 +1733,11 @@ export namespace BetaResponse {
1683
1733
  * The minimum lifetime applied to each cache breakpoint.
1684
1734
  */
1685
1735
  ttl: '30m';
1736
+
1737
+ /**
1738
+ * The response ID supplied as the prompt cache diagnostics comparison.
1739
+ */
1740
+ comparison_response_id?: string | null;
1686
1741
  }
1687
1742
 
1688
1743
  /**
@@ -3788,11 +3843,6 @@ export interface BetaResponseFunctionCallArgumentsDoneEvent {
3788
3843
  */
3789
3844
  item_id: string;
3790
3845
 
3791
- /**
3792
- * The name of the function that was called.
3793
- */
3794
- name: string;
3795
-
3796
3846
  /**
3797
3847
  * The index of the output item.
3798
3848
  */
@@ -4330,7 +4380,7 @@ export interface BetaResponseFunctionWebSearch {
4330
4380
  /**
4331
4381
  * The status of the web search tool call.
4332
4382
  */
4333
- status: 'in_progress' | 'searching' | 'completed' | 'failed';
4383
+ status: 'in_progress' | 'searching' | 'completed' | 'failed' | 'incomplete';
4334
4384
 
4335
4385
  /**
4336
4386
  * The type of the web search tool call. Always `web_search_call`.
@@ -5734,6 +5784,17 @@ export namespace BetaResponseInputItem {
5734
5784
  * The agent that produced this item.
5735
5785
  */
5736
5786
  agent?: ImageGenerationCall.Agent | null;
5787
+
5788
+ /**
5789
+ * The quality of the image generated by the image generation tool call. One of
5790
+ * `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
5791
+ */
5792
+ quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
5793
+
5794
+ /**
5795
+ * The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
5796
+ */
5797
+ size?: (string & {}) | '1024x1024' | '1024x1536' | '1536x1024' | null;
5737
5798
  }
5738
5799
 
5739
5800
  export namespace ImageGenerationCall {
@@ -7212,6 +7273,17 @@ export namespace BetaResponseItem {
7212
7273
  * The agent that produced this item.
7213
7274
  */
7214
7275
  agent?: ImageGenerationCall.Agent | null;
7276
+
7277
+ /**
7278
+ * The quality of the image generated by the image generation tool call. One of
7279
+ * `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
7280
+ */
7281
+ quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
7282
+
7283
+ /**
7284
+ * The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
7285
+ */
7286
+ size?: (string & {}) | '1024x1024' | '1024x1536' | '1536x1024' | null;
7215
7287
  }
7216
7288
 
7217
7289
  export namespace ImageGenerationCall {
@@ -8416,6 +8488,17 @@ export namespace BetaResponseOutputItem {
8416
8488
  * The agent that produced this item.
8417
8489
  */
8418
8490
  agent?: ImageGenerationCall.Agent | null;
8491
+
8492
+ /**
8493
+ * The quality of the image generated by the image generation tool call. One of
8494
+ * `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
8495
+ */
8496
+ quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
8497
+
8498
+ /**
8499
+ * The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
8500
+ */
8501
+ size?: (string & {}) | '1024x1024' | '1024x1536' | '1536x1024' | null;
8419
8502
  }
8420
8503
 
8421
8504
  export namespace ImageGenerationCall {
@@ -11751,6 +11834,9 @@ export namespace BetaResponsesClientEvent {
11751
11834
 
11752
11835
  /**
11753
11836
  * Whether to store the generated model response for later retrieval via API.
11837
+ * Defaults to true when omitted. If set to true, response data will be stored for
11838
+ * at least 30 days, subject to the
11839
+ * [data retention exceptions](/api/docs/guides/your-data#v1responses).
11754
11840
  */
11755
11841
  store?: boolean | null;
11756
11842
 
@@ -11966,6 +12052,12 @@ export namespace BetaResponsesClientEvent {
11966
12052
  * for current details.
11967
12053
  */
11968
12054
  export interface PromptCacheOptions {
12055
+ /**
12056
+ * The ID of a response to compare when diagnosing prompt cache reuse. Supplying
12057
+ * this field requests prompt cache diagnostics when the feature is enabled.
12058
+ */
12059
+ comparison_response_id?: string | null;
12060
+
11969
12061
  /**
11970
12062
  * Controls whether OpenAI automatically creates an implicit cache breakpoint.
11971
12063
  * Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
@@ -13214,9 +13306,11 @@ export namespace BetaTool {
13214
13306
  * one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
13215
13307
  * the model will automatically determine the best background for the image.
13216
13308
  *
13217
- * Transparent backgrounds are available for supported GPT Image models. For
13218
- * `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
13219
- * using `transparent`, set the output format to `png` or `webp`.
13309
+ * `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
13310
+ * snapshots, support `opaque` and `transparent` backgrounds. Transparent
13311
+ * backgrounds are available for supported GPT Image models. For `gpt-image-2` and
13312
+ * `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
13313
+ * set the output format to `png` or `webp`.
13220
13314
  */
13221
13315
  background?: 'transparent' | 'opaque' | 'auto';
13222
13316
 
@@ -13236,7 +13330,9 @@ export namespace BetaTool {
13236
13330
 
13237
13331
  /**
13238
13332
  * The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
13239
- * `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
13333
+ * `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
13334
+ * `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
13335
+ * `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
13240
13336
  * `chatgpt-image-latest`. Default: `gpt-image-1`.
13241
13337
  */
13242
13338
  model?:
@@ -13245,6 +13341,10 @@ export namespace BetaTool {
13245
13341
  | 'gpt-image-1-mini'
13246
13342
  | 'gpt-image-2'
13247
13343
  | 'gpt-image-2-2026-04-21'
13344
+ | 'gpt-image-2.5-sunburst'
13345
+ | 'gpt-image-2.5-sunburst-2026-09-08'
13346
+ | 'gpt-image-2.5-flare'
13347
+ | 'gpt-image-2.5-flare-2026-09-08'
13248
13348
  | 'gpt-image-1.5'
13249
13349
  | 'chatgpt-image-latest';
13250
13350
 
@@ -13271,23 +13371,26 @@ export namespace BetaTool {
13271
13371
  partial_images?: number;
13272
13372
 
13273
13373
  /**
13274
- * The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.
13275
- * Default: `auto`.
13374
+ * The quality of the generated image. The GPT image models support `low`,
13375
+ * `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
13376
+ * including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
13377
+ * `auto`.
13276
13378
  */
13277
- quality?: 'low' | 'medium' | 'high' | 'auto';
13379
+ quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto';
13278
13380
 
13279
13381
  /**
13280
- * The size of the generated images. For `gpt-image-2` and
13281
- * `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
13282
- * strings, for example `1536x864`. Width and height must both be divisible by 16
13283
- * and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
13284
- * `2560x1440` are experimental, and the maximum supported resolution is
13285
- * `3840x2160`. The requested size must also satisfy the model's current pixel and
13286
- * edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
13287
- * supported by the GPT image models; `auto` is supported for models that allow
13288
- * automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
13289
- * `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
13290
- * `1024x1792`.
13382
+ * The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
13383
+ * `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
13384
+ * `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
13385
+ * resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
13386
+ * Width and height must both be divisible by 16 and the requested aspect ratio
13387
+ * must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
13388
+ * the maximum supported resolution is `3840x2160`. The requested size must also
13389
+ * satisfy the model's current pixel and edge limits. The standard sizes
13390
+ * `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
13391
+ * `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
13392
+ * one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
13393
+ * `1024x1024`, `1792x1024`, or `1024x1792`.
13291
13394
  */
13292
13395
  size?: (string & {}) | '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
13293
13396
  }
@@ -13958,7 +14061,9 @@ export interface ResponseCreateParamsBase {
13958
14061
 
13959
14062
  /**
13960
14063
  * Body param: Whether to store the generated model response for later retrieval
13961
- * via API.
14064
+ * via API. Defaults to true when omitted. If set to true, response data will be
14065
+ * stored for at least 30 days, subject to the
14066
+ * [data retention exceptions](/api/docs/guides/your-data#v1responses).
13962
14067
  */
13963
14068
  store?: boolean | null;
13964
14069
 
@@ -14173,6 +14278,12 @@ export namespace ResponseCreateParams {
14173
14278
  * for current details.
14174
14279
  */
14175
14280
  export interface PromptCacheOptions {
14281
+ /**
14282
+ * The ID of a response to compare when diagnosing prompt cache reuse. Supplying
14283
+ * this field requests prompt cache diagnostics when the feature is enabled.
14284
+ */
14285
+ comparison_response_id?: string | null;
14286
+
14176
14287
  /**
14177
14288
  * Controls whether OpenAI automatically creates an implicit cache breakpoint.
14178
14289
  * Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
@@ -14549,12 +14660,13 @@ export interface ResponseCompactParams {
14549
14660
  * request will be processed with the Flex Processing service tier. - To opt-in to
14550
14661
  * [Fast mode](/api/docs/guides/fast-mode) at the request level, include the
14551
14662
  * `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
14552
- * Completions. The response will show `service_tier=priority` regardless of if you
14553
- * specify `service_tier=fast` or `priority` in your request. - When not set, the
14554
- * default behavior is 'auto'. When the `service_tier` parameter is set, the
14555
- * response body will include the `service_tier` value based on the processing mode
14556
- * actually used to serve the request. This response value may be different from
14557
- * the value set in the parameter.
14663
+ * Completions. For models with a dedicated Fast tier, either value resolves to
14664
+ * `service_tier=fast`; for other models, either value resolves to
14665
+ * `service_tier=priority`. - When not set, the default behavior is 'auto'. When
14666
+ * the `service_tier` parameter is set, the response body will include the
14667
+ * `service_tier` value based on the processing mode actually used to serve the
14668
+ * request. This response value may be different from the value set in the
14669
+ * parameter.
14558
14670
  */
14559
14671
  service_tier?: 'auto' | 'default' | 'fast' | 'flex' | 'priority' | null;
14560
14672
 
@@ -142,6 +142,17 @@ export namespace ConversationItem {
142
142
  * The type of the image generation call. Always `image_generation_call`.
143
143
  */
144
144
  type: 'image_generation_call';
145
+
146
+ /**
147
+ * The quality of the image generated by the image generation tool call. One of
148
+ * `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
149
+ */
150
+ quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' | null;
151
+
152
+ /**
153
+ * The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
154
+ */
155
+ size?: (string & {}) | '1024x1024' | '1024x1536' | '1536x1024' | null;
145
156
  }
146
157
 
147
158
  export interface AdditionalTools {