openai 7.27.0 → 7.30.0

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 (335) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/helpers/standard-schema.d.mts +8 -3
  11. package/helpers/standard-schema.d.mts.map +1 -1
  12. package/helpers/standard-schema.d.ts +8 -3
  13. package/helpers/standard-schema.d.ts.map +1 -1
  14. package/helpers/standard-schema.js +1 -0
  15. package/helpers/standard-schema.js.map +1 -1
  16. package/helpers/standard-schema.mjs +1 -0
  17. package/helpers/standard-schema.mjs.map +1 -1
  18. package/helpers/zod.d.mts +2 -0
  19. package/helpers/zod.d.mts.map +1 -1
  20. package/helpers/zod.d.ts +2 -0
  21. package/helpers/zod.d.ts.map +1 -1
  22. package/helpers/zod.js +1 -0
  23. package/helpers/zod.js.map +1 -1
  24. package/helpers/zod.mjs +1 -0
  25. package/helpers/zod.mjs.map +1 -1
  26. package/lib/ChatCompletionStream.d.mts +2 -1
  27. package/lib/ChatCompletionStream.d.mts.map +1 -1
  28. package/lib/ChatCompletionStream.d.ts +2 -1
  29. package/lib/ChatCompletionStream.d.ts.map +1 -1
  30. package/lib/ChatCompletionStream.js +9 -2
  31. package/lib/ChatCompletionStream.js.map +1 -1
  32. package/lib/ChatCompletionStream.mjs +9 -2
  33. package/lib/ChatCompletionStream.mjs.map +1 -1
  34. package/lib/ResponsesParser.d.mts.map +1 -1
  35. package/lib/ResponsesParser.d.ts.map +1 -1
  36. package/lib/ResponsesParser.js +5 -0
  37. package/lib/ResponsesParser.js.map +1 -1
  38. package/lib/ResponsesParser.mjs +5 -0
  39. package/lib/ResponsesParser.mjs.map +1 -1
  40. package/lib/agents/agent-session-stream.d.mts +7 -0
  41. package/lib/agents/agent-session-stream.d.mts.map +1 -1
  42. package/lib/agents/agent-session-stream.d.ts +7 -0
  43. package/lib/agents/agent-session-stream.d.ts.map +1 -1
  44. package/lib/agents/agent-session-stream.js +8 -110
  45. package/lib/agents/agent-session-stream.js.map +1 -1
  46. package/lib/agents/agent-session-stream.mjs +9 -111
  47. package/lib/agents/agent-session-stream.mjs.map +1 -1
  48. package/lib/beta/agents/agent-session-create-stream.d.mts +41 -1
  49. package/lib/beta/agents/agent-session-create-stream.d.mts.map +1 -1
  50. package/lib/beta/agents/agent-session-create-stream.d.ts +41 -1
  51. package/lib/beta/agents/agent-session-create-stream.d.ts.map +1 -1
  52. package/lib/beta/agents/agent-session-create-stream.js +70 -2
  53. package/lib/beta/agents/agent-session-create-stream.js.map +1 -1
  54. package/lib/beta/agents/agent-session-create-stream.mjs +69 -2
  55. package/lib/beta/agents/agent-session-create-stream.mjs.map +1 -1
  56. package/lib/beta/agents/function-tool.d.mts.map +1 -1
  57. package/lib/beta/agents/function-tool.d.ts.map +1 -1
  58. package/lib/beta/agents/function-tool.js +22 -15
  59. package/lib/beta/agents/function-tool.js.map +1 -1
  60. package/lib/beta/agents/function-tool.mjs +22 -15
  61. package/lib/beta/agents/function-tool.mjs.map +1 -1
  62. package/lib/beta/agents/parse-result.d.mts +4 -2
  63. package/lib/beta/agents/parse-result.d.mts.map +1 -1
  64. package/lib/beta/agents/parse-result.d.ts +4 -2
  65. package/lib/beta/agents/parse-result.d.ts.map +1 -1
  66. package/lib/beta/agents/tool-dispatcher.d.mts +13 -0
  67. package/lib/beta/agents/tool-dispatcher.d.mts.map +1 -0
  68. package/lib/beta/agents/tool-dispatcher.d.ts +13 -0
  69. package/lib/beta/agents/tool-dispatcher.d.ts.map +1 -0
  70. package/lib/beta/agents/tool-dispatcher.js +185 -0
  71. package/lib/beta/agents/tool-dispatcher.js.map +1 -0
  72. package/lib/beta/agents/tool-dispatcher.mjs +181 -0
  73. package/lib/beta/agents/tool-dispatcher.mjs.map +1 -0
  74. package/lib/beta/agents/tool-error.d.mts +13 -0
  75. package/lib/beta/agents/tool-error.d.mts.map +1 -0
  76. package/lib/beta/agents/tool-error.d.ts +13 -0
  77. package/lib/beta/agents/tool-error.d.ts.map +1 -0
  78. package/lib/beta/agents/tool-error.js +3 -0
  79. package/lib/beta/agents/tool-error.js.map +1 -0
  80. package/lib/beta/agents/tool-error.mjs +2 -0
  81. package/lib/beta/agents/tool-error.mjs.map +1 -0
  82. package/lib/beta/agents/tool-stages.d.mts +12 -0
  83. package/lib/beta/agents/tool-stages.d.mts.map +1 -0
  84. package/lib/beta/agents/tool-stages.d.ts +12 -0
  85. package/lib/beta/agents/tool-stages.d.ts.map +1 -0
  86. package/lib/beta/agents/tool-stages.js +6 -0
  87. package/lib/beta/agents/tool-stages.js.map +1 -0
  88. package/lib/beta/agents/tool-stages.mjs +3 -0
  89. package/lib/beta/agents/tool-stages.mjs.map +1 -0
  90. package/lib/chat-completions/streaming.d.mts +11 -0
  91. package/lib/chat-completions/streaming.d.mts.map +1 -0
  92. package/lib/chat-completions/streaming.d.ts +11 -0
  93. package/lib/chat-completions/streaming.d.ts.map +1 -0
  94. package/lib/chat-completions/streaming.js +27 -0
  95. package/lib/chat-completions/streaming.js.map +1 -0
  96. package/lib/chat-completions/streaming.mjs +23 -0
  97. package/lib/chat-completions/streaming.mjs.map +1 -0
  98. package/package.json +1 -1
  99. package/resources/admin/organization/usage.d.mts +381 -20
  100. package/resources/admin/organization/usage.d.mts.map +1 -1
  101. package/resources/admin/organization/usage.d.ts +381 -20
  102. package/resources/admin/organization/usage.d.ts.map +1 -1
  103. package/resources/audio/audio.d.mts +4 -0
  104. package/resources/audio/audio.d.mts.map +1 -1
  105. package/resources/audio/audio.d.ts +4 -0
  106. package/resources/audio/audio.d.ts.map +1 -1
  107. package/resources/audio/audio.js +4 -0
  108. package/resources/audio/audio.js.map +1 -1
  109. package/resources/audio/audio.mjs +4 -0
  110. package/resources/audio/audio.mjs.map +1 -1
  111. package/resources/audio/index.d.mts +1 -0
  112. package/resources/audio/index.d.mts.map +1 -1
  113. package/resources/audio/index.d.ts +1 -0
  114. package/resources/audio/index.d.ts.map +1 -1
  115. package/resources/audio/index.js +3 -1
  116. package/resources/audio/index.js.map +1 -1
  117. package/resources/audio/index.mjs +1 -0
  118. package/resources/audio/index.mjs.map +1 -1
  119. package/resources/audio/speech.d.mts +2 -0
  120. package/resources/audio/speech.d.mts.map +1 -1
  121. package/resources/audio/speech.d.ts +2 -0
  122. package/resources/audio/speech.d.ts.map +1 -1
  123. package/resources/audio/voices.d.mts +119 -0
  124. package/resources/audio/voices.d.mts.map +1 -0
  125. package/resources/audio/voices.d.ts +119 -0
  126. package/resources/audio/voices.d.ts.map +1 -0
  127. package/resources/audio/voices.js +41 -0
  128. package/resources/audio/voices.js.map +1 -0
  129. package/resources/audio/voices.mjs +37 -0
  130. package/resources/audio/voices.mjs.map +1 -0
  131. package/resources/beta/agents/agents.d.mts +14 -10
  132. package/resources/beta/agents/agents.d.mts.map +1 -1
  133. package/resources/beta/agents/agents.d.ts +14 -10
  134. package/resources/beta/agents/agents.d.ts.map +1 -1
  135. package/resources/beta/agents/agents.js.map +1 -1
  136. package/resources/beta/agents/agents.mjs.map +1 -1
  137. package/resources/beta/agents/environments/templates.d.mts +6 -8
  138. package/resources/beta/agents/environments/templates.d.mts.map +1 -1
  139. package/resources/beta/agents/environments/templates.d.ts +6 -8
  140. package/resources/beta/agents/environments/templates.d.ts.map +1 -1
  141. package/resources/beta/agents/sessions/index.d.mts +1 -1
  142. package/resources/beta/agents/sessions/index.d.mts.map +1 -1
  143. package/resources/beta/agents/sessions/index.d.ts +1 -1
  144. package/resources/beta/agents/sessions/index.d.ts.map +1 -1
  145. package/resources/beta/agents/sessions/index.js +2 -2
  146. package/resources/beta/agents/sessions/index.js.map +1 -1
  147. package/resources/beta/agents/sessions/index.mjs +1 -1
  148. package/resources/beta/agents/sessions/index.mjs.map +1 -1
  149. package/resources/beta/agents/sessions/sessions.d.mts +8 -7
  150. package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
  151. package/resources/beta/agents/sessions/sessions.d.ts +8 -7
  152. package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
  153. package/resources/beta/agents/sessions/sessions.js +7 -4
  154. package/resources/beta/agents/sessions/sessions.js.map +1 -1
  155. package/resources/beta/agents/sessions/sessions.mjs +8 -5
  156. package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
  157. package/resources/beta/agents/sessions/subagents/turns/turns.d.mts +2 -2
  158. package/resources/beta/agents/sessions/subagents/turns/turns.d.mts.map +1 -1
  159. package/resources/beta/agents/sessions/subagents/turns/turns.d.ts +2 -2
  160. package/resources/beta/agents/sessions/subagents/turns/turns.d.ts.map +1 -1
  161. package/resources/beta/agents/sessions/turns/index.d.mts +3 -0
  162. package/resources/beta/agents/sessions/turns/index.d.mts.map +1 -0
  163. package/resources/beta/agents/sessions/turns/index.d.ts +3 -0
  164. package/resources/beta/agents/sessions/turns/index.d.ts.map +1 -0
  165. package/resources/beta/agents/sessions/turns/index.js +9 -0
  166. package/resources/beta/agents/sessions/turns/index.js.map +1 -0
  167. package/resources/beta/agents/sessions/turns/index.mjs +4 -0
  168. package/resources/beta/agents/sessions/turns/index.mjs.map +1 -0
  169. package/resources/beta/agents/sessions/turns/items.d.mts +43 -0
  170. package/resources/beta/agents/sessions/turns/items.d.mts.map +1 -0
  171. package/resources/beta/agents/sessions/turns/items.d.ts +43 -0
  172. package/resources/beta/agents/sessions/turns/items.d.ts.map +1 -0
  173. package/resources/beta/agents/sessions/turns/items.js +40 -0
  174. package/resources/beta/agents/sessions/turns/items.js.map +1 -0
  175. package/resources/beta/agents/sessions/turns/items.mjs +36 -0
  176. package/resources/beta/agents/sessions/turns/items.mjs.map +1 -0
  177. package/resources/beta/agents/sessions/turns/turns.d.mts +128 -0
  178. package/resources/beta/agents/sessions/turns/turns.d.mts.map +1 -0
  179. package/resources/beta/agents/sessions/turns/turns.d.ts +128 -0
  180. package/resources/beta/agents/sessions/turns/turns.d.ts.map +1 -0
  181. package/resources/beta/agents/sessions/turns/turns.js +111 -0
  182. package/resources/beta/agents/sessions/turns/turns.js.map +1 -0
  183. package/resources/beta/agents/sessions/turns/turns.mjs +106 -0
  184. package/resources/beta/agents/sessions/turns/turns.mjs.map +1 -0
  185. package/resources/beta/agents/sessions/turns.d.mts +1 -123
  186. package/resources/beta/agents/sessions/turns.d.mts.map +1 -1
  187. package/resources/beta/agents/sessions/turns.d.ts +1 -123
  188. package/resources/beta/agents/sessions/turns.d.ts.map +1 -1
  189. package/resources/beta/agents/sessions/turns.js +2 -99
  190. package/resources/beta/agents/sessions/turns.js.map +1 -1
  191. package/resources/beta/agents/sessions/turns.mjs +1 -97
  192. package/resources/beta/agents/sessions/turns.mjs.map +1 -1
  193. package/resources/beta/beta.d.mts +2 -2
  194. package/resources/beta/beta.d.mts.map +1 -1
  195. package/resources/beta/beta.d.ts +2 -2
  196. package/resources/beta/beta.d.ts.map +1 -1
  197. package/resources/beta/beta.js.map +1 -1
  198. package/resources/beta/beta.mjs.map +1 -1
  199. package/resources/beta/index.d.mts +1 -1
  200. package/resources/beta/index.d.mts.map +1 -1
  201. package/resources/beta/index.d.ts +1 -1
  202. package/resources/beta/index.d.ts.map +1 -1
  203. package/resources/beta/index.js.map +1 -1
  204. package/resources/beta/index.mjs.map +1 -1
  205. package/resources/beta/responses/index.d.mts +1 -1
  206. package/resources/beta/responses/index.d.mts.map +1 -1
  207. package/resources/beta/responses/index.d.ts +1 -1
  208. package/resources/beta/responses/index.d.ts.map +1 -1
  209. package/resources/beta/responses/index.js.map +1 -1
  210. package/resources/beta/responses/index.mjs.map +1 -1
  211. package/resources/beta/responses/responses.d.mts +379 -9
  212. package/resources/beta/responses/responses.d.mts.map +1 -1
  213. package/resources/beta/responses/responses.d.ts +379 -9
  214. package/resources/beta/responses/responses.d.ts.map +1 -1
  215. package/resources/beta/responses/responses.js.map +1 -1
  216. package/resources/beta/responses/responses.mjs.map +1 -1
  217. package/resources/chat/completions/completions.d.mts +44 -9
  218. package/resources/chat/completions/completions.d.mts.map +1 -1
  219. package/resources/chat/completions/completions.d.ts +44 -9
  220. package/resources/chat/completions/completions.d.ts.map +1 -1
  221. package/resources/chat/completions/completions.js +5 -2
  222. package/resources/chat/completions/completions.js.map +1 -1
  223. package/resources/chat/completions/completions.mjs +5 -2
  224. package/resources/chat/completions/completions.mjs.map +1 -1
  225. package/resources/completions.d.mts +1 -1
  226. package/resources/completions.d.mts.map +1 -1
  227. package/resources/completions.d.ts +1 -1
  228. package/resources/completions.d.ts.map +1 -1
  229. package/resources/decisions.d.mts +196 -0
  230. package/resources/decisions.d.mts.map +1 -0
  231. package/resources/decisions.d.ts +196 -0
  232. package/resources/decisions.d.ts.map +1 -0
  233. package/resources/decisions.js +32 -0
  234. package/resources/decisions.js.map +1 -0
  235. package/resources/decisions.mjs +28 -0
  236. package/resources/decisions.mjs.map +1 -0
  237. package/resources/fine-tuning/jobs/jobs.d.mts +7 -2
  238. package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -1
  239. package/resources/fine-tuning/jobs/jobs.d.ts +7 -2
  240. package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
  241. package/resources/fine-tuning/jobs/jobs.js.map +1 -1
  242. package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
  243. package/resources/graders/grader-models.d.mts +1 -1
  244. package/resources/graders/grader-models.d.ts +1 -1
  245. package/resources/images.d.mts +61 -75
  246. package/resources/images.d.mts.map +1 -1
  247. package/resources/images.d.ts +61 -75
  248. package/resources/images.d.ts.map +1 -1
  249. package/resources/images.js +4 -7
  250. package/resources/images.js.map +1 -1
  251. package/resources/images.mjs +4 -7
  252. package/resources/images.mjs.map +1 -1
  253. package/resources/index.d.mts +1 -0
  254. package/resources/index.d.mts.map +1 -1
  255. package/resources/index.d.ts +1 -0
  256. package/resources/index.d.ts.map +1 -1
  257. package/resources/index.js +3 -1
  258. package/resources/index.js.map +1 -1
  259. package/resources/index.mjs +1 -0
  260. package/resources/index.mjs.map +1 -1
  261. package/resources/realtime/realtime.d.mts +16 -4
  262. package/resources/realtime/realtime.d.mts.map +1 -1
  263. package/resources/realtime/realtime.d.ts +16 -4
  264. package/resources/realtime/realtime.d.ts.map +1 -1
  265. package/resources/realtime/realtime.js.map +1 -1
  266. package/resources/realtime/realtime.mjs.map +1 -1
  267. package/resources/responses/responses.d.mts +381 -9
  268. package/resources/responses/responses.d.mts.map +1 -1
  269. package/resources/responses/responses.d.ts +381 -9
  270. package/resources/responses/responses.d.ts.map +1 -1
  271. package/resources/responses/responses.js.map +1 -1
  272. package/resources/responses/responses.mjs.map +1 -1
  273. package/resources/shared.d.mts +69 -0
  274. package/resources/shared.d.mts.map +1 -1
  275. package/resources/shared.d.ts +69 -0
  276. package/resources/shared.d.ts.map +1 -1
  277. package/resources/videos.d.mts +5 -0
  278. package/resources/videos.d.mts.map +1 -1
  279. package/resources/videos.d.ts +5 -0
  280. package/resources/videos.d.ts.map +1 -1
  281. package/resources/webhooks/webhooks.d.mts +211 -6
  282. package/resources/webhooks/webhooks.d.mts.map +1 -1
  283. package/resources/webhooks/webhooks.d.ts +211 -6
  284. package/resources/webhooks/webhooks.d.ts.map +1 -1
  285. package/resources/webhooks/webhooks.js.map +1 -1
  286. package/resources/webhooks/webhooks.mjs.map +1 -1
  287. package/src/client.ts +21 -0
  288. package/src/helpers/standard-schema.ts +11 -4
  289. package/src/helpers/zod.ts +4 -0
  290. package/src/lib/ChatCompletionStream.ts +10 -3
  291. package/src/lib/ResponsesParser.ts +8 -0
  292. package/src/lib/agents/agent-session-stream.ts +20 -124
  293. package/src/lib/beta/agents/agent-session-create-stream.ts +87 -1
  294. package/src/lib/beta/agents/function-tool.ts +23 -15
  295. package/src/lib/beta/agents/tool-dispatcher.ts +226 -0
  296. package/src/lib/beta/agents/tool-error.ts +12 -0
  297. package/src/lib/beta/agents/tool-stages.ts +14 -0
  298. package/src/lib/chat-completions/streaming.ts +35 -0
  299. package/src/resources/admin/organization/usage.ts +438 -20
  300. package/src/resources/audio/audio.ts +6 -0
  301. package/src/resources/audio/index.ts +1 -0
  302. package/src/resources/audio/speech.ts +2 -0
  303. package/src/resources/audio/voices.ts +152 -0
  304. package/src/resources/beta/agents/agents.ts +16 -9
  305. package/src/resources/beta/agents/environments/templates.ts +6 -8
  306. package/src/resources/beta/agents/sessions/index.ts +7 -1
  307. package/src/resources/beta/agents/sessions/sessions.ts +18 -8
  308. package/src/resources/beta/agents/sessions/subagents/turns/turns.ts +2 -2
  309. package/src/resources/beta/agents/sessions/turns/index.ts +4 -0
  310. package/src/resources/beta/agents/sessions/turns/items.ts +79 -0
  311. package/src/resources/beta/agents/sessions/turns/turns.ts +383 -0
  312. package/src/resources/beta/agents/sessions/turns.ts +1 -373
  313. package/src/resources/beta/beta.ts +2 -0
  314. package/src/resources/beta/index.ts +1 -0
  315. package/src/resources/beta/responses/index.ts +1 -0
  316. package/src/resources/beta/responses/responses.ts +471 -8
  317. package/src/resources/chat/completions/completions.ts +67 -19
  318. package/src/resources/completions.ts +1 -1
  319. package/src/resources/decisions.ts +290 -0
  320. package/src/resources/fine-tuning/jobs/jobs.ts +7 -2
  321. package/src/resources/graders/grader-models.ts +1 -1
  322. package/src/resources/images.ts +62 -76
  323. package/src/resources/index.ts +9 -0
  324. package/src/resources/realtime/realtime.ts +16 -4
  325. package/src/resources/responses/api.md +1 -0
  326. package/src/resources/responses/responses.ts +473 -8
  327. package/src/resources/shared.ts +70 -0
  328. package/src/resources/videos.ts +6 -0
  329. package/src/resources/webhooks/api.md +5 -0
  330. package/src/resources/webhooks/webhooks.ts +273 -1
  331. package/src/version.ts +1 -1
  332. package/version.d.mts +1 -1
  333. package/version.d.ts +1 -1
  334. package/version.js +1 -1
  335. package/version.mjs +1 -1
@@ -0,0 +1,119 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { type Uploadable } from "../../core/uploads.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ /**
6
+ * Turn audio into text or text into audio.
7
+ */
8
+ export declare class Voices extends APIResource {
9
+ /**
10
+ * Creates a voice from a text prompt or from a consent recording and an audio
11
+ * sample.
12
+ *
13
+ * For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
14
+ * JSON or multipart form data. For creation from an audio sample, send
15
+ * `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
16
+ * as multipart form data. The type defaults to `audio_sample` when omitted.
17
+ *
18
+ * Returns the saved voice's metadata. Voices created from text prompts are
19
+ * supported only in Live, not in Realtime or the speech endpoint. The response
20
+ * does not include preview audio.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const voice = await client.audio.voices.create({
25
+ * audio_sample: fs.createReadStream('path/to/file'),
26
+ * consent: 'consent',
27
+ * name: 'x',
28
+ * });
29
+ * ```
30
+ */
31
+ create(body: VoiceCreateParams, options?: RequestOptions): APIPromise<Voice>;
32
+ }
33
+ /**
34
+ * A custom voice that can be used for audio output. Voices created from text
35
+ * prompts are supported only in Live.
36
+ */
37
+ export interface Voice {
38
+ /**
39
+ * The voice identifier, which can be referenced in API endpoints.
40
+ */
41
+ id: string;
42
+ /**
43
+ * The Unix timestamp (in seconds) for when the voice was created.
44
+ */
45
+ created_at: number;
46
+ /**
47
+ * The name of the voice.
48
+ */
49
+ name: string;
50
+ /**
51
+ * The object type, which is always `audio.voice`.
52
+ */
53
+ object: 'audio.voice';
54
+ /**
55
+ * How the voice was created. Voices created from text prompts are supported only
56
+ * in Live.
57
+ */
58
+ type: 'audio_sample' | 'prompt';
59
+ }
60
+ export type VoiceCreateParams = VoiceCreateParams.Consent | VoiceCreateParams.Prompt;
61
+ export declare namespace VoiceCreateParams {
62
+ /**
63
+ * Creates a voice from a consent recording and an audio sample. Requires
64
+ * multipart/form-data.
65
+ */
66
+ interface Consent {
67
+ /**
68
+ * The sample audio recording file. Maximum size is 10 MiB.
69
+ *
70
+ * Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
71
+ * `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
72
+ */
73
+ audio_sample: Uploadable;
74
+ /**
75
+ * The consent recording ID (for example, `cons_1234`).
76
+ */
77
+ consent: string;
78
+ /**
79
+ * The name of the new voice.
80
+ */
81
+ name: string;
82
+ /**
83
+ * The voice creation method. Defaults to `audio_sample` when omitted.
84
+ */
85
+ type?: 'audio_sample';
86
+ }
87
+ /**
88
+ * Creates a synthetic voice from a text description. Supports application/json or
89
+ * multipart/form-data.
90
+ */
91
+ interface Prompt {
92
+ /**
93
+ * The name of the new voice.
94
+ */
95
+ name: string;
96
+ /**
97
+ * A description of the desired voice. Must not contain only whitespace.
98
+ */
99
+ prompt: string;
100
+ /**
101
+ * Set to `prompt` to create a voice from a text description.
102
+ */
103
+ type: 'prompt';
104
+ /**
105
+ * The voice creation model to use. Defaults to `auto`.
106
+ */
107
+ model?: string | 'auto' | '2026-10-01';
108
+ /**
109
+ * Optional text for the voice to speak during creation. If omitted, a script is
110
+ * generated from the prompt. Must not be blank after trimming whitespace; scripts
111
+ * that are too short are rejected.
112
+ */
113
+ script_hint?: string;
114
+ }
115
+ }
116
+ export declare namespace Voices {
117
+ export { type Voice as Voice, type VoiceCreateParams as VoiceCreateParams };
118
+ }
119
+ //# sourceMappingURL=voices.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.d.mts","sourceRoot":"","sources":["../../src/resources/audio/voices.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,+BAA2B;AACrD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAUhE;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;CAQ7E;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,IAAI,EAAE,cAAc,GAAG,QAAQ,CAAC;CACjC;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAErF,MAAM,CAAC,OAAO,WAAW,iBAAiB,CAAC;IACzC;;;OAGG;IACH,UAAiB,OAAO;QACtB;;;;;WAKG;QACH,YAAY,EAAE,UAAU,CAAC;QAEzB;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,CAAC,EAAE,cAAc,CAAC;KACvB;IAED;;;OAGG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,IAAI,EAAE,QAAQ,CAAC;QAEf;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;QAEvC;;;;WAIG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,KAAK,IAAI,KAAK,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CAC7E"}
@@ -0,0 +1,119 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { type Uploadable } from "../../core/uploads.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ /**
6
+ * Turn audio into text or text into audio.
7
+ */
8
+ export declare class Voices extends APIResource {
9
+ /**
10
+ * Creates a voice from a text prompt or from a consent recording and an audio
11
+ * sample.
12
+ *
13
+ * For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
14
+ * JSON or multipart form data. For creation from an audio sample, send
15
+ * `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
16
+ * as multipart form data. The type defaults to `audio_sample` when omitted.
17
+ *
18
+ * Returns the saved voice's metadata. Voices created from text prompts are
19
+ * supported only in Live, not in Realtime or the speech endpoint. The response
20
+ * does not include preview audio.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const voice = await client.audio.voices.create({
25
+ * audio_sample: fs.createReadStream('path/to/file'),
26
+ * consent: 'consent',
27
+ * name: 'x',
28
+ * });
29
+ * ```
30
+ */
31
+ create(body: VoiceCreateParams, options?: RequestOptions): APIPromise<Voice>;
32
+ }
33
+ /**
34
+ * A custom voice that can be used for audio output. Voices created from text
35
+ * prompts are supported only in Live.
36
+ */
37
+ export interface Voice {
38
+ /**
39
+ * The voice identifier, which can be referenced in API endpoints.
40
+ */
41
+ id: string;
42
+ /**
43
+ * The Unix timestamp (in seconds) for when the voice was created.
44
+ */
45
+ created_at: number;
46
+ /**
47
+ * The name of the voice.
48
+ */
49
+ name: string;
50
+ /**
51
+ * The object type, which is always `audio.voice`.
52
+ */
53
+ object: 'audio.voice';
54
+ /**
55
+ * How the voice was created. Voices created from text prompts are supported only
56
+ * in Live.
57
+ */
58
+ type: 'audio_sample' | 'prompt';
59
+ }
60
+ export type VoiceCreateParams = VoiceCreateParams.Consent | VoiceCreateParams.Prompt;
61
+ export declare namespace VoiceCreateParams {
62
+ /**
63
+ * Creates a voice from a consent recording and an audio sample. Requires
64
+ * multipart/form-data.
65
+ */
66
+ interface Consent {
67
+ /**
68
+ * The sample audio recording file. Maximum size is 10 MiB.
69
+ *
70
+ * Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
71
+ * `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
72
+ */
73
+ audio_sample: Uploadable;
74
+ /**
75
+ * The consent recording ID (for example, `cons_1234`).
76
+ */
77
+ consent: string;
78
+ /**
79
+ * The name of the new voice.
80
+ */
81
+ name: string;
82
+ /**
83
+ * The voice creation method. Defaults to `audio_sample` when omitted.
84
+ */
85
+ type?: 'audio_sample';
86
+ }
87
+ /**
88
+ * Creates a synthetic voice from a text description. Supports application/json or
89
+ * multipart/form-data.
90
+ */
91
+ interface Prompt {
92
+ /**
93
+ * The name of the new voice.
94
+ */
95
+ name: string;
96
+ /**
97
+ * A description of the desired voice. Must not contain only whitespace.
98
+ */
99
+ prompt: string;
100
+ /**
101
+ * Set to `prompt` to create a voice from a text description.
102
+ */
103
+ type: 'prompt';
104
+ /**
105
+ * The voice creation model to use. Defaults to `auto`.
106
+ */
107
+ model?: string | 'auto' | '2026-10-01';
108
+ /**
109
+ * Optional text for the voice to speak during creation. If omitted, a script is
110
+ * generated from the prompt. Must not be blank after trimming whitespace; scripts
111
+ * that are too short are rejected.
112
+ */
113
+ script_hint?: string;
114
+ }
115
+ }
116
+ export declare namespace Voices {
117
+ export { type Voice as Voice, type VoiceCreateParams as VoiceCreateParams };
118
+ }
119
+ //# sourceMappingURL=voices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../src/resources/audio/voices.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,8BAA2B;AACrD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAUhE;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;CAQ7E;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,IAAI,EAAE,cAAc,GAAG,QAAQ,CAAC;CACjC;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAErF,MAAM,CAAC,OAAO,WAAW,iBAAiB,CAAC;IACzC;;;OAGG;IACH,UAAiB,OAAO;QACtB;;;;;WAKG;QACH,YAAY,EAAE,UAAU,CAAC;QAEzB;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,CAAC,EAAE,cAAc,CAAC;KACvB;IAED;;;OAGG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,IAAI,EAAE,QAAQ,CAAC;QAEf;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;QAEvC;;;;WAIG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,KAAK,IAAI,KAAK,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CAC7E"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Voices = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const uploads_1 = require("../../internal/uploads.js");
7
+ function resolveResourceRequestOptions(options, buildOptions) {
8
+ return Promise.resolve(options).then(buildOptions);
9
+ }
10
+ /**
11
+ * Turn audio into text or text into audio.
12
+ */
13
+ class Voices extends resource_1.APIResource {
14
+ /**
15
+ * Creates a voice from a text prompt or from a consent recording and an audio
16
+ * sample.
17
+ *
18
+ * For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
19
+ * JSON or multipart form data. For creation from an audio sample, send
20
+ * `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
21
+ * as multipart form data. The type defaults to `audio_sample` when omitted.
22
+ *
23
+ * Returns the saved voice's metadata. Voices created from text prompts are
24
+ * supported only in Live, not in Realtime or the speech endpoint. The response
25
+ * does not include preview audio.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const voice = await client.audio.voices.create({
30
+ * audio_sample: fs.createReadStream('path/to/file'),
31
+ * consent: 'consent',
32
+ * name: 'x',
33
+ * });
34
+ * ```
35
+ */
36
+ create(body, options) {
37
+ return this._client.post('/audio/voices', resolveResourceRequestOptions(options, (options) => (0, uploads_1.multipartFormRequestOptions)({ body, ...options, __security: { bearerAuth: true } }, this._client)));
38
+ }
39
+ }
40
+ exports.Voices = Voices;
41
+ //# sourceMappingURL=voices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.js","sourceRoot":"","sources":["../../src/resources/audio/voices.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;AAErF,qDAAkD;AAIlD,uDAAqE;AAErE,SAAS,6BAA6B,CACpC,OAAmC,EACnC,YAA+F;IAE/F,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,eAAe,EACf,6BAA6B,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACjD,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAClG,CACF,CAAC;IACJ,CAAC;CACF;AA/BD,wBA+BC"}
@@ -0,0 +1,37 @@
1
+ // File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
4
+ function resolveResourceRequestOptions(options, buildOptions) {
5
+ return Promise.resolve(options).then(buildOptions);
6
+ }
7
+ /**
8
+ * Turn audio into text or text into audio.
9
+ */
10
+ export class Voices extends APIResource {
11
+ /**
12
+ * Creates a voice from a text prompt or from a consent recording and an audio
13
+ * sample.
14
+ *
15
+ * For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
16
+ * JSON or multipart form data. For creation from an audio sample, send
17
+ * `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
18
+ * as multipart form data. The type defaults to `audio_sample` when omitted.
19
+ *
20
+ * Returns the saved voice's metadata. Voices created from text prompts are
21
+ * supported only in Live, not in Realtime or the speech endpoint. The response
22
+ * does not include preview audio.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const voice = await client.audio.voices.create({
27
+ * audio_sample: fs.createReadStream('path/to/file'),
28
+ * consent: 'consent',
29
+ * name: 'x',
30
+ * });
31
+ * ```
32
+ */
33
+ create(body, options) {
34
+ return this._client.post('/audio/voices', resolveResourceRequestOptions(options, (options) => multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client)));
35
+ }
36
+ }
37
+ //# sourceMappingURL=voices.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.mjs","sourceRoot":"","sources":["../../src/resources/audio/voices.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,OAAO,EAAE,2BAA2B,EAAE,mCAA+B;AAErE,SAAS,6BAA6B,CACpC,OAAmC,EACnC,YAA+F;IAE/F,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,eAAe,EACf,6BAA6B,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACjD,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAClG,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { APIResource } from "../../../core/resource.mjs";
2
2
  import * as AgentsAPI from "./agents.mjs";
3
- import * as TurnsAPI from "./sessions/turns.mjs";
3
+ import * as TurnsAPI from "./sessions/turns/turns.mjs";
4
4
  import * as EnvironmentsAPI from "./environments/environments.mjs";
5
5
  import { EnvironmentInfo, Environments } from "./environments/environments.mjs";
6
6
  import * as SessionsAPI from "./sessions/sessions.mjs";
@@ -2913,8 +2913,8 @@ export declare namespace EnvironmentParam {
2913
2913
  */
2914
2914
  files?: Array<AgentsAPI.HostedEnvironmentFileParam> | null;
2915
2915
  /**
2916
- * Network access policy for the environment. Defaults to disabled for GA requests
2917
- * and enabled for beta requests.
2916
+ * Network access policy for the environment. If omitted, the API version
2917
+ * determines whether network access is enabled or disabled.
2918
2918
  */
2919
2919
  network?: EnvironmentParamOpenAIHosted.Network | null;
2920
2920
  /**
@@ -2947,8 +2947,8 @@ export declare namespace EnvironmentParam {
2947
2947
  enabled: boolean;
2948
2948
  }
2949
2949
  /**
2950
- * Network access policy for the environment. Defaults to disabled for GA requests
2951
- * and enabled for beta requests.
2950
+ * Network access policy for the environment. If omitted, the API version
2951
+ * determines whether network access is enabled or disabled.
2952
2952
  */
2953
2953
  interface Network {
2954
2954
  /**
@@ -3907,6 +3907,12 @@ export interface SessionTurnError {
3907
3907
  * - `session_budget_exceeded` - The session has reached its usage budget.
3908
3908
  * - `usage_limit_exceeded` - The organization has reached a usage, plan, or
3909
3909
  * billing limit.
3910
+ * - `project_spend_limit_exceeded` - The project has reached its enforced spend
3911
+ * limit.
3912
+ * - `organization_spend_limit_exceeded` - The organization has reached its
3913
+ * enforced spend limit.
3914
+ * - `organization_usage_limit_exceeded` - The organization has reached its
3915
+ * OpenAI-assigned usage limit.
3910
3916
  * - `credit_balance_exhausted` - The organization has no API credits remaining.
3911
3917
  * - `rate_limit_exceeded` - The request exceeds the available rate limit.
3912
3918
  * - `flex_unavailable` - Flex processing is temporarily unavailable.
@@ -3929,7 +3935,7 @@ export interface SessionTurnError {
3929
3935
  * - `internal_error` - An unexpected internal error prevented the session request
3930
3936
  * from completing.
3931
3937
  */
3932
- code: 'context_length_exceeded' | 'session_budget_exceeded' | 'usage_limit_exceeded' | 'credit_balance_exhausted' | 'rate_limit_exceeded' | 'flex_unavailable' | 'server_overloaded' | 'cyber_policy' | 'misalignment_policy_violation' | 'connection_failed' | 'server_error' | 'authentication_error' | 'invalid_request' | 'resource_not_found' | 'sandbox_error' | 'executor_version_incompatible' | 'active_turn_not_steerable' | 'request_timeout' | 'internal_error';
3938
+ code: 'context_length_exceeded' | 'session_budget_exceeded' | 'usage_limit_exceeded' | 'project_spend_limit_exceeded' | 'organization_spend_limit_exceeded' | 'organization_usage_limit_exceeded' | 'credit_balance_exhausted' | 'rate_limit_exceeded' | 'flex_unavailable' | 'server_overloaded' | 'cyber_policy' | 'misalignment_policy_violation' | 'connection_failed' | 'server_error' | 'authentication_error' | 'invalid_request' | 'resource_not_found' | 'sandbox_error' | 'executor_version_incompatible' | 'active_turn_not_steerable' | 'request_timeout' | 'internal_error';
3933
3939
  /**
3934
3940
  * A customer-safe explanation of the failure.
3935
3941
  */
@@ -4213,9 +4219,8 @@ export interface AgentCreateParams {
4213
4219
  * - `flex` - Uses the flex service tier.
4214
4220
  * - `priority` - Uses the priority service tier.
4215
4221
  * - `fast` - Uses the fast service tier.
4216
- * - `ultrafast` - Uses the ultrafast service tier.
4217
4222
  */
4218
- service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'fast' | 'ultrafast' | null;
4223
+ service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'fast' | null;
4219
4224
  /**
4220
4225
  * Configuration for generated text. Defaults to the `text` format and medium
4221
4226
  * verbosity.
@@ -4265,9 +4270,8 @@ export interface AgentUpdateParams {
4265
4270
  * - `flex` - Uses the flex service tier.
4266
4271
  * - `priority` - Uses the priority service tier.
4267
4272
  * - `fast` - Uses the fast service tier.
4268
- * - `ultrafast` - Uses the ultrafast service tier.
4269
4273
  */
4270
- service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'fast' | 'ultrafast' | null;
4274
+ service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'fast' | null;
4271
4275
  /**
4272
4276
  * Configuration for text generated by the agent.
4273
4277
  */