openai-mcp-test 0.0.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 (1367) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +487 -0
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +46 -0
  12. package/bin/migration-config.json +1043 -0
  13. package/client.d.mts +293 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +293 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +557 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +553 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +50 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +50 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +118 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +102 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +89 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +89 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +156 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +148 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/streaming.d.mts +33 -0
  54. package/core/streaming.d.mts.map +1 -0
  55. package/core/streaming.d.ts +33 -0
  56. package/core/streaming.d.ts.map +1 -0
  57. package/core/streaming.js +277 -0
  58. package/core/streaming.js.map +1 -0
  59. package/core/streaming.mjs +272 -0
  60. package/core/streaming.mjs.map +1 -0
  61. package/core/uploads.d.mts +3 -0
  62. package/core/uploads.d.mts.map +1 -0
  63. package/core/uploads.d.ts +3 -0
  64. package/core/uploads.d.ts.map +1 -0
  65. package/core/uploads.js +6 -0
  66. package/core/uploads.js.map +1 -0
  67. package/core/uploads.mjs +2 -0
  68. package/core/uploads.mjs.map +1 -0
  69. package/error.d.mts +2 -0
  70. package/error.d.mts.map +1 -0
  71. package/error.d.ts +2 -0
  72. package/error.d.ts.map +1 -0
  73. package/error.js +6 -0
  74. package/error.js.map +1 -0
  75. package/error.mjs +2 -0
  76. package/error.mjs.map +1 -0
  77. package/index.d.mts +7 -0
  78. package/index.d.mts.map +1 -0
  79. package/index.d.ts +7 -0
  80. package/index.d.ts.map +1 -0
  81. package/index.js +32 -0
  82. package/index.js.map +1 -0
  83. package/index.mjs +8 -0
  84. package/index.mjs.map +1 -0
  85. package/internal/builtin-types.d.mts +73 -0
  86. package/internal/builtin-types.d.mts.map +1 -0
  87. package/internal/builtin-types.d.ts +73 -0
  88. package/internal/builtin-types.d.ts.map +1 -0
  89. package/internal/builtin-types.js +4 -0
  90. package/internal/builtin-types.js.map +1 -0
  91. package/internal/builtin-types.mjs +3 -0
  92. package/internal/builtin-types.mjs.map +1 -0
  93. package/internal/decoders/line.d.mts +17 -0
  94. package/internal/decoders/line.d.mts.map +1 -0
  95. package/internal/decoders/line.d.ts +17 -0
  96. package/internal/decoders/line.d.ts.map +1 -0
  97. package/internal/decoders/line.js +113 -0
  98. package/internal/decoders/line.js.map +1 -0
  99. package/internal/decoders/line.mjs +108 -0
  100. package/internal/decoders/line.mjs.map +1 -0
  101. package/internal/detect-platform.d.mts +15 -0
  102. package/internal/detect-platform.d.mts.map +1 -0
  103. package/internal/detect-platform.d.ts +15 -0
  104. package/internal/detect-platform.d.ts.map +1 -0
  105. package/internal/detect-platform.js +162 -0
  106. package/internal/detect-platform.js.map +1 -0
  107. package/internal/detect-platform.mjs +157 -0
  108. package/internal/detect-platform.mjs.map +1 -0
  109. package/internal/errors.d.mts +3 -0
  110. package/internal/errors.d.mts.map +1 -0
  111. package/internal/errors.d.ts +3 -0
  112. package/internal/errors.d.ts.map +1 -0
  113. package/internal/errors.js +41 -0
  114. package/internal/errors.js.map +1 -0
  115. package/internal/errors.mjs +36 -0
  116. package/internal/errors.mjs.map +1 -0
  117. package/internal/headers.d.mts +20 -0
  118. package/internal/headers.d.mts.map +1 -0
  119. package/internal/headers.d.ts +20 -0
  120. package/internal/headers.d.ts.map +1 -0
  121. package/internal/headers.js +79 -0
  122. package/internal/headers.js.map +1 -0
  123. package/internal/headers.mjs +74 -0
  124. package/internal/headers.mjs.map +1 -0
  125. package/internal/parse.d.mts +12 -0
  126. package/internal/parse.d.mts.map +1 -0
  127. package/internal/parse.d.ts +12 -0
  128. package/internal/parse.d.ts.map +1 -0
  129. package/internal/parse.js +50 -0
  130. package/internal/parse.js.map +1 -0
  131. package/internal/parse.mjs +47 -0
  132. package/internal/parse.mjs.map +1 -0
  133. package/internal/qs/formats.d.mts +7 -0
  134. package/internal/qs/formats.d.mts.map +1 -0
  135. package/internal/qs/formats.d.ts +7 -0
  136. package/internal/qs/formats.d.ts.map +1 -0
  137. package/internal/qs/formats.js +13 -0
  138. package/internal/qs/formats.js.map +1 -0
  139. package/internal/qs/formats.mjs +9 -0
  140. package/internal/qs/formats.mjs.map +1 -0
  141. package/internal/qs/index.d.mts +10 -0
  142. package/internal/qs/index.d.mts.map +1 -0
  143. package/internal/qs/index.d.ts +10 -0
  144. package/internal/qs/index.d.ts.map +1 -0
  145. package/internal/qs/index.js +14 -0
  146. package/internal/qs/index.js.map +1 -0
  147. package/internal/qs/index.mjs +10 -0
  148. package/internal/qs/index.mjs.map +1 -0
  149. package/internal/qs/stringify.d.mts +3 -0
  150. package/internal/qs/stringify.d.mts.map +1 -0
  151. package/internal/qs/stringify.d.ts +3 -0
  152. package/internal/qs/stringify.d.ts.map +1 -0
  153. package/internal/qs/stringify.js +277 -0
  154. package/internal/qs/stringify.js.map +1 -0
  155. package/internal/qs/stringify.mjs +274 -0
  156. package/internal/qs/stringify.mjs.map +1 -0
  157. package/internal/qs/types.d.mts +57 -0
  158. package/internal/qs/types.d.mts.map +1 -0
  159. package/internal/qs/types.d.ts +57 -0
  160. package/internal/qs/types.d.ts.map +1 -0
  161. package/internal/qs/types.js +3 -0
  162. package/internal/qs/types.js.map +1 -0
  163. package/internal/qs/types.mjs +2 -0
  164. package/internal/qs/types.mjs.map +1 -0
  165. package/internal/qs/utils.d.mts +15 -0
  166. package/internal/qs/utils.d.mts.map +1 -0
  167. package/internal/qs/utils.d.ts +15 -0
  168. package/internal/qs/utils.d.ts.map +1 -0
  169. package/internal/qs/utils.js +230 -0
  170. package/internal/qs/utils.js.map +1 -0
  171. package/internal/qs/utils.mjs +217 -0
  172. package/internal/qs/utils.mjs.map +1 -0
  173. package/internal/request-options.d.mts +77 -0
  174. package/internal/request-options.d.mts.map +1 -0
  175. package/internal/request-options.d.ts +77 -0
  176. package/internal/request-options.d.ts.map +1 -0
  177. package/internal/request-options.js +14 -0
  178. package/internal/request-options.js.map +1 -0
  179. package/internal/request-options.mjs +10 -0
  180. package/internal/request-options.mjs.map +1 -0
  181. package/internal/shim-types.d.mts +17 -0
  182. package/internal/shim-types.d.mts.map +1 -0
  183. package/internal/shim-types.d.ts +17 -0
  184. package/internal/shim-types.d.ts.map +1 -0
  185. package/internal/shim-types.js +4 -0
  186. package/internal/shim-types.js.map +1 -0
  187. package/internal/shim-types.mjs +3 -0
  188. package/internal/shim-types.mjs.map +1 -0
  189. package/internal/shims.d.mts +20 -0
  190. package/internal/shims.d.mts.map +1 -0
  191. package/internal/shims.d.ts +20 -0
  192. package/internal/shims.d.ts.map +1 -0
  193. package/internal/shims.js +92 -0
  194. package/internal/shims.js.map +1 -0
  195. package/internal/shims.mjs +85 -0
  196. package/internal/shims.mjs.map +1 -0
  197. package/internal/to-file.d.mts +45 -0
  198. package/internal/to-file.d.mts.map +1 -0
  199. package/internal/to-file.d.ts +45 -0
  200. package/internal/to-file.d.ts.map +1 -0
  201. package/internal/to-file.js +91 -0
  202. package/internal/to-file.js.map +1 -0
  203. package/internal/to-file.mjs +88 -0
  204. package/internal/to-file.mjs.map +1 -0
  205. package/internal/tslib.js +81 -0
  206. package/internal/tslib.mjs +17 -0
  207. package/internal/types.d.mts +69 -0
  208. package/internal/types.d.mts.map +1 -0
  209. package/internal/types.d.ts +69 -0
  210. package/internal/types.d.ts.map +1 -0
  211. package/internal/types.js +4 -0
  212. package/internal/types.js.map +1 -0
  213. package/internal/types.mjs +3 -0
  214. package/internal/types.mjs.map +1 -0
  215. package/internal/uploads.d.mts +42 -0
  216. package/internal/uploads.d.mts.map +1 -0
  217. package/internal/uploads.d.ts +42 -0
  218. package/internal/uploads.d.ts.map +1 -0
  219. package/internal/uploads.js +141 -0
  220. package/internal/uploads.js.map +1 -0
  221. package/internal/uploads.mjs +131 -0
  222. package/internal/uploads.mjs.map +1 -0
  223. package/internal/utils/base64.d.mts +3 -0
  224. package/internal/utils/base64.d.mts.map +1 -0
  225. package/internal/utils/base64.d.ts +3 -0
  226. package/internal/utils/base64.d.ts.map +1 -0
  227. package/internal/utils/base64.js +38 -0
  228. package/internal/utils/base64.js.map +1 -0
  229. package/internal/utils/base64.mjs +33 -0
  230. package/internal/utils/base64.mjs.map +1 -0
  231. package/internal/utils/bytes.d.mts +4 -0
  232. package/internal/utils/bytes.d.mts.map +1 -0
  233. package/internal/utils/bytes.d.ts +4 -0
  234. package/internal/utils/bytes.d.ts.map +1 -0
  235. package/internal/utils/bytes.js +31 -0
  236. package/internal/utils/bytes.js.map +1 -0
  237. package/internal/utils/bytes.mjs +26 -0
  238. package/internal/utils/bytes.mjs.map +1 -0
  239. package/internal/utils/env.d.mts +9 -0
  240. package/internal/utils/env.d.mts.map +1 -0
  241. package/internal/utils/env.d.ts +9 -0
  242. package/internal/utils/env.d.ts.map +1 -0
  243. package/internal/utils/env.js +22 -0
  244. package/internal/utils/env.js.map +1 -0
  245. package/internal/utils/env.mjs +18 -0
  246. package/internal/utils/env.mjs.map +1 -0
  247. package/internal/utils/log.d.mts +37 -0
  248. package/internal/utils/log.d.mts.map +1 -0
  249. package/internal/utils/log.d.ts +37 -0
  250. package/internal/utils/log.d.ts.map +1 -0
  251. package/internal/utils/log.js +85 -0
  252. package/internal/utils/log.js.map +1 -0
  253. package/internal/utils/log.mjs +79 -0
  254. package/internal/utils/log.mjs.map +1 -0
  255. package/internal/utils/path.d.mts +15 -0
  256. package/internal/utils/path.d.mts.map +1 -0
  257. package/internal/utils/path.d.ts +15 -0
  258. package/internal/utils/path.d.ts.map +1 -0
  259. package/internal/utils/path.js +79 -0
  260. package/internal/utils/path.js.map +1 -0
  261. package/internal/utils/path.mjs +74 -0
  262. package/internal/utils/path.mjs.map +1 -0
  263. package/internal/utils/sleep.d.mts +2 -0
  264. package/internal/utils/sleep.d.mts.map +1 -0
  265. package/internal/utils/sleep.d.ts +2 -0
  266. package/internal/utils/sleep.d.ts.map +1 -0
  267. package/internal/utils/sleep.js +7 -0
  268. package/internal/utils/sleep.js.map +1 -0
  269. package/internal/utils/sleep.mjs +3 -0
  270. package/internal/utils/sleep.mjs.map +1 -0
  271. package/internal/utils/uuid.d.mts +5 -0
  272. package/internal/utils/uuid.d.mts.map +1 -0
  273. package/internal/utils/uuid.d.ts +5 -0
  274. package/internal/utils/uuid.d.ts.map +1 -0
  275. package/internal/utils/uuid.js +19 -0
  276. package/internal/utils/uuid.js.map +1 -0
  277. package/internal/utils/uuid.mjs +15 -0
  278. package/internal/utils/uuid.mjs.map +1 -0
  279. package/internal/utils/values.d.mts +18 -0
  280. package/internal/utils/values.d.mts.map +1 -0
  281. package/internal/utils/values.d.ts +18 -0
  282. package/internal/utils/values.d.ts.map +1 -0
  283. package/internal/utils/values.js +112 -0
  284. package/internal/utils/values.js.map +1 -0
  285. package/internal/utils/values.mjs +94 -0
  286. package/internal/utils/values.mjs.map +1 -0
  287. package/internal/utils.d.mts +7 -0
  288. package/internal/utils.d.mts.map +1 -0
  289. package/internal/utils.d.ts +7 -0
  290. package/internal/utils.d.ts.map +1 -0
  291. package/internal/utils.js +11 -0
  292. package/internal/utils.js.map +1 -0
  293. package/internal/utils.mjs +8 -0
  294. package/internal/utils.mjs.map +1 -0
  295. package/package.json +161 -0
  296. package/pagination.d.mts +2 -0
  297. package/pagination.d.mts.map +1 -0
  298. package/pagination.d.ts +2 -0
  299. package/pagination.d.ts.map +1 -0
  300. package/pagination.js +6 -0
  301. package/pagination.js.map +1 -0
  302. package/pagination.mjs +2 -0
  303. package/pagination.mjs.map +1 -0
  304. package/resource.d.mts +2 -0
  305. package/resource.d.mts.map +1 -0
  306. package/resource.d.ts +2 -0
  307. package/resource.d.ts.map +1 -0
  308. package/resource.js +6 -0
  309. package/resource.js.map +1 -0
  310. package/resource.mjs +2 -0
  311. package/resource.mjs.map +1 -0
  312. package/resources/audio/audio.d.mts +28 -0
  313. package/resources/audio/audio.d.mts.map +1 -0
  314. package/resources/audio/audio.d.ts +28 -0
  315. package/resources/audio/audio.d.ts.map +1 -0
  316. package/resources/audio/audio.js +25 -0
  317. package/resources/audio/audio.js.map +1 -0
  318. package/resources/audio/audio.mjs +20 -0
  319. package/resources/audio/audio.mjs.map +1 -0
  320. package/resources/audio/index.d.mts +5 -0
  321. package/resources/audio/index.d.mts.map +1 -0
  322. package/resources/audio/index.d.ts +5 -0
  323. package/resources/audio/index.d.ts.map +1 -0
  324. package/resources/audio/index.js +13 -0
  325. package/resources/audio/index.js.map +1 -0
  326. package/resources/audio/index.mjs +6 -0
  327. package/resources/audio/index.mjs.map +1 -0
  328. package/resources/audio/speech.d.mts +67 -0
  329. package/resources/audio/speech.d.mts.map +1 -0
  330. package/resources/audio/speech.d.ts +67 -0
  331. package/resources/audio/speech.d.ts.map +1 -0
  332. package/resources/audio/speech.js +35 -0
  333. package/resources/audio/speech.js.map +1 -0
  334. package/resources/audio/speech.mjs +31 -0
  335. package/resources/audio/speech.mjs.map +1 -0
  336. package/resources/audio/transcriptions.d.mts +656 -0
  337. package/resources/audio/transcriptions.d.mts.map +1 -0
  338. package/resources/audio/transcriptions.d.ts +656 -0
  339. package/resources/audio/transcriptions.d.ts.map +1 -0
  340. package/resources/audio/transcriptions.js +13 -0
  341. package/resources/audio/transcriptions.js.map +1 -0
  342. package/resources/audio/transcriptions.mjs +9 -0
  343. package/resources/audio/transcriptions.mjs.map +1 -0
  344. package/resources/audio/translations.d.mts +78 -0
  345. package/resources/audio/translations.d.mts.map +1 -0
  346. package/resources/audio/translations.d.ts +78 -0
  347. package/resources/audio/translations.d.ts.map +1 -0
  348. package/resources/audio/translations.js +24 -0
  349. package/resources/audio/translations.js.map +1 -0
  350. package/resources/audio/translations.mjs +20 -0
  351. package/resources/audio/translations.mjs.map +1 -0
  352. package/resources/audio.d.mts +2 -0
  353. package/resources/audio.d.mts.map +1 -0
  354. package/resources/audio.d.ts +2 -0
  355. package/resources/audio.d.ts.map +1 -0
  356. package/resources/audio.js +6 -0
  357. package/resources/audio.js.map +1 -0
  358. package/resources/audio.mjs +3 -0
  359. package/resources/audio.mjs.map +1 -0
  360. package/resources/batches.d.mts +280 -0
  361. package/resources/batches.d.mts.map +1 -0
  362. package/resources/batches.d.ts +280 -0
  363. package/resources/batches.d.ts.map +1 -0
  364. package/resources/batches.js +37 -0
  365. package/resources/batches.js.map +1 -0
  366. package/resources/batches.mjs +33 -0
  367. package/resources/batches.mjs.map +1 -0
  368. package/resources/beta/assistants.d.mts +1221 -0
  369. package/resources/beta/assistants.d.mts.map +1 -0
  370. package/resources/beta/assistants.d.ts +1221 -0
  371. package/resources/beta/assistants.d.ts.map +1 -0
  372. package/resources/beta/assistants.js +70 -0
  373. package/resources/beta/assistants.js.map +1 -0
  374. package/resources/beta/assistants.mjs +66 -0
  375. package/resources/beta/assistants.mjs.map +1 -0
  376. package/resources/beta/beta.d.mts +18 -0
  377. package/resources/beta/beta.d.mts.map +1 -0
  378. package/resources/beta/beta.d.ts +18 -0
  379. package/resources/beta/beta.d.ts.map +1 -0
  380. package/resources/beta/beta.js +25 -0
  381. package/resources/beta/beta.js.map +1 -0
  382. package/resources/beta/beta.mjs +20 -0
  383. package/resources/beta/beta.mjs.map +1 -0
  384. package/resources/beta/chatkit/chatkit.d.mts +51 -0
  385. package/resources/beta/chatkit/chatkit.d.mts.map +1 -0
  386. package/resources/beta/chatkit/chatkit.d.ts +51 -0
  387. package/resources/beta/chatkit/chatkit.d.ts.map +1 -0
  388. package/resources/beta/chatkit/chatkit.js +21 -0
  389. package/resources/beta/chatkit/chatkit.js.map +1 -0
  390. package/resources/beta/chatkit/chatkit.mjs +16 -0
  391. package/resources/beta/chatkit/chatkit.mjs.map +1 -0
  392. package/resources/beta/chatkit/index.d.mts +4 -0
  393. package/resources/beta/chatkit/index.d.mts.map +1 -0
  394. package/resources/beta/chatkit/index.d.ts +4 -0
  395. package/resources/beta/chatkit/index.d.ts.map +1 -0
  396. package/resources/beta/chatkit/index.js +11 -0
  397. package/resources/beta/chatkit/index.js.map +1 -0
  398. package/resources/beta/chatkit/index.mjs +5 -0
  399. package/resources/beta/chatkit/index.mjs.map +1 -0
  400. package/resources/beta/chatkit/sessions.d.mts +59 -0
  401. package/resources/beta/chatkit/sessions.d.mts.map +1 -0
  402. package/resources/beta/chatkit/sessions.d.ts +59 -0
  403. package/resources/beta/chatkit/sessions.d.ts.map +1 -0
  404. package/resources/beta/chatkit/sessions.js +47 -0
  405. package/resources/beta/chatkit/sessions.js.map +1 -0
  406. package/resources/beta/chatkit/sessions.mjs +43 -0
  407. package/resources/beta/chatkit/sessions.mjs.map +1 -0
  408. package/resources/beta/chatkit/threads.d.mts +811 -0
  409. package/resources/beta/chatkit/threads.d.mts.map +1 -0
  410. package/resources/beta/chatkit/threads.d.ts +811 -0
  411. package/resources/beta/chatkit/threads.d.ts.map +1 -0
  412. package/resources/beta/chatkit/threads.js +77 -0
  413. package/resources/beta/chatkit/threads.js.map +1 -0
  414. package/resources/beta/chatkit/threads.mjs +73 -0
  415. package/resources/beta/chatkit/threads.mjs.map +1 -0
  416. package/resources/beta/chatkit.d.mts +2 -0
  417. package/resources/beta/chatkit.d.mts.map +1 -0
  418. package/resources/beta/chatkit.d.ts +2 -0
  419. package/resources/beta/chatkit.d.ts.map +1 -0
  420. package/resources/beta/chatkit.js +6 -0
  421. package/resources/beta/chatkit.js.map +1 -0
  422. package/resources/beta/chatkit.mjs +3 -0
  423. package/resources/beta/chatkit.mjs.map +1 -0
  424. package/resources/beta/index.d.mts +5 -0
  425. package/resources/beta/index.d.mts.map +1 -0
  426. package/resources/beta/index.d.ts +5 -0
  427. package/resources/beta/index.d.ts.map +1 -0
  428. package/resources/beta/index.js +13 -0
  429. package/resources/beta/index.js.map +1 -0
  430. package/resources/beta/index.mjs +6 -0
  431. package/resources/beta/index.mjs.map +1 -0
  432. package/resources/beta/threads/index.d.mts +4 -0
  433. package/resources/beta/threads/index.d.mts.map +1 -0
  434. package/resources/beta/threads/index.d.ts +4 -0
  435. package/resources/beta/threads/index.d.ts.map +1 -0
  436. package/resources/beta/threads/index.js +11 -0
  437. package/resources/beta/threads/index.js.map +1 -0
  438. package/resources/beta/threads/index.mjs +5 -0
  439. package/resources/beta/threads/index.mjs.map +1 -0
  440. package/resources/beta/threads/messages.d.mts +594 -0
  441. package/resources/beta/threads/messages.d.mts.map +1 -0
  442. package/resources/beta/threads/messages.d.ts +594 -0
  443. package/resources/beta/threads/messages.d.ts.map +1 -0
  444. package/resources/beta/threads/messages.js +76 -0
  445. package/resources/beta/threads/messages.js.map +1 -0
  446. package/resources/beta/threads/messages.mjs +72 -0
  447. package/resources/beta/threads/messages.mjs.map +1 -0
  448. package/resources/beta/threads/runs/index.d.mts +3 -0
  449. package/resources/beta/threads/runs/index.d.mts.map +1 -0
  450. package/resources/beta/threads/runs/index.d.ts +3 -0
  451. package/resources/beta/threads/runs/index.d.ts.map +1 -0
  452. package/resources/beta/threads/runs/index.js +9 -0
  453. package/resources/beta/threads/runs/index.js.map +1 -0
  454. package/resources/beta/threads/runs/index.mjs +4 -0
  455. package/resources/beta/threads/runs/index.mjs.map +1 -0
  456. package/resources/beta/threads/runs/runs.d.mts +694 -0
  457. package/resources/beta/threads/runs/runs.d.mts.map +1 -0
  458. package/resources/beta/threads/runs/runs.d.ts +694 -0
  459. package/resources/beta/threads/runs/runs.d.ts.map +1 -0
  460. package/resources/beta/threads/runs/runs.js +91 -0
  461. package/resources/beta/threads/runs/runs.js.map +1 -0
  462. package/resources/beta/threads/runs/runs.mjs +86 -0
  463. package/resources/beta/threads/runs/runs.mjs.map +1 -0
  464. package/resources/beta/threads/runs/steps.d.mts +615 -0
  465. package/resources/beta/threads/runs/steps.d.mts.map +1 -0
  466. package/resources/beta/threads/runs/steps.d.ts +615 -0
  467. package/resources/beta/threads/runs/steps.d.ts.map +1 -0
  468. package/resources/beta/threads/runs/steps.js +41 -0
  469. package/resources/beta/threads/runs/steps.js.map +1 -0
  470. package/resources/beta/threads/runs/steps.mjs +37 -0
  471. package/resources/beta/threads/runs/steps.mjs.map +1 -0
  472. package/resources/beta/threads/runs.d.mts +2 -0
  473. package/resources/beta/threads/runs.d.mts.map +1 -0
  474. package/resources/beta/threads/runs.d.ts +2 -0
  475. package/resources/beta/threads/runs.d.ts.map +1 -0
  476. package/resources/beta/threads/runs.js +6 -0
  477. package/resources/beta/threads/runs.js.map +1 -0
  478. package/resources/beta/threads/runs.mjs +3 -0
  479. package/resources/beta/threads/runs.mjs.map +1 -0
  480. package/resources/beta/threads/threads.d.mts +757 -0
  481. package/resources/beta/threads/threads.d.mts.map +1 -0
  482. package/resources/beta/threads/threads.d.ts +757 -0
  483. package/resources/beta/threads/threads.d.ts.map +1 -0
  484. package/resources/beta/threads/threads.js +80 -0
  485. package/resources/beta/threads/threads.js.map +1 -0
  486. package/resources/beta/threads/threads.mjs +75 -0
  487. package/resources/beta/threads/threads.mjs.map +1 -0
  488. package/resources/beta/threads.d.mts +2 -0
  489. package/resources/beta/threads.d.mts.map +1 -0
  490. package/resources/beta/threads.d.ts +2 -0
  491. package/resources/beta/threads.d.ts.map +1 -0
  492. package/resources/beta/threads.js +6 -0
  493. package/resources/beta/threads.js.map +1 -0
  494. package/resources/beta/threads.mjs +3 -0
  495. package/resources/beta/threads.mjs.map +1 -0
  496. package/resources/beta.d.mts +2 -0
  497. package/resources/beta.d.mts.map +1 -0
  498. package/resources/beta.d.ts +2 -0
  499. package/resources/beta.d.ts.map +1 -0
  500. package/resources/beta.js +6 -0
  501. package/resources/beta.js.map +1 -0
  502. package/resources/beta.mjs +3 -0
  503. package/resources/beta.mjs.map +1 -0
  504. package/resources/chat/chat.d.mts +13 -0
  505. package/resources/chat/chat.d.mts.map +1 -0
  506. package/resources/chat/chat.d.ts +13 -0
  507. package/resources/chat/chat.d.ts.map +1 -0
  508. package/resources/chat/chat.js +17 -0
  509. package/resources/chat/chat.js.map +1 -0
  510. package/resources/chat/chat.mjs +12 -0
  511. package/resources/chat/chat.mjs.map +1 -0
  512. package/resources/chat/completions/completions.d.mts +1598 -0
  513. package/resources/chat/completions/completions.d.mts.map +1 -0
  514. package/resources/chat/completions/completions.d.ts +1598 -0
  515. package/resources/chat/completions/completions.d.ts.map +1 -0
  516. package/resources/chat/completions/completions.js +79 -0
  517. package/resources/chat/completions/completions.js.map +1 -0
  518. package/resources/chat/completions/completions.mjs +74 -0
  519. package/resources/chat/completions/completions.mjs.map +1 -0
  520. package/resources/chat/completions/index.d.mts +3 -0
  521. package/resources/chat/completions/index.d.mts.map +1 -0
  522. package/resources/chat/completions/index.d.ts +3 -0
  523. package/resources/chat/completions/index.d.ts.map +1 -0
  524. package/resources/chat/completions/index.js +9 -0
  525. package/resources/chat/completions/index.js.map +1 -0
  526. package/resources/chat/completions/index.mjs +4 -0
  527. package/resources/chat/completions/index.mjs.map +1 -0
  528. package/resources/chat/completions/messages.d.mts +34 -0
  529. package/resources/chat/completions/messages.d.mts.map +1 -0
  530. package/resources/chat/completions/messages.d.ts +34 -0
  531. package/resources/chat/completions/messages.d.ts.map +1 -0
  532. package/resources/chat/completions/messages.js +28 -0
  533. package/resources/chat/completions/messages.js.map +1 -0
  534. package/resources/chat/completions/messages.mjs +24 -0
  535. package/resources/chat/completions/messages.mjs.map +1 -0
  536. package/resources/chat/completions.d.mts +2 -0
  537. package/resources/chat/completions.d.mts.map +1 -0
  538. package/resources/chat/completions.d.ts +2 -0
  539. package/resources/chat/completions.d.ts.map +1 -0
  540. package/resources/chat/completions.js +6 -0
  541. package/resources/chat/completions.js.map +1 -0
  542. package/resources/chat/completions.mjs +3 -0
  543. package/resources/chat/completions.mjs.map +1 -0
  544. package/resources/chat/index.d.mts +3 -0
  545. package/resources/chat/index.d.mts.map +1 -0
  546. package/resources/chat/index.d.ts +3 -0
  547. package/resources/chat/index.d.ts.map +1 -0
  548. package/resources/chat/index.js +9 -0
  549. package/resources/chat/index.js.map +1 -0
  550. package/resources/chat/index.mjs +4 -0
  551. package/resources/chat/index.mjs.map +1 -0
  552. package/resources/chat.d.mts +2 -0
  553. package/resources/chat.d.mts.map +1 -0
  554. package/resources/chat.d.ts +2 -0
  555. package/resources/chat.d.ts.map +1 -0
  556. package/resources/chat.js +6 -0
  557. package/resources/chat.js.map +1 -0
  558. package/resources/chat.mjs +3 -0
  559. package/resources/chat.mjs.map +1 -0
  560. package/resources/completions.d.mts +332 -0
  561. package/resources/completions.d.mts.map +1 -0
  562. package/resources/completions.d.ts +332 -0
  563. package/resources/completions.d.ts.map +1 -0
  564. package/resources/completions.js +12 -0
  565. package/resources/completions.js.map +1 -0
  566. package/resources/completions.mjs +8 -0
  567. package/resources/completions.mjs.map +1 -0
  568. package/resources/containers/containers.d.mts +292 -0
  569. package/resources/containers/containers.d.mts.map +1 -0
  570. package/resources/containers/containers.d.ts +292 -0
  571. package/resources/containers/containers.d.ts.map +1 -0
  572. package/resources/containers/containers.js +47 -0
  573. package/resources/containers/containers.js.map +1 -0
  574. package/resources/containers/containers.mjs +42 -0
  575. package/resources/containers/containers.mjs.map +1 -0
  576. package/resources/containers/files/content.d.mts +16 -0
  577. package/resources/containers/files/content.d.mts.map +1 -0
  578. package/resources/containers/files/content.d.ts +16 -0
  579. package/resources/containers/files/content.d.ts.map +1 -0
  580. package/resources/containers/files/content.js +22 -0
  581. package/resources/containers/files/content.js.map +1 -0
  582. package/resources/containers/files/content.mjs +18 -0
  583. package/resources/containers/files/content.mjs.map +1 -0
  584. package/resources/containers/files/files.d.mts +148 -0
  585. package/resources/containers/files/files.d.mts.map +1 -0
  586. package/resources/containers/files/files.d.ts +148 -0
  587. package/resources/containers/files/files.d.ts.map +1 -0
  588. package/resources/containers/files/files.js +56 -0
  589. package/resources/containers/files/files.js.map +1 -0
  590. package/resources/containers/files/files.mjs +51 -0
  591. package/resources/containers/files/files.mjs.map +1 -0
  592. package/resources/containers/files/index.d.mts +3 -0
  593. package/resources/containers/files/index.d.mts.map +1 -0
  594. package/resources/containers/files/index.d.ts +3 -0
  595. package/resources/containers/files/index.d.ts.map +1 -0
  596. package/resources/containers/files/index.js +9 -0
  597. package/resources/containers/files/index.js.map +1 -0
  598. package/resources/containers/files/index.mjs +4 -0
  599. package/resources/containers/files/index.mjs.map +1 -0
  600. package/resources/containers/files.d.mts +2 -0
  601. package/resources/containers/files.d.mts.map +1 -0
  602. package/resources/containers/files.d.ts +2 -0
  603. package/resources/containers/files.d.ts.map +1 -0
  604. package/resources/containers/files.js +6 -0
  605. package/resources/containers/files.js.map +1 -0
  606. package/resources/containers/files.mjs +3 -0
  607. package/resources/containers/files.mjs.map +1 -0
  608. package/resources/containers/index.d.mts +3 -0
  609. package/resources/containers/index.d.mts.map +1 -0
  610. package/resources/containers/index.d.ts +3 -0
  611. package/resources/containers/index.d.ts.map +1 -0
  612. package/resources/containers/index.js +9 -0
  613. package/resources/containers/index.js.map +1 -0
  614. package/resources/containers/index.mjs +4 -0
  615. package/resources/containers/index.mjs.map +1 -0
  616. package/resources/containers.d.mts +2 -0
  617. package/resources/containers.d.mts.map +1 -0
  618. package/resources/containers.d.ts +2 -0
  619. package/resources/containers.d.ts.map +1 -0
  620. package/resources/containers.js +6 -0
  621. package/resources/containers.js.map +1 -0
  622. package/resources/containers.mjs +3 -0
  623. package/resources/containers.mjs.map +1 -0
  624. package/resources/conversations/conversations.d.mts +176 -0
  625. package/resources/conversations/conversations.d.mts.map +1 -0
  626. package/resources/conversations/conversations.d.ts +176 -0
  627. package/resources/conversations/conversations.d.ts.map +1 -0
  628. package/resources/conversations/conversations.js +42 -0
  629. package/resources/conversations/conversations.js.map +1 -0
  630. package/resources/conversations/conversations.mjs +37 -0
  631. package/resources/conversations/conversations.mjs.map +1 -0
  632. package/resources/conversations/index.d.mts +3 -0
  633. package/resources/conversations/index.d.mts.map +1 -0
  634. package/resources/conversations/index.d.ts +3 -0
  635. package/resources/conversations/index.d.ts.map +1 -0
  636. package/resources/conversations/index.js +9 -0
  637. package/resources/conversations/index.js.map +1 -0
  638. package/resources/conversations/index.mjs +4 -0
  639. package/resources/conversations/index.mjs.map +1 -0
  640. package/resources/conversations/items.d.mts +367 -0
  641. package/resources/conversations/items.d.mts.map +1 -0
  642. package/resources/conversations/items.d.ts +367 -0
  643. package/resources/conversations/items.d.ts.map +1 -0
  644. package/resources/conversations/items.js +42 -0
  645. package/resources/conversations/items.js.map +1 -0
  646. package/resources/conversations/items.mjs +38 -0
  647. package/resources/conversations/items.mjs.map +1 -0
  648. package/resources/conversations.d.mts +2 -0
  649. package/resources/conversations.d.mts.map +1 -0
  650. package/resources/conversations.d.ts +2 -0
  651. package/resources/conversations.d.ts.map +1 -0
  652. package/resources/conversations.js +6 -0
  653. package/resources/conversations.js.map +1 -0
  654. package/resources/conversations.mjs +3 -0
  655. package/resources/conversations.mjs.map +1 -0
  656. package/resources/embeddings.d.mts +113 -0
  657. package/resources/embeddings.d.mts.map +1 -0
  658. package/resources/embeddings.d.ts +113 -0
  659. package/resources/embeddings.d.ts.map +1 -0
  660. package/resources/embeddings.js +24 -0
  661. package/resources/embeddings.js.map +1 -0
  662. package/resources/embeddings.mjs +20 -0
  663. package/resources/embeddings.mjs.map +1 -0
  664. package/resources/evals/evals.d.mts +736 -0
  665. package/resources/evals/evals.d.mts.map +1 -0
  666. package/resources/evals/evals.d.ts +736 -0
  667. package/resources/evals/evals.d.ts.map +1 -0
  668. package/resources/evals/evals.js +54 -0
  669. package/resources/evals/evals.js.map +1 -0
  670. package/resources/evals/evals.mjs +49 -0
  671. package/resources/evals/evals.mjs.map +1 -0
  672. package/resources/evals/index.d.mts +3 -0
  673. package/resources/evals/index.d.mts.map +1 -0
  674. package/resources/evals/index.d.ts +3 -0
  675. package/resources/evals/index.d.ts.map +1 -0
  676. package/resources/evals/index.js +9 -0
  677. package/resources/evals/index.js.map +1 -0
  678. package/resources/evals/index.mjs +4 -0
  679. package/resources/evals/index.mjs.map +1 -0
  680. package/resources/evals/runs/index.d.mts +3 -0
  681. package/resources/evals/runs/index.d.mts.map +1 -0
  682. package/resources/evals/runs/index.d.ts +3 -0
  683. package/resources/evals/runs/index.d.ts.map +1 -0
  684. package/resources/evals/runs/index.js +9 -0
  685. package/resources/evals/runs/index.js.map +1 -0
  686. package/resources/evals/runs/index.mjs +4 -0
  687. package/resources/evals/runs/index.mjs.map +1 -0
  688. package/resources/evals/runs/output-items.d.mts +382 -0
  689. package/resources/evals/runs/output-items.d.mts.map +1 -0
  690. package/resources/evals/runs/output-items.d.ts +382 -0
  691. package/resources/evals/runs/output-items.d.ts.map +1 -0
  692. package/resources/evals/runs/output-items.js +25 -0
  693. package/resources/evals/runs/output-items.js.map +1 -0
  694. package/resources/evals/runs/output-items.mjs +21 -0
  695. package/resources/evals/runs/output-items.mjs.map +1 -0
  696. package/resources/evals/runs/runs.d.mts +2385 -0
  697. package/resources/evals/runs/runs.d.mts.map +1 -0
  698. package/resources/evals/runs/runs.d.ts +2385 -0
  699. package/resources/evals/runs/runs.d.ts.map +1 -0
  700. package/resources/evals/runs/runs.js +57 -0
  701. package/resources/evals/runs/runs.js.map +1 -0
  702. package/resources/evals/runs/runs.mjs +52 -0
  703. package/resources/evals/runs/runs.mjs.map +1 -0
  704. package/resources/evals/runs.d.mts +2 -0
  705. package/resources/evals/runs.d.mts.map +1 -0
  706. package/resources/evals/runs.d.ts +2 -0
  707. package/resources/evals/runs.d.ts.map +1 -0
  708. package/resources/evals/runs.js +6 -0
  709. package/resources/evals/runs.js.map +1 -0
  710. package/resources/evals/runs.mjs +3 -0
  711. package/resources/evals/runs.mjs.map +1 -0
  712. package/resources/evals.d.mts +2 -0
  713. package/resources/evals.d.mts.map +1 -0
  714. package/resources/evals.d.ts +2 -0
  715. package/resources/evals.d.ts.map +1 -0
  716. package/resources/evals.js +6 -0
  717. package/resources/evals.js.map +1 -0
  718. package/resources/evals.mjs +3 -0
  719. package/resources/evals.mjs.map +1 -0
  720. package/resources/files.d.mts +164 -0
  721. package/resources/files.d.mts.map +1 -0
  722. package/resources/files.d.ts +164 -0
  723. package/resources/files.d.ts.map +1 -0
  724. package/resources/files.js +66 -0
  725. package/resources/files.js.map +1 -0
  726. package/resources/files.mjs +62 -0
  727. package/resources/files.mjs.map +1 -0
  728. package/resources/fine-tuning/alpha/alpha.d.mts +10 -0
  729. package/resources/fine-tuning/alpha/alpha.d.mts.map +1 -0
  730. package/resources/fine-tuning/alpha/alpha.d.ts +10 -0
  731. package/resources/fine-tuning/alpha/alpha.d.ts.map +1 -0
  732. package/resources/fine-tuning/alpha/alpha.js +17 -0
  733. package/resources/fine-tuning/alpha/alpha.js.map +1 -0
  734. package/resources/fine-tuning/alpha/alpha.mjs +12 -0
  735. package/resources/fine-tuning/alpha/alpha.mjs.map +1 -0
  736. package/resources/fine-tuning/alpha/graders.d.mts +119 -0
  737. package/resources/fine-tuning/alpha/graders.d.mts.map +1 -0
  738. package/resources/fine-tuning/alpha/graders.d.ts +119 -0
  739. package/resources/fine-tuning/alpha/graders.d.ts.map +1 -0
  740. package/resources/fine-tuning/alpha/graders.js +49 -0
  741. package/resources/fine-tuning/alpha/graders.js.map +1 -0
  742. package/resources/fine-tuning/alpha/graders.mjs +45 -0
  743. package/resources/fine-tuning/alpha/graders.mjs.map +1 -0
  744. package/resources/fine-tuning/alpha/index.d.mts +3 -0
  745. package/resources/fine-tuning/alpha/index.d.mts.map +1 -0
  746. package/resources/fine-tuning/alpha/index.d.ts +3 -0
  747. package/resources/fine-tuning/alpha/index.d.ts.map +1 -0
  748. package/resources/fine-tuning/alpha/index.js +9 -0
  749. package/resources/fine-tuning/alpha/index.js.map +1 -0
  750. package/resources/fine-tuning/alpha/index.mjs +4 -0
  751. package/resources/fine-tuning/alpha/index.mjs.map +1 -0
  752. package/resources/fine-tuning/alpha.d.mts +2 -0
  753. package/resources/fine-tuning/alpha.d.mts.map +1 -0
  754. package/resources/fine-tuning/alpha.d.ts +2 -0
  755. package/resources/fine-tuning/alpha.d.ts.map +1 -0
  756. package/resources/fine-tuning/alpha.js +6 -0
  757. package/resources/fine-tuning/alpha.js.map +1 -0
  758. package/resources/fine-tuning/alpha.mjs +3 -0
  759. package/resources/fine-tuning/alpha.mjs.map +1 -0
  760. package/resources/fine-tuning/checkpoints/checkpoints.d.mts +10 -0
  761. package/resources/fine-tuning/checkpoints/checkpoints.d.mts.map +1 -0
  762. package/resources/fine-tuning/checkpoints/checkpoints.d.ts +10 -0
  763. package/resources/fine-tuning/checkpoints/checkpoints.d.ts.map +1 -0
  764. package/resources/fine-tuning/checkpoints/checkpoints.js +17 -0
  765. package/resources/fine-tuning/checkpoints/checkpoints.js.map +1 -0
  766. package/resources/fine-tuning/checkpoints/checkpoints.mjs +12 -0
  767. package/resources/fine-tuning/checkpoints/checkpoints.mjs.map +1 -0
  768. package/resources/fine-tuning/checkpoints/index.d.mts +3 -0
  769. package/resources/fine-tuning/checkpoints/index.d.mts.map +1 -0
  770. package/resources/fine-tuning/checkpoints/index.d.ts +3 -0
  771. package/resources/fine-tuning/checkpoints/index.d.ts.map +1 -0
  772. package/resources/fine-tuning/checkpoints/index.js +9 -0
  773. package/resources/fine-tuning/checkpoints/index.js.map +1 -0
  774. package/resources/fine-tuning/checkpoints/index.mjs +4 -0
  775. package/resources/fine-tuning/checkpoints/index.mjs.map +1 -0
  776. package/resources/fine-tuning/checkpoints/permissions.d.mts +160 -0
  777. package/resources/fine-tuning/checkpoints/permissions.d.mts.map +1 -0
  778. package/resources/fine-tuning/checkpoints/permissions.d.ts +160 -0
  779. package/resources/fine-tuning/checkpoints/permissions.d.ts.map +1 -0
  780. package/resources/fine-tuning/checkpoints/permissions.js +73 -0
  781. package/resources/fine-tuning/checkpoints/permissions.js.map +1 -0
  782. package/resources/fine-tuning/checkpoints/permissions.mjs +69 -0
  783. package/resources/fine-tuning/checkpoints/permissions.mjs.map +1 -0
  784. package/resources/fine-tuning/checkpoints.d.mts +2 -0
  785. package/resources/fine-tuning/checkpoints.d.mts.map +1 -0
  786. package/resources/fine-tuning/checkpoints.d.ts +2 -0
  787. package/resources/fine-tuning/checkpoints.d.ts.map +1 -0
  788. package/resources/fine-tuning/checkpoints.js +6 -0
  789. package/resources/fine-tuning/checkpoints.js.map +1 -0
  790. package/resources/fine-tuning/checkpoints.mjs +3 -0
  791. package/resources/fine-tuning/checkpoints.mjs.map +1 -0
  792. package/resources/fine-tuning/fine-tuning.d.mts +22 -0
  793. package/resources/fine-tuning/fine-tuning.d.mts.map +1 -0
  794. package/resources/fine-tuning/fine-tuning.d.ts +22 -0
  795. package/resources/fine-tuning/fine-tuning.d.ts.map +1 -0
  796. package/resources/fine-tuning/fine-tuning.js +29 -0
  797. package/resources/fine-tuning/fine-tuning.js.map +1 -0
  798. package/resources/fine-tuning/fine-tuning.mjs +24 -0
  799. package/resources/fine-tuning/fine-tuning.mjs.map +1 -0
  800. package/resources/fine-tuning/index.d.mts +6 -0
  801. package/resources/fine-tuning/index.d.mts.map +1 -0
  802. package/resources/fine-tuning/index.d.ts +6 -0
  803. package/resources/fine-tuning/index.d.ts.map +1 -0
  804. package/resources/fine-tuning/index.js +15 -0
  805. package/resources/fine-tuning/index.js.map +1 -0
  806. package/resources/fine-tuning/index.mjs +7 -0
  807. package/resources/fine-tuning/index.mjs.map +1 -0
  808. package/resources/fine-tuning/jobs/checkpoints.d.mts +74 -0
  809. package/resources/fine-tuning/jobs/checkpoints.d.mts.map +1 -0
  810. package/resources/fine-tuning/jobs/checkpoints.d.ts +74 -0
  811. package/resources/fine-tuning/jobs/checkpoints.d.ts.map +1 -0
  812. package/resources/fine-tuning/jobs/checkpoints.js +27 -0
  813. package/resources/fine-tuning/jobs/checkpoints.js.map +1 -0
  814. package/resources/fine-tuning/jobs/checkpoints.mjs +23 -0
  815. package/resources/fine-tuning/jobs/checkpoints.mjs.map +1 -0
  816. package/resources/fine-tuning/jobs/index.d.mts +3 -0
  817. package/resources/fine-tuning/jobs/index.d.mts.map +1 -0
  818. package/resources/fine-tuning/jobs/index.d.ts +3 -0
  819. package/resources/fine-tuning/jobs/index.d.ts.map +1 -0
  820. package/resources/fine-tuning/jobs/index.js +9 -0
  821. package/resources/fine-tuning/jobs/index.js.map +1 -0
  822. package/resources/fine-tuning/jobs/index.mjs +4 -0
  823. package/resources/fine-tuning/jobs/index.mjs.map +1 -0
  824. package/resources/fine-tuning/jobs/jobs.d.mts +528 -0
  825. package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -0
  826. package/resources/fine-tuning/jobs/jobs.d.ts +528 -0
  827. package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -0
  828. package/resources/fine-tuning/jobs/jobs.js +123 -0
  829. package/resources/fine-tuning/jobs/jobs.js.map +1 -0
  830. package/resources/fine-tuning/jobs/jobs.mjs +118 -0
  831. package/resources/fine-tuning/jobs/jobs.mjs.map +1 -0
  832. package/resources/fine-tuning/jobs.d.mts +2 -0
  833. package/resources/fine-tuning/jobs.d.mts.map +1 -0
  834. package/resources/fine-tuning/jobs.d.ts +2 -0
  835. package/resources/fine-tuning/jobs.d.ts.map +1 -0
  836. package/resources/fine-tuning/jobs.js +6 -0
  837. package/resources/fine-tuning/jobs.js.map +1 -0
  838. package/resources/fine-tuning/jobs.mjs +3 -0
  839. package/resources/fine-tuning/jobs.mjs.map +1 -0
  840. package/resources/fine-tuning/methods.d.mts +120 -0
  841. package/resources/fine-tuning/methods.d.mts.map +1 -0
  842. package/resources/fine-tuning/methods.d.ts +120 -0
  843. package/resources/fine-tuning/methods.d.ts.map +1 -0
  844. package/resources/fine-tuning/methods.js +9 -0
  845. package/resources/fine-tuning/methods.js.map +1 -0
  846. package/resources/fine-tuning/methods.mjs +5 -0
  847. package/resources/fine-tuning/methods.mjs.map +1 -0
  848. package/resources/fine-tuning.d.mts +2 -0
  849. package/resources/fine-tuning.d.mts.map +1 -0
  850. package/resources/fine-tuning.d.ts +2 -0
  851. package/resources/fine-tuning.d.ts.map +1 -0
  852. package/resources/fine-tuning.js +6 -0
  853. package/resources/fine-tuning.js.map +1 -0
  854. package/resources/fine-tuning.mjs +3 -0
  855. package/resources/fine-tuning.mjs.map +1 -0
  856. package/resources/graders/grader-models.d.mts +354 -0
  857. package/resources/graders/grader-models.d.mts.map +1 -0
  858. package/resources/graders/grader-models.d.ts +354 -0
  859. package/resources/graders/grader-models.d.ts.map +1 -0
  860. package/resources/graders/grader-models.js +9 -0
  861. package/resources/graders/grader-models.js.map +1 -0
  862. package/resources/graders/grader-models.mjs +5 -0
  863. package/resources/graders/grader-models.mjs.map +1 -0
  864. package/resources/graders/graders.d.mts +10 -0
  865. package/resources/graders/graders.d.mts.map +1 -0
  866. package/resources/graders/graders.d.ts +10 -0
  867. package/resources/graders/graders.d.ts.map +1 -0
  868. package/resources/graders/graders.js +17 -0
  869. package/resources/graders/graders.js.map +1 -0
  870. package/resources/graders/graders.mjs +12 -0
  871. package/resources/graders/graders.mjs.map +1 -0
  872. package/resources/graders/index.d.mts +3 -0
  873. package/resources/graders/index.d.mts.map +1 -0
  874. package/resources/graders/index.d.ts +3 -0
  875. package/resources/graders/index.d.ts.map +1 -0
  876. package/resources/graders/index.js +9 -0
  877. package/resources/graders/index.js.map +1 -0
  878. package/resources/graders/index.mjs +4 -0
  879. package/resources/graders/index.mjs.map +1 -0
  880. package/resources/graders.d.mts +2 -0
  881. package/resources/graders.d.mts.map +1 -0
  882. package/resources/graders.d.ts +2 -0
  883. package/resources/graders.d.ts.map +1 -0
  884. package/resources/graders.js +6 -0
  885. package/resources/graders.js.map +1 -0
  886. package/resources/graders.mjs +3 -0
  887. package/resources/graders.mjs.map +1 -0
  888. package/resources/images.d.mts +676 -0
  889. package/resources/images.d.mts.map +1 -0
  890. package/resources/images.d.ts +676 -0
  891. package/resources/images.d.ts.map +1 -0
  892. package/resources/images.js +29 -0
  893. package/resources/images.js.map +1 -0
  894. package/resources/images.mjs +25 -0
  895. package/resources/images.mjs.map +1 -0
  896. package/resources/index.d.mts +24 -0
  897. package/resources/index.d.mts.map +1 -0
  898. package/resources/index.d.ts +24 -0
  899. package/resources/index.d.ts.map +1 -0
  900. package/resources/index.js +50 -0
  901. package/resources/index.js.map +1 -0
  902. package/resources/index.mjs +25 -0
  903. package/resources/index.mjs.map +1 -0
  904. package/resources/models.d.mts +52 -0
  905. package/resources/models.d.mts.map +1 -0
  906. package/resources/models.d.ts +52 -0
  907. package/resources/models.d.ts.map +1 -0
  908. package/resources/models.js +32 -0
  909. package/resources/models.js.map +1 -0
  910. package/resources/models.mjs +28 -0
  911. package/resources/models.mjs.map +1 -0
  912. package/resources/moderations.d.mts +295 -0
  913. package/resources/moderations.d.mts.map +1 -0
  914. package/resources/moderations.d.ts +295 -0
  915. package/resources/moderations.d.ts.map +1 -0
  916. package/resources/moderations.js +16 -0
  917. package/resources/moderations.js.map +1 -0
  918. package/resources/moderations.mjs +12 -0
  919. package/resources/moderations.mjs.map +1 -0
  920. package/resources/realtime/calls.d.mts +158 -0
  921. package/resources/realtime/calls.d.mts.map +1 -0
  922. package/resources/realtime/calls.d.ts +158 -0
  923. package/resources/realtime/calls.d.ts.map +1 -0
  924. package/resources/realtime/calls.js +75 -0
  925. package/resources/realtime/calls.js.map +1 -0
  926. package/resources/realtime/calls.mjs +71 -0
  927. package/resources/realtime/calls.mjs.map +1 -0
  928. package/resources/realtime/client-secrets.d.mts +638 -0
  929. package/resources/realtime/client-secrets.d.mts.map +1 -0
  930. package/resources/realtime/client-secrets.d.ts +638 -0
  931. package/resources/realtime/client-secrets.d.ts.map +1 -0
  932. package/resources/realtime/client-secrets.js +35 -0
  933. package/resources/realtime/client-secrets.js.map +1 -0
  934. package/resources/realtime/client-secrets.mjs +31 -0
  935. package/resources/realtime/client-secrets.mjs.map +1 -0
  936. package/resources/realtime/index.d.mts +4 -0
  937. package/resources/realtime/index.d.mts.map +1 -0
  938. package/resources/realtime/index.d.ts +4 -0
  939. package/resources/realtime/index.d.ts.map +1 -0
  940. package/resources/realtime/index.js +11 -0
  941. package/resources/realtime/index.js.map +1 -0
  942. package/resources/realtime/index.mjs +5 -0
  943. package/resources/realtime/index.mjs.map +1 -0
  944. package/resources/realtime/realtime.d.mts +3941 -0
  945. package/resources/realtime/realtime.d.mts.map +1 -0
  946. package/resources/realtime/realtime.d.ts +3941 -0
  947. package/resources/realtime/realtime.d.ts.map +1 -0
  948. package/resources/realtime/realtime.js +21 -0
  949. package/resources/realtime/realtime.js.map +1 -0
  950. package/resources/realtime/realtime.mjs +16 -0
  951. package/resources/realtime/realtime.mjs.map +1 -0
  952. package/resources/realtime.d.mts +2 -0
  953. package/resources/realtime.d.mts.map +1 -0
  954. package/resources/realtime.d.ts +2 -0
  955. package/resources/realtime.d.ts.map +1 -0
  956. package/resources/realtime.js +6 -0
  957. package/resources/realtime.js.map +1 -0
  958. package/resources/realtime.mjs +3 -0
  959. package/resources/realtime.mjs.map +1 -0
  960. package/resources/responses/index.d.mts +4 -0
  961. package/resources/responses/index.d.mts.map +1 -0
  962. package/resources/responses/index.d.ts +4 -0
  963. package/resources/responses/index.d.ts.map +1 -0
  964. package/resources/responses/index.js +11 -0
  965. package/resources/responses/index.js.map +1 -0
  966. package/resources/responses/index.mjs +5 -0
  967. package/resources/responses/index.mjs.map +1 -0
  968. package/resources/responses/input-items.d.mts +65 -0
  969. package/resources/responses/input-items.d.mts.map +1 -0
  970. package/resources/responses/input-items.d.ts +65 -0
  971. package/resources/responses/input-items.d.ts.map +1 -0
  972. package/resources/responses/input-items.js +27 -0
  973. package/resources/responses/input-items.js.map +1 -0
  974. package/resources/responses/input-items.mjs +23 -0
  975. package/resources/responses/input-items.mjs.map +1 -0
  976. package/resources/responses/input-tokens.d.mts +129 -0
  977. package/resources/responses/input-tokens.d.mts.map +1 -0
  978. package/resources/responses/input-tokens.d.ts +129 -0
  979. package/resources/responses/input-tokens.d.ts.map +1 -0
  980. package/resources/responses/input-tokens.js +23 -0
  981. package/resources/responses/input-tokens.js.map +1 -0
  982. package/resources/responses/input-tokens.mjs +19 -0
  983. package/resources/responses/input-tokens.mjs.map +1 -0
  984. package/resources/responses/responses.d.mts +5561 -0
  985. package/resources/responses/responses.d.mts.map +1 -0
  986. package/resources/responses/responses.d.ts +5561 -0
  987. package/resources/responses/responses.d.ts.map +1 -0
  988. package/resources/responses/responses.js +82 -0
  989. package/resources/responses/responses.js.map +1 -0
  990. package/resources/responses/responses.mjs +77 -0
  991. package/resources/responses/responses.mjs.map +1 -0
  992. package/resources/responses.d.mts +2 -0
  993. package/resources/responses.d.mts.map +1 -0
  994. package/resources/responses.d.ts +2 -0
  995. package/resources/responses.d.ts.map +1 -0
  996. package/resources/responses.js +6 -0
  997. package/resources/responses.js.map +1 -0
  998. package/resources/responses.mjs +3 -0
  999. package/resources/responses.mjs.map +1 -0
  1000. package/resources/shared.d.mts +287 -0
  1001. package/resources/shared.d.mts.map +1 -0
  1002. package/resources/shared.d.ts +287 -0
  1003. package/resources/shared.d.ts.map +1 -0
  1004. package/resources/shared.js +4 -0
  1005. package/resources/shared.js.map +1 -0
  1006. package/resources/shared.mjs +3 -0
  1007. package/resources/shared.mjs.map +1 -0
  1008. package/resources/skills/content.d.mts +10 -0
  1009. package/resources/skills/content.d.mts.map +1 -0
  1010. package/resources/skills/content.d.ts +10 -0
  1011. package/resources/skills/content.d.ts.map +1 -0
  1012. package/resources/skills/content.js +21 -0
  1013. package/resources/skills/content.js.map +1 -0
  1014. package/resources/skills/content.mjs +17 -0
  1015. package/resources/skills/content.mjs.map +1 -0
  1016. package/resources/skills/index.d.mts +4 -0
  1017. package/resources/skills/index.d.mts.map +1 -0
  1018. package/resources/skills/index.d.ts +4 -0
  1019. package/resources/skills/index.d.ts.map +1 -0
  1020. package/resources/skills/index.js +11 -0
  1021. package/resources/skills/index.js.map +1 -0
  1022. package/resources/skills/index.mjs +5 -0
  1023. package/resources/skills/index.mjs.map +1 -0
  1024. package/resources/skills/skills.d.mts +116 -0
  1025. package/resources/skills/skills.d.mts.map +1 -0
  1026. package/resources/skills/skills.d.ts +116 -0
  1027. package/resources/skills/skills.d.ts.map +1 -0
  1028. package/resources/skills/skills.js +54 -0
  1029. package/resources/skills/skills.js.map +1 -0
  1030. package/resources/skills/skills.mjs +49 -0
  1031. package/resources/skills/skills.mjs.map +1 -0
  1032. package/resources/skills/versions/content.d.mts +19 -0
  1033. package/resources/skills/versions/content.d.mts.map +1 -0
  1034. package/resources/skills/versions/content.d.ts +19 -0
  1035. package/resources/skills/versions/content.d.ts.map +1 -0
  1036. package/resources/skills/versions/content.js +22 -0
  1037. package/resources/skills/versions/content.js.map +1 -0
  1038. package/resources/skills/versions/content.mjs +18 -0
  1039. package/resources/skills/versions/content.mjs.map +1 -0
  1040. package/resources/skills/versions/index.d.mts +3 -0
  1041. package/resources/skills/versions/index.d.mts.map +1 -0
  1042. package/resources/skills/versions/index.d.ts +3 -0
  1043. package/resources/skills/versions/index.d.ts.map +1 -0
  1044. package/resources/skills/versions/index.js +9 -0
  1045. package/resources/skills/versions/index.js.map +1 -0
  1046. package/resources/skills/versions/index.mjs +4 -0
  1047. package/resources/skills/versions/index.mjs.map +1 -0
  1048. package/resources/skills/versions/versions.d.mts +121 -0
  1049. package/resources/skills/versions/versions.d.mts.map +1 -0
  1050. package/resources/skills/versions/versions.d.ts +121 -0
  1051. package/resources/skills/versions/versions.d.ts.map +1 -0
  1052. package/resources/skills/versions/versions.js +49 -0
  1053. package/resources/skills/versions/versions.js.map +1 -0
  1054. package/resources/skills/versions/versions.mjs +44 -0
  1055. package/resources/skills/versions/versions.mjs.map +1 -0
  1056. package/resources/skills/versions.d.mts +2 -0
  1057. package/resources/skills/versions.d.mts.map +1 -0
  1058. package/resources/skills/versions.d.ts +2 -0
  1059. package/resources/skills/versions.d.ts.map +1 -0
  1060. package/resources/skills/versions.js +6 -0
  1061. package/resources/skills/versions.js.map +1 -0
  1062. package/resources/skills/versions.mjs +3 -0
  1063. package/resources/skills/versions.mjs.map +1 -0
  1064. package/resources/skills.d.mts +2 -0
  1065. package/resources/skills.d.mts.map +1 -0
  1066. package/resources/skills.d.ts +2 -0
  1067. package/resources/skills.d.ts.map +1 -0
  1068. package/resources/skills.js +6 -0
  1069. package/resources/skills.js.map +1 -0
  1070. package/resources/skills.mjs +3 -0
  1071. package/resources/skills.mjs.map +1 -0
  1072. package/resources/uploads/index.d.mts +3 -0
  1073. package/resources/uploads/index.d.mts.map +1 -0
  1074. package/resources/uploads/index.d.ts +3 -0
  1075. package/resources/uploads/index.d.ts.map +1 -0
  1076. package/resources/uploads/index.js +9 -0
  1077. package/resources/uploads/index.js.map +1 -0
  1078. package/resources/uploads/index.mjs +4 -0
  1079. package/resources/uploads/index.mjs.map +1 -0
  1080. package/resources/uploads/parts.d.mts +51 -0
  1081. package/resources/uploads/parts.d.mts.map +1 -0
  1082. package/resources/uploads/parts.d.ts +51 -0
  1083. package/resources/uploads/parts.d.ts.map +1 -0
  1084. package/resources/uploads/parts.js +27 -0
  1085. package/resources/uploads/parts.js.map +1 -0
  1086. package/resources/uploads/parts.mjs +23 -0
  1087. package/resources/uploads/parts.mjs.map +1 -0
  1088. package/resources/uploads/uploads.d.mts +163 -0
  1089. package/resources/uploads/uploads.d.mts.map +1 -0
  1090. package/resources/uploads/uploads.d.ts +163 -0
  1091. package/resources/uploads/uploads.d.ts.map +1 -0
  1092. package/resources/uploads/uploads.js +72 -0
  1093. package/resources/uploads/uploads.js.map +1 -0
  1094. package/resources/uploads/uploads.mjs +67 -0
  1095. package/resources/uploads/uploads.mjs.map +1 -0
  1096. package/resources/uploads.d.mts +2 -0
  1097. package/resources/uploads.d.mts.map +1 -0
  1098. package/resources/uploads.d.ts +2 -0
  1099. package/resources/uploads.d.ts.map +1 -0
  1100. package/resources/uploads.js +6 -0
  1101. package/resources/uploads.js.map +1 -0
  1102. package/resources/uploads.mjs +3 -0
  1103. package/resources/uploads.mjs.map +1 -0
  1104. package/resources/vector-stores/file-batches.d.mts +179 -0
  1105. package/resources/vector-stores/file-batches.d.mts.map +1 -0
  1106. package/resources/vector-stores/file-batches.d.ts +179 -0
  1107. package/resources/vector-stores/file-batches.d.ts.map +1 -0
  1108. package/resources/vector-stores/file-batches.js +50 -0
  1109. package/resources/vector-stores/file-batches.js.map +1 -0
  1110. package/resources/vector-stores/file-batches.mjs +46 -0
  1111. package/resources/vector-stores/file-batches.mjs.map +1 -0
  1112. package/resources/vector-stores/files.d.mts +202 -0
  1113. package/resources/vector-stores/files.d.mts.map +1 -0
  1114. package/resources/vector-stores/files.d.ts +202 -0
  1115. package/resources/vector-stores/files.d.ts.map +1 -0
  1116. package/resources/vector-stores/files.js +75 -0
  1117. package/resources/vector-stores/files.js.map +1 -0
  1118. package/resources/vector-stores/files.mjs +71 -0
  1119. package/resources/vector-stores/files.mjs.map +1 -0
  1120. package/resources/vector-stores/index.d.mts +4 -0
  1121. package/resources/vector-stores/index.d.mts.map +1 -0
  1122. package/resources/vector-stores/index.d.ts +4 -0
  1123. package/resources/vector-stores/index.d.ts.map +1 -0
  1124. package/resources/vector-stores/index.js +11 -0
  1125. package/resources/vector-stores/index.js.map +1 -0
  1126. package/resources/vector-stores/index.mjs +5 -0
  1127. package/resources/vector-stores/index.mjs.map +1 -0
  1128. package/resources/vector-stores/vector-stores.d.mts +378 -0
  1129. package/resources/vector-stores/vector-stores.d.mts.map +1 -0
  1130. package/resources/vector-stores/vector-stores.d.ts +378 -0
  1131. package/resources/vector-stores/vector-stores.d.ts.map +1 -0
  1132. package/resources/vector-stores/vector-stores.js +84 -0
  1133. package/resources/vector-stores/vector-stores.js.map +1 -0
  1134. package/resources/vector-stores/vector-stores.mjs +79 -0
  1135. package/resources/vector-stores/vector-stores.mjs.map +1 -0
  1136. package/resources/vector-stores.d.mts +2 -0
  1137. package/resources/vector-stores.d.mts.map +1 -0
  1138. package/resources/vector-stores.d.ts +2 -0
  1139. package/resources/vector-stores.d.ts.map +1 -0
  1140. package/resources/vector-stores.js +6 -0
  1141. package/resources/vector-stores.js.map +1 -0
  1142. package/resources/vector-stores.mjs +3 -0
  1143. package/resources/vector-stores.mjs.map +1 -0
  1144. package/resources/videos.d.mts +171 -0
  1145. package/resources/videos.d.mts.map +1 -0
  1146. package/resources/videos.d.ts +171 -0
  1147. package/resources/videos.d.ts.map +1 -0
  1148. package/resources/videos.js +56 -0
  1149. package/resources/videos.js.map +1 -0
  1150. package/resources/videos.mjs +52 -0
  1151. package/resources/videos.mjs.map +1 -0
  1152. package/resources/webhooks/index.d.mts +2 -0
  1153. package/resources/webhooks/index.d.mts.map +1 -0
  1154. package/resources/webhooks/index.d.ts +2 -0
  1155. package/resources/webhooks/index.d.ts.map +1 -0
  1156. package/resources/webhooks/index.js +7 -0
  1157. package/resources/webhooks/index.js.map +1 -0
  1158. package/resources/webhooks/index.mjs +3 -0
  1159. package/resources/webhooks/index.mjs.map +1 -0
  1160. package/resources/webhooks/webhooks.d.mts +571 -0
  1161. package/resources/webhooks/webhooks.d.mts.map +1 -0
  1162. package/resources/webhooks/webhooks.d.ts +571 -0
  1163. package/resources/webhooks/webhooks.d.ts.map +1 -0
  1164. package/resources/webhooks/webhooks.js +12 -0
  1165. package/resources/webhooks/webhooks.js.map +1 -0
  1166. package/resources/webhooks/webhooks.mjs +8 -0
  1167. package/resources/webhooks/webhooks.mjs.map +1 -0
  1168. package/resources/webhooks.d.mts +2 -0
  1169. package/resources/webhooks.d.mts.map +1 -0
  1170. package/resources/webhooks.d.ts +2 -0
  1171. package/resources/webhooks.d.ts.map +1 -0
  1172. package/resources/webhooks.js +6 -0
  1173. package/resources/webhooks.js.map +1 -0
  1174. package/resources/webhooks.mjs +3 -0
  1175. package/resources/webhooks.mjs.map +1 -0
  1176. package/resources.d.mts +2 -0
  1177. package/resources.d.mts.map +1 -0
  1178. package/resources.d.ts +2 -0
  1179. package/resources.d.ts.map +1 -0
  1180. package/resources.js +5 -0
  1181. package/resources.js.map +1 -0
  1182. package/resources.mjs +2 -0
  1183. package/resources.mjs.map +1 -0
  1184. package/src/api-promise.ts +2 -0
  1185. package/src/client.ts +1292 -0
  1186. package/src/core/README.md +3 -0
  1187. package/src/core/api-promise.ts +92 -0
  1188. package/src/core/error.ts +142 -0
  1189. package/src/core/pagination.ts +264 -0
  1190. package/src/core/resource.ts +11 -0
  1191. package/src/core/streaming.ts +332 -0
  1192. package/src/core/uploads.ts +2 -0
  1193. package/src/error.ts +2 -0
  1194. package/src/index.ts +23 -0
  1195. package/src/internal/README.md +3 -0
  1196. package/src/internal/builtin-types.ts +93 -0
  1197. package/src/internal/decoders/line.ts +135 -0
  1198. package/src/internal/detect-platform.ts +196 -0
  1199. package/src/internal/errors.ts +33 -0
  1200. package/src/internal/headers.ts +97 -0
  1201. package/src/internal/parse.ts +70 -0
  1202. package/src/internal/qs/LICENSE.md +13 -0
  1203. package/src/internal/qs/README.md +3 -0
  1204. package/src/internal/qs/formats.ts +10 -0
  1205. package/src/internal/qs/index.ts +13 -0
  1206. package/src/internal/qs/stringify.ts +385 -0
  1207. package/src/internal/qs/types.ts +71 -0
  1208. package/src/internal/qs/utils.ts +265 -0
  1209. package/src/internal/request-options.ts +93 -0
  1210. package/src/internal/shim-types.ts +26 -0
  1211. package/src/internal/shims.ts +107 -0
  1212. package/src/internal/to-file.ts +154 -0
  1213. package/src/internal/types.ts +95 -0
  1214. package/src/internal/uploads.ts +187 -0
  1215. package/src/internal/utils/base64.ts +40 -0
  1216. package/src/internal/utils/bytes.ts +32 -0
  1217. package/src/internal/utils/env.ts +18 -0
  1218. package/src/internal/utils/log.ts +126 -0
  1219. package/src/internal/utils/path.ts +88 -0
  1220. package/src/internal/utils/sleep.ts +3 -0
  1221. package/src/internal/utils/uuid.ts +17 -0
  1222. package/src/internal/utils/values.ts +105 -0
  1223. package/src/internal/utils.ts +8 -0
  1224. package/src/lib/.keep +4 -0
  1225. package/src/pagination.ts +2 -0
  1226. package/src/resource.ts +2 -0
  1227. package/src/resources/audio/audio.ts +91 -0
  1228. package/src/resources/audio/index.ts +29 -0
  1229. package/src/resources/audio/speech.ts +97 -0
  1230. package/src/resources/audio/transcriptions.ts +805 -0
  1231. package/src/resources/audio/translations.ts +103 -0
  1232. package/src/resources/audio.ts +3 -0
  1233. package/src/resources/batches.ts +367 -0
  1234. package/src/resources/beta/assistants.ts +1538 -0
  1235. package/src/resources/beta/beta.ts +87 -0
  1236. package/src/resources/beta/chatkit/chatkit.ts +112 -0
  1237. package/src/resources/beta/chatkit/index.ts +30 -0
  1238. package/src/resources/beta/chatkit/sessions.ts +81 -0
  1239. package/src/resources/beta/chatkit/threads.ts +1037 -0
  1240. package/src/resources/beta/chatkit.ts +3 -0
  1241. package/src/resources/beta/index.ts +36 -0
  1242. package/src/resources/beta/threads/index.ts +70 -0
  1243. package/src/resources/beta/threads/messages.ts +792 -0
  1244. package/src/resources/beta/threads/runs/index.ts +43 -0
  1245. package/src/resources/beta/threads/runs/runs.ts +947 -0
  1246. package/src/resources/beta/threads/runs/steps.ts +756 -0
  1247. package/src/resources/beta/threads/runs.ts +3 -0
  1248. package/src/resources/beta/threads/threads.ts +1028 -0
  1249. package/src/resources/beta/threads.ts +3 -0
  1250. package/src/resources/beta.ts +3 -0
  1251. package/src/resources/chat/chat.ts +110 -0
  1252. package/src/resources/chat/completions/completions.ts +1932 -0
  1253. package/src/resources/chat/completions/index.ts +49 -0
  1254. package/src/resources/chat/completions/messages.ts +50 -0
  1255. package/src/resources/chat/completions.ts +3 -0
  1256. package/src/resources/chat/index.ts +49 -0
  1257. package/src/resources/chat.ts +3 -0
  1258. package/src/resources/completions.ts +397 -0
  1259. package/src/resources/containers/containers.ts +395 -0
  1260. package/src/resources/containers/files/content.ts +29 -0
  1261. package/src/resources/containers/files/files.ts +228 -0
  1262. package/src/resources/containers/files/index.ts +14 -0
  1263. package/src/resources/containers/files.ts +3 -0
  1264. package/src/resources/containers/index.ts +22 -0
  1265. package/src/resources/containers.ts +3 -0
  1266. package/src/resources/conversations/api.md +37 -0
  1267. package/src/resources/conversations/conversations.ts +277 -0
  1268. package/src/resources/conversations/index.ts +13 -0
  1269. package/src/resources/conversations/items.ts +502 -0
  1270. package/src/resources/conversations.ts +3 -0
  1271. package/src/resources/embeddings.ts +138 -0
  1272. package/src/resources/evals/evals.ts +930 -0
  1273. package/src/resources/evals/index.ts +33 -0
  1274. package/src/resources/evals/runs/index.ts +27 -0
  1275. package/src/resources/evals/runs/output-items.ts +477 -0
  1276. package/src/resources/evals/runs/runs.ts +2869 -0
  1277. package/src/resources/evals/runs.ts +3 -0
  1278. package/src/resources/evals.ts +3 -0
  1279. package/src/resources/files.ts +229 -0
  1280. package/src/resources/fine-tuning/alpha/alpha.ts +27 -0
  1281. package/src/resources/fine-tuning/alpha/graders.ts +171 -0
  1282. package/src/resources/fine-tuning/alpha/index.ts +10 -0
  1283. package/src/resources/fine-tuning/alpha.ts +3 -0
  1284. package/src/resources/fine-tuning/checkpoints/checkpoints.ts +33 -0
  1285. package/src/resources/fine-tuning/checkpoints/index.ts +13 -0
  1286. package/src/resources/fine-tuning/checkpoints/permissions.ts +227 -0
  1287. package/src/resources/fine-tuning/checkpoints.ts +3 -0
  1288. package/src/resources/fine-tuning/fine-tuning.ts +73 -0
  1289. package/src/resources/fine-tuning/index.ts +27 -0
  1290. package/src/resources/fine-tuning/jobs/checkpoints.ts +107 -0
  1291. package/src/resources/fine-tuning/jobs/index.ts +21 -0
  1292. package/src/resources/fine-tuning/jobs/jobs.ts +654 -0
  1293. package/src/resources/fine-tuning/jobs.ts +3 -0
  1294. package/src/resources/fine-tuning/methods.ts +152 -0
  1295. package/src/resources/fine-tuning.ts +3 -0
  1296. package/src/resources/graders/grader-models.ts +450 -0
  1297. package/src/resources/graders/graders.ts +33 -0
  1298. package/src/resources/graders/index.ts +13 -0
  1299. package/src/resources/graders.ts +3 -0
  1300. package/src/resources/images.ts +848 -0
  1301. package/src/resources/index.ts +145 -0
  1302. package/src/resources/models.ts +73 -0
  1303. package/src/resources/moderations.ts +367 -0
  1304. package/src/resources/realtime/api.md +128 -0
  1305. package/src/resources/realtime/calls.ts +226 -0
  1306. package/src/resources/realtime/client-secrets.ts +761 -0
  1307. package/src/resources/realtime/index.ts +13 -0
  1308. package/src/resources/realtime/realtime.ts +4844 -0
  1309. package/src/resources/realtime.ts +3 -0
  1310. package/src/resources/responses/api.md +167 -0
  1311. package/src/resources/responses/index.ts +5 -0
  1312. package/src/resources/responses/input-items.ts +87 -0
  1313. package/src/resources/responses/input-tokens.ts +164 -0
  1314. package/src/resources/responses/responses.ts +7000 -0
  1315. package/src/resources/responses.ts +3 -0
  1316. package/src/resources/shared.ts +423 -0
  1317. package/src/resources/skills/content.ts +20 -0
  1318. package/src/resources/skills/index.ts +24 -0
  1319. package/src/resources/skills/skills.ts +191 -0
  1320. package/src/resources/skills/versions/content.ts +32 -0
  1321. package/src/resources/skills/versions/index.ts +14 -0
  1322. package/src/resources/skills/versions/versions.ts +196 -0
  1323. package/src/resources/skills/versions.ts +3 -0
  1324. package/src/resources/skills.ts +3 -0
  1325. package/src/resources/uploads/index.ts +4 -0
  1326. package/src/resources/uploads/parts.ts +66 -0
  1327. package/src/resources/uploads/uploads.ts +201 -0
  1328. package/src/resources/uploads.ts +3 -0
  1329. package/src/resources/vector-stores/file-batches.ts +255 -0
  1330. package/src/resources/vector-stores/files.ts +306 -0
  1331. package/src/resources/vector-stores/index.ts +43 -0
  1332. package/src/resources/vector-stores/vector-stores.ts +562 -0
  1333. package/src/resources/vector-stores.ts +3 -0
  1334. package/src/resources/videos.ts +257 -0
  1335. package/src/resources/webhooks/api.md +24 -0
  1336. package/src/resources/webhooks/index.ts +3 -0
  1337. package/src/resources/webhooks/webhooks.ts +702 -0
  1338. package/src/resources/webhooks.ts +3 -0
  1339. package/src/resources.ts +1 -0
  1340. package/src/streaming.ts +2 -0
  1341. package/src/tsconfig.json +11 -0
  1342. package/src/uploads.ts +2 -0
  1343. package/src/version.ts +1 -0
  1344. package/streaming.d.mts +2 -0
  1345. package/streaming.d.mts.map +1 -0
  1346. package/streaming.d.ts +2 -0
  1347. package/streaming.d.ts.map +1 -0
  1348. package/streaming.js +6 -0
  1349. package/streaming.js.map +1 -0
  1350. package/streaming.mjs +2 -0
  1351. package/streaming.mjs.map +1 -0
  1352. package/uploads.d.mts +2 -0
  1353. package/uploads.d.mts.map +1 -0
  1354. package/uploads.d.ts +2 -0
  1355. package/uploads.d.ts.map +1 -0
  1356. package/uploads.js +6 -0
  1357. package/uploads.js.map +1 -0
  1358. package/uploads.mjs +2 -0
  1359. package/uploads.mjs.map +1 -0
  1360. package/version.d.mts +2 -0
  1361. package/version.d.mts.map +1 -0
  1362. package/version.d.ts +2 -0
  1363. package/version.d.ts.map +1 -0
  1364. package/version.js +5 -0
  1365. package/version.js.map +1 -0
  1366. package/version.mjs +2 -0
  1367. package/version.mjs.map +1 -0
@@ -0,0 +1,4844 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as RealtimeAPI from './realtime';
5
+ import * as Shared from '../shared';
6
+ import * as CallsAPI from './calls';
7
+ import { CallAcceptParams, CallReferParams, CallRejectParams, Calls } from './calls';
8
+ import * as ClientSecretsAPI from './client-secrets';
9
+ import {
10
+ ClientSecretCreateParams,
11
+ ClientSecretCreateResponse,
12
+ ClientSecrets,
13
+ RealtimeSessionClientSecret,
14
+ RealtimeSessionCreateResponse,
15
+ RealtimeTranscriptionSessionCreateResponse,
16
+ RealtimeTranscriptionSessionTurnDetection,
17
+ } from './client-secrets';
18
+ import * as ResponsesAPI from '../responses/responses';
19
+
20
+ export class Realtime extends APIResource {
21
+ clientSecrets: ClientSecretsAPI.ClientSecrets = new ClientSecretsAPI.ClientSecrets(this._client);
22
+ calls: CallsAPI.Calls = new CallsAPI.Calls(this._client);
23
+ }
24
+
25
+ export interface AudioTranscription {
26
+ /**
27
+ * The language of the input audio. Supplying the input language in
28
+ * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
29
+ * format will improve accuracy and latency.
30
+ */
31
+ language?: string;
32
+
33
+ /**
34
+ * The model to use for transcription. Current options are `whisper-1`,
35
+ * `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`,
36
+ * `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use
37
+ * `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
38
+ */
39
+ model?:
40
+ | (string & {})
41
+ | 'whisper-1'
42
+ | 'gpt-4o-mini-transcribe'
43
+ | 'gpt-4o-mini-transcribe-2025-12-15'
44
+ | 'gpt-4o-transcribe'
45
+ | 'gpt-4o-transcribe-diarize';
46
+
47
+ /**
48
+ * An optional text to guide the model's style or continue a previous audio
49
+ * segment. For `whisper-1`, the
50
+ * [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
51
+ * For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the
52
+ * prompt is a free text string, for example "expect words related to technology".
53
+ */
54
+ prompt?: string;
55
+ }
56
+
57
+ /**
58
+ * Returned when a conversation is created. Emitted right after session creation.
59
+ */
60
+ export interface ConversationCreatedEvent {
61
+ /**
62
+ * The conversation resource.
63
+ */
64
+ conversation: ConversationCreatedEvent.Conversation;
65
+
66
+ /**
67
+ * The unique ID of the server event.
68
+ */
69
+ event_id: string;
70
+
71
+ /**
72
+ * The event type, must be `conversation.created`.
73
+ */
74
+ type: 'conversation.created';
75
+ }
76
+
77
+ export namespace ConversationCreatedEvent {
78
+ /**
79
+ * The conversation resource.
80
+ */
81
+ export interface Conversation {
82
+ /**
83
+ * The unique ID of the conversation.
84
+ */
85
+ id?: string;
86
+
87
+ /**
88
+ * The object type, must be `realtime.conversation`.
89
+ */
90
+ object?: 'realtime.conversation';
91
+ }
92
+ }
93
+
94
+ /**
95
+ * A single item within a Realtime conversation.
96
+ */
97
+ export type ConversationItem =
98
+ | RealtimeConversationItemSystemMessage
99
+ | RealtimeConversationItemUserMessage
100
+ | RealtimeConversationItemAssistantMessage
101
+ | RealtimeConversationItemFunctionCall
102
+ | RealtimeConversationItemFunctionCallOutput
103
+ | RealtimeMcpApprovalResponse
104
+ | RealtimeMcpListTools
105
+ | RealtimeMcpToolCall
106
+ | RealtimeMcpApprovalRequest;
107
+
108
+ /**
109
+ * Sent by the server when an Item is added to the default Conversation. This can
110
+ * happen in several cases:
111
+ *
112
+ * - When the client sends a `conversation.item.create` event.
113
+ * - When the input audio buffer is committed. In this case the item will be a user
114
+ * message containing the audio from the buffer.
115
+ * - When the model is generating a Response. In this case the
116
+ * `conversation.item.added` event will be sent when the model starts generating
117
+ * a specific Item, and thus it will not yet have any content (and `status` will
118
+ * be `in_progress`).
119
+ *
120
+ * The event will include the full content of the Item (except when model is
121
+ * generating a Response) except for audio data, which can be retrieved separately
122
+ * with a `conversation.item.retrieve` event if necessary.
123
+ */
124
+ export interface ConversationItemAdded {
125
+ /**
126
+ * The unique ID of the server event.
127
+ */
128
+ event_id: string;
129
+
130
+ /**
131
+ * A single item within a Realtime conversation.
132
+ */
133
+ item: ConversationItem;
134
+
135
+ /**
136
+ * The event type, must be `conversation.item.added`.
137
+ */
138
+ type: 'conversation.item.added';
139
+
140
+ /**
141
+ * The ID of the item that precedes this one, if any. This is used to maintain
142
+ * ordering when items are inserted.
143
+ */
144
+ previous_item_id?: string | null;
145
+ }
146
+
147
+ /**
148
+ * Add a new Item to the Conversation's context, including messages, function
149
+ * calls, and function call responses. This event can be used both to populate a
150
+ * "history" of the conversation and to add new items mid-stream, but has the
151
+ * current limitation that it cannot populate assistant audio messages.
152
+ *
153
+ * If successful, the server will respond with a `conversation.item.created` event,
154
+ * otherwise an `error` event will be sent.
155
+ */
156
+ export interface ConversationItemCreateEvent {
157
+ /**
158
+ * A single item within a Realtime conversation.
159
+ */
160
+ item: ConversationItem;
161
+
162
+ /**
163
+ * The event type, must be `conversation.item.create`.
164
+ */
165
+ type: 'conversation.item.create';
166
+
167
+ /**
168
+ * Optional client-generated ID used to identify this event.
169
+ */
170
+ event_id?: string;
171
+
172
+ /**
173
+ * The ID of the preceding item after which the new item will be inserted. If not
174
+ * set, the new item will be appended to the end of the conversation.
175
+ *
176
+ * If set to `root`, the new item will be added to the beginning of the
177
+ * conversation.
178
+ *
179
+ * If set to an existing ID, it allows an item to be inserted mid-conversation. If
180
+ * the ID cannot be found, an error will be returned and the item will not be
181
+ * added.
182
+ */
183
+ previous_item_id?: string;
184
+ }
185
+
186
+ /**
187
+ * Returned when a conversation item is created. There are several scenarios that
188
+ * produce this event:
189
+ *
190
+ * - The server is generating a Response, which if successful will produce either
191
+ * one or two Items, which will be of type `message` (role `assistant`) or type
192
+ * `function_call`.
193
+ * - The input audio buffer has been committed, either by the client or the server
194
+ * (in `server_vad` mode). The server will take the content of the input audio
195
+ * buffer and add it to a new user message Item.
196
+ * - The client has sent a `conversation.item.create` event to add a new Item to
197
+ * the Conversation.
198
+ */
199
+ export interface ConversationItemCreatedEvent {
200
+ /**
201
+ * The unique ID of the server event.
202
+ */
203
+ event_id: string;
204
+
205
+ /**
206
+ * A single item within a Realtime conversation.
207
+ */
208
+ item: ConversationItem;
209
+
210
+ /**
211
+ * The event type, must be `conversation.item.created`.
212
+ */
213
+ type: 'conversation.item.created';
214
+
215
+ /**
216
+ * The ID of the preceding item in the Conversation context, allows the client to
217
+ * understand the order of the conversation. Can be `null` if the item has no
218
+ * predecessor.
219
+ */
220
+ previous_item_id?: string | null;
221
+ }
222
+
223
+ /**
224
+ * Send this event when you want to remove any item from the conversation history.
225
+ * The server will respond with a `conversation.item.deleted` event, unless the
226
+ * item does not exist in the conversation history, in which case the server will
227
+ * respond with an error.
228
+ */
229
+ export interface ConversationItemDeleteEvent {
230
+ /**
231
+ * The ID of the item to delete.
232
+ */
233
+ item_id: string;
234
+
235
+ /**
236
+ * The event type, must be `conversation.item.delete`.
237
+ */
238
+ type: 'conversation.item.delete';
239
+
240
+ /**
241
+ * Optional client-generated ID used to identify this event.
242
+ */
243
+ event_id?: string;
244
+ }
245
+
246
+ /**
247
+ * Returned when an item in the conversation is deleted by the client with a
248
+ * `conversation.item.delete` event. This event is used to synchronize the server's
249
+ * understanding of the conversation history with the client's view.
250
+ */
251
+ export interface ConversationItemDeletedEvent {
252
+ /**
253
+ * The unique ID of the server event.
254
+ */
255
+ event_id: string;
256
+
257
+ /**
258
+ * The ID of the item that was deleted.
259
+ */
260
+ item_id: string;
261
+
262
+ /**
263
+ * The event type, must be `conversation.item.deleted`.
264
+ */
265
+ type: 'conversation.item.deleted';
266
+ }
267
+
268
+ /**
269
+ * Returned when a conversation item is finalized.
270
+ *
271
+ * The event will include the full content of the Item except for audio data, which
272
+ * can be retrieved separately with a `conversation.item.retrieve` event if needed.
273
+ */
274
+ export interface ConversationItemDone {
275
+ /**
276
+ * The unique ID of the server event.
277
+ */
278
+ event_id: string;
279
+
280
+ /**
281
+ * A single item within a Realtime conversation.
282
+ */
283
+ item: ConversationItem;
284
+
285
+ /**
286
+ * The event type, must be `conversation.item.done`.
287
+ */
288
+ type: 'conversation.item.done';
289
+
290
+ /**
291
+ * The ID of the item that precedes this one, if any. This is used to maintain
292
+ * ordering when items are inserted.
293
+ */
294
+ previous_item_id?: string | null;
295
+ }
296
+
297
+ /**
298
+ * This event is the output of audio transcription for user audio written to the
299
+ * user audio buffer. Transcription begins when the input audio buffer is committed
300
+ * by the client or server (when VAD is enabled). Transcription runs asynchronously
301
+ * with Response creation, so this event may come before or after the Response
302
+ * events.
303
+ *
304
+ * Realtime API models accept audio natively, and thus input transcription is a
305
+ * separate process run on a separate ASR (Automatic Speech Recognition) model. The
306
+ * transcript may diverge somewhat from the model's interpretation, and should be
307
+ * treated as a rough guide.
308
+ */
309
+ export interface ConversationItemInputAudioTranscriptionCompletedEvent {
310
+ /**
311
+ * The index of the content part containing the audio.
312
+ */
313
+ content_index: number;
314
+
315
+ /**
316
+ * The unique ID of the server event.
317
+ */
318
+ event_id: string;
319
+
320
+ /**
321
+ * The ID of the item containing the audio that is being transcribed.
322
+ */
323
+ item_id: string;
324
+
325
+ /**
326
+ * The transcribed text.
327
+ */
328
+ transcript: string;
329
+
330
+ /**
331
+ * The event type, must be `conversation.item.input_audio_transcription.completed`.
332
+ */
333
+ type: 'conversation.item.input_audio_transcription.completed';
334
+
335
+ /**
336
+ * Usage statistics for the transcription, this is billed according to the ASR
337
+ * model's pricing rather than the realtime model's pricing.
338
+ */
339
+ usage:
340
+ | ConversationItemInputAudioTranscriptionCompletedEvent.TranscriptTextUsageTokens
341
+ | ConversationItemInputAudioTranscriptionCompletedEvent.TranscriptTextUsageDuration;
342
+
343
+ /**
344
+ * The log probabilities of the transcription.
345
+ */
346
+ logprobs?: Array<LogProbProperties> | null;
347
+ }
348
+
349
+ export namespace ConversationItemInputAudioTranscriptionCompletedEvent {
350
+ /**
351
+ * Usage statistics for models billed by token usage.
352
+ */
353
+ export interface TranscriptTextUsageTokens {
354
+ /**
355
+ * Number of input tokens billed for this request.
356
+ */
357
+ input_tokens: number;
358
+
359
+ /**
360
+ * Number of output tokens generated.
361
+ */
362
+ output_tokens: number;
363
+
364
+ /**
365
+ * Total number of tokens used (input + output).
366
+ */
367
+ total_tokens: number;
368
+
369
+ /**
370
+ * The type of the usage object. Always `tokens` for this variant.
371
+ */
372
+ type: 'tokens';
373
+
374
+ /**
375
+ * Details about the input tokens billed for this request.
376
+ */
377
+ input_token_details?: TranscriptTextUsageTokens.InputTokenDetails;
378
+ }
379
+
380
+ export namespace TranscriptTextUsageTokens {
381
+ /**
382
+ * Details about the input tokens billed for this request.
383
+ */
384
+ export interface InputTokenDetails {
385
+ /**
386
+ * Number of audio tokens billed for this request.
387
+ */
388
+ audio_tokens?: number;
389
+
390
+ /**
391
+ * Number of text tokens billed for this request.
392
+ */
393
+ text_tokens?: number;
394
+ }
395
+ }
396
+
397
+ /**
398
+ * Usage statistics for models billed by audio input duration.
399
+ */
400
+ export interface TranscriptTextUsageDuration {
401
+ /**
402
+ * Duration of the input audio in seconds.
403
+ */
404
+ seconds: number;
405
+
406
+ /**
407
+ * The type of the usage object. Always `duration` for this variant.
408
+ */
409
+ type: 'duration';
410
+ }
411
+ }
412
+
413
+ /**
414
+ * Returned when the text value of an input audio transcription content part is
415
+ * updated with incremental transcription results.
416
+ */
417
+ export interface ConversationItemInputAudioTranscriptionDeltaEvent {
418
+ /**
419
+ * The unique ID of the server event.
420
+ */
421
+ event_id: string;
422
+
423
+ /**
424
+ * The ID of the item containing the audio that is being transcribed.
425
+ */
426
+ item_id: string;
427
+
428
+ /**
429
+ * The event type, must be `conversation.item.input_audio_transcription.delta`.
430
+ */
431
+ type: 'conversation.item.input_audio_transcription.delta';
432
+
433
+ /**
434
+ * The index of the content part in the item's content array.
435
+ */
436
+ content_index?: number;
437
+
438
+ /**
439
+ * The text delta.
440
+ */
441
+ delta?: string;
442
+
443
+ /**
444
+ * The log probabilities of the transcription. These can be enabled by
445
+ * configurating the session with
446
+ * `"include": ["item.input_audio_transcription.logprobs"]`. Each entry in the
447
+ * array corresponds a log probability of which token would be selected for this
448
+ * chunk of transcription. This can help to identify if it was possible there were
449
+ * multiple valid options for a given chunk of transcription.
450
+ */
451
+ logprobs?: Array<LogProbProperties> | null;
452
+ }
453
+
454
+ /**
455
+ * Returned when input audio transcription is configured, and a transcription
456
+ * request for a user message failed. These events are separate from other `error`
457
+ * events so that the client can identify the related Item.
458
+ */
459
+ export interface ConversationItemInputAudioTranscriptionFailedEvent {
460
+ /**
461
+ * The index of the content part containing the audio.
462
+ */
463
+ content_index: number;
464
+
465
+ /**
466
+ * Details of the transcription error.
467
+ */
468
+ error: ConversationItemInputAudioTranscriptionFailedEvent.Error;
469
+
470
+ /**
471
+ * The unique ID of the server event.
472
+ */
473
+ event_id: string;
474
+
475
+ /**
476
+ * The ID of the user message item.
477
+ */
478
+ item_id: string;
479
+
480
+ /**
481
+ * The event type, must be `conversation.item.input_audio_transcription.failed`.
482
+ */
483
+ type: 'conversation.item.input_audio_transcription.failed';
484
+ }
485
+
486
+ export namespace ConversationItemInputAudioTranscriptionFailedEvent {
487
+ /**
488
+ * Details of the transcription error.
489
+ */
490
+ export interface Error {
491
+ /**
492
+ * Error code, if any.
493
+ */
494
+ code?: string;
495
+
496
+ /**
497
+ * A human-readable error message.
498
+ */
499
+ message?: string;
500
+
501
+ /**
502
+ * Parameter related to the error, if any.
503
+ */
504
+ param?: string;
505
+
506
+ /**
507
+ * The type of error.
508
+ */
509
+ type?: string;
510
+ }
511
+ }
512
+
513
+ /**
514
+ * Returned when an input audio transcription segment is identified for an item.
515
+ */
516
+ export interface ConversationItemInputAudioTranscriptionSegment {
517
+ /**
518
+ * The segment identifier.
519
+ */
520
+ id: string;
521
+
522
+ /**
523
+ * The index of the input audio content part within the item.
524
+ */
525
+ content_index: number;
526
+
527
+ /**
528
+ * End time of the segment in seconds.
529
+ */
530
+ end: number;
531
+
532
+ /**
533
+ * The unique ID of the server event.
534
+ */
535
+ event_id: string;
536
+
537
+ /**
538
+ * The ID of the item containing the input audio content.
539
+ */
540
+ item_id: string;
541
+
542
+ /**
543
+ * The detected speaker label for this segment.
544
+ */
545
+ speaker: string;
546
+
547
+ /**
548
+ * Start time of the segment in seconds.
549
+ */
550
+ start: number;
551
+
552
+ /**
553
+ * The text for this segment.
554
+ */
555
+ text: string;
556
+
557
+ /**
558
+ * The event type, must be `conversation.item.input_audio_transcription.segment`.
559
+ */
560
+ type: 'conversation.item.input_audio_transcription.segment';
561
+ }
562
+
563
+ /**
564
+ * Send this event when you want to retrieve the server's representation of a
565
+ * specific item in the conversation history. This is useful, for example, to
566
+ * inspect user audio after noise cancellation and VAD. The server will respond
567
+ * with a `conversation.item.retrieved` event, unless the item does not exist in
568
+ * the conversation history, in which case the server will respond with an error.
569
+ */
570
+ export interface ConversationItemRetrieveEvent {
571
+ /**
572
+ * The ID of the item to retrieve.
573
+ */
574
+ item_id: string;
575
+
576
+ /**
577
+ * The event type, must be `conversation.item.retrieve`.
578
+ */
579
+ type: 'conversation.item.retrieve';
580
+
581
+ /**
582
+ * Optional client-generated ID used to identify this event.
583
+ */
584
+ event_id?: string;
585
+ }
586
+
587
+ /**
588
+ * Send this event to truncate a previous assistant message’s audio. The server
589
+ * will produce audio faster than realtime, so this event is useful when the user
590
+ * interrupts to truncate audio that has already been sent to the client but not
591
+ * yet played. This will synchronize the server's understanding of the audio with
592
+ * the client's playback.
593
+ *
594
+ * Truncating audio will delete the server-side text transcript to ensure there is
595
+ * not text in the context that hasn't been heard by the user.
596
+ *
597
+ * If successful, the server will respond with a `conversation.item.truncated`
598
+ * event.
599
+ */
600
+ export interface ConversationItemTruncateEvent {
601
+ /**
602
+ * Inclusive duration up to which audio is truncated, in milliseconds. If the
603
+ * audio_end_ms is greater than the actual audio duration, the server will respond
604
+ * with an error.
605
+ */
606
+ audio_end_ms: number;
607
+
608
+ /**
609
+ * The index of the content part to truncate. Set this to `0`.
610
+ */
611
+ content_index: number;
612
+
613
+ /**
614
+ * The ID of the assistant message item to truncate. Only assistant message items
615
+ * can be truncated.
616
+ */
617
+ item_id: string;
618
+
619
+ /**
620
+ * The event type, must be `conversation.item.truncate`.
621
+ */
622
+ type: 'conversation.item.truncate';
623
+
624
+ /**
625
+ * Optional client-generated ID used to identify this event.
626
+ */
627
+ event_id?: string;
628
+ }
629
+
630
+ /**
631
+ * Returned when an earlier assistant audio message item is truncated by the client
632
+ * with a `conversation.item.truncate` event. This event is used to synchronize the
633
+ * server's understanding of the audio with the client's playback.
634
+ *
635
+ * This action will truncate the audio and remove the server-side text transcript
636
+ * to ensure there is no text in the context that hasn't been heard by the user.
637
+ */
638
+ export interface ConversationItemTruncatedEvent {
639
+ /**
640
+ * The duration up to which the audio was truncated, in milliseconds.
641
+ */
642
+ audio_end_ms: number;
643
+
644
+ /**
645
+ * The index of the content part that was truncated.
646
+ */
647
+ content_index: number;
648
+
649
+ /**
650
+ * The unique ID of the server event.
651
+ */
652
+ event_id: string;
653
+
654
+ /**
655
+ * The ID of the assistant message item that was truncated.
656
+ */
657
+ item_id: string;
658
+
659
+ /**
660
+ * The event type, must be `conversation.item.truncated`.
661
+ */
662
+ type: 'conversation.item.truncated';
663
+ }
664
+
665
+ /**
666
+ * The item to add to the conversation.
667
+ */
668
+ export interface ConversationItemWithReference {
669
+ /**
670
+ * For an item of type (`message` | `function_call` | `function_call_output`) this
671
+ * field allows the client to assign the unique ID of the item. It is not required
672
+ * because the server will generate one if not provided.
673
+ *
674
+ * For an item of type `item_reference`, this field is required and is a reference
675
+ * to any item that has previously existed in the conversation.
676
+ */
677
+ id?: string;
678
+
679
+ /**
680
+ * The arguments of the function call (for `function_call` items).
681
+ */
682
+ arguments?: string;
683
+
684
+ /**
685
+ * The ID of the function call (for `function_call` and `function_call_output`
686
+ * items). If passed on a `function_call_output` item, the server will check that a
687
+ * `function_call` item with the same ID exists in the conversation history.
688
+ */
689
+ call_id?: string;
690
+
691
+ /**
692
+ * The content of the message, applicable for `message` items.
693
+ *
694
+ * - Message items of role `system` support only `input_text` content
695
+ * - Message items of role `user` support `input_text` and `input_audio` content
696
+ * - Message items of role `assistant` support `text` content.
697
+ */
698
+ content?: Array<ConversationItemWithReference.Content>;
699
+
700
+ /**
701
+ * The name of the function being called (for `function_call` items).
702
+ */
703
+ name?: string;
704
+
705
+ /**
706
+ * Identifier for the API object being returned - always `realtime.item`.
707
+ */
708
+ object?: 'realtime.item';
709
+
710
+ /**
711
+ * The output of the function call (for `function_call_output` items).
712
+ */
713
+ output?: string;
714
+
715
+ /**
716
+ * The role of the message sender (`user`, `assistant`, `system`), only applicable
717
+ * for `message` items.
718
+ */
719
+ role?: 'user' | 'assistant' | 'system';
720
+
721
+ /**
722
+ * The status of the item (`completed`, `incomplete`, `in_progress`). These have no
723
+ * effect on the conversation, but are accepted for consistency with the
724
+ * `conversation.item.created` event.
725
+ */
726
+ status?: 'completed' | 'incomplete' | 'in_progress';
727
+
728
+ /**
729
+ * The type of the item (`message`, `function_call`, `function_call_output`,
730
+ * `item_reference`).
731
+ */
732
+ type?: 'message' | 'function_call' | 'function_call_output' | 'item_reference';
733
+ }
734
+
735
+ export namespace ConversationItemWithReference {
736
+ export interface Content {
737
+ /**
738
+ * ID of a previous conversation item to reference (for `item_reference` content
739
+ * types in `response.create` events). These can reference both client and server
740
+ * created items.
741
+ */
742
+ id?: string;
743
+
744
+ /**
745
+ * Base64-encoded audio bytes, used for `input_audio` content type.
746
+ */
747
+ audio?: string;
748
+
749
+ /**
750
+ * The text content, used for `input_text` and `text` content types.
751
+ */
752
+ text?: string;
753
+
754
+ /**
755
+ * The transcript of the audio, used for `input_audio` content type.
756
+ */
757
+ transcript?: string;
758
+
759
+ /**
760
+ * The content type (`input_text`, `input_audio`, `item_reference`, `text`).
761
+ */
762
+ type?: 'input_text' | 'input_audio' | 'item_reference' | 'text';
763
+ }
764
+ }
765
+
766
+ /**
767
+ * Send this event to append audio bytes to the input audio buffer. The audio
768
+ * buffer is temporary storage you can write to and later commit. A "commit" will
769
+ * create a new user message item in the conversation history from the buffer
770
+ * content and clear the buffer. Input audio transcription (if enabled) will be
771
+ * generated when the buffer is committed.
772
+ *
773
+ * If VAD is enabled the audio buffer is used to detect speech and the server will
774
+ * decide when to commit. When Server VAD is disabled, you must commit the audio
775
+ * buffer manually. Input audio noise reduction operates on writes to the audio
776
+ * buffer.
777
+ *
778
+ * The client may choose how much audio to place in each event up to a maximum of
779
+ * 15 MiB, for example streaming smaller chunks from the client may allow the VAD
780
+ * to be more responsive. Unlike most other client events, the server will not send
781
+ * a confirmation response to this event.
782
+ */
783
+ export interface InputAudioBufferAppendEvent {
784
+ /**
785
+ * Base64-encoded audio bytes. This must be in the format specified by the
786
+ * `input_audio_format` field in the session configuration.
787
+ */
788
+ audio: string;
789
+
790
+ /**
791
+ * The event type, must be `input_audio_buffer.append`.
792
+ */
793
+ type: 'input_audio_buffer.append';
794
+
795
+ /**
796
+ * Optional client-generated ID used to identify this event.
797
+ */
798
+ event_id?: string;
799
+ }
800
+
801
+ /**
802
+ * Send this event to clear the audio bytes in the buffer. The server will respond
803
+ * with an `input_audio_buffer.cleared` event.
804
+ */
805
+ export interface InputAudioBufferClearEvent {
806
+ /**
807
+ * The event type, must be `input_audio_buffer.clear`.
808
+ */
809
+ type: 'input_audio_buffer.clear';
810
+
811
+ /**
812
+ * Optional client-generated ID used to identify this event.
813
+ */
814
+ event_id?: string;
815
+ }
816
+
817
+ /**
818
+ * Returned when the input audio buffer is cleared by the client with a
819
+ * `input_audio_buffer.clear` event.
820
+ */
821
+ export interface InputAudioBufferClearedEvent {
822
+ /**
823
+ * The unique ID of the server event.
824
+ */
825
+ event_id: string;
826
+
827
+ /**
828
+ * The event type, must be `input_audio_buffer.cleared`.
829
+ */
830
+ type: 'input_audio_buffer.cleared';
831
+ }
832
+
833
+ /**
834
+ * Send this event to commit the user input audio buffer, which will create a new
835
+ * user message item in the conversation. This event will produce an error if the
836
+ * input audio buffer is empty. When in Server VAD mode, the client does not need
837
+ * to send this event, the server will commit the audio buffer automatically.
838
+ *
839
+ * Committing the input audio buffer will trigger input audio transcription (if
840
+ * enabled in session configuration), but it will not create a response from the
841
+ * model. The server will respond with an `input_audio_buffer.committed` event.
842
+ */
843
+ export interface InputAudioBufferCommitEvent {
844
+ /**
845
+ * The event type, must be `input_audio_buffer.commit`.
846
+ */
847
+ type: 'input_audio_buffer.commit';
848
+
849
+ /**
850
+ * Optional client-generated ID used to identify this event.
851
+ */
852
+ event_id?: string;
853
+ }
854
+
855
+ /**
856
+ * Returned when an input audio buffer is committed, either by the client or
857
+ * automatically in server VAD mode. The `item_id` property is the ID of the user
858
+ * message item that will be created, thus a `conversation.item.created` event will
859
+ * also be sent to the client.
860
+ */
861
+ export interface InputAudioBufferCommittedEvent {
862
+ /**
863
+ * The unique ID of the server event.
864
+ */
865
+ event_id: string;
866
+
867
+ /**
868
+ * The ID of the user message item that will be created.
869
+ */
870
+ item_id: string;
871
+
872
+ /**
873
+ * The event type, must be `input_audio_buffer.committed`.
874
+ */
875
+ type: 'input_audio_buffer.committed';
876
+
877
+ /**
878
+ * The ID of the preceding item after which the new item will be inserted. Can be
879
+ * `null` if the item has no predecessor.
880
+ */
881
+ previous_item_id?: string | null;
882
+ }
883
+
884
+ /**
885
+ * **SIP Only:** Returned when an DTMF event is received. A DTMF event is a message
886
+ * that represents a telephone keypad press (0–9, \*, #, A–D). The `event` property
887
+ * is the keypad that the user press. The `received_at` is the UTC Unix Timestamp
888
+ * that the server received the event.
889
+ */
890
+ export interface InputAudioBufferDtmfEventReceivedEvent {
891
+ /**
892
+ * The telephone keypad that was pressed by the user.
893
+ */
894
+ event: string;
895
+
896
+ /**
897
+ * UTC Unix Timestamp when DTMF Event was received by server.
898
+ */
899
+ received_at: number;
900
+
901
+ /**
902
+ * The event type, must be `input_audio_buffer.dtmf_event_received`.
903
+ */
904
+ type: 'input_audio_buffer.dtmf_event_received';
905
+ }
906
+
907
+ /**
908
+ * Sent by the server when in `server_vad` mode to indicate that speech has been
909
+ * detected in the audio buffer. This can happen any time audio is added to the
910
+ * buffer (unless speech is already detected). The client may want to use this
911
+ * event to interrupt audio playback or provide visual feedback to the user.
912
+ *
913
+ * The client should expect to receive a `input_audio_buffer.speech_stopped` event
914
+ * when speech stops. The `item_id` property is the ID of the user message item
915
+ * that will be created when speech stops and will also be included in the
916
+ * `input_audio_buffer.speech_stopped` event (unless the client manually commits
917
+ * the audio buffer during VAD activation).
918
+ */
919
+ export interface InputAudioBufferSpeechStartedEvent {
920
+ /**
921
+ * Milliseconds from the start of all audio written to the buffer during the
922
+ * session when speech was first detected. This will correspond to the beginning of
923
+ * audio sent to the model, and thus includes the `prefix_padding_ms` configured in
924
+ * the Session.
925
+ */
926
+ audio_start_ms: number;
927
+
928
+ /**
929
+ * The unique ID of the server event.
930
+ */
931
+ event_id: string;
932
+
933
+ /**
934
+ * The ID of the user message item that will be created when speech stops.
935
+ */
936
+ item_id: string;
937
+
938
+ /**
939
+ * The event type, must be `input_audio_buffer.speech_started`.
940
+ */
941
+ type: 'input_audio_buffer.speech_started';
942
+ }
943
+
944
+ /**
945
+ * Returned in `server_vad` mode when the server detects the end of speech in the
946
+ * audio buffer. The server will also send an `conversation.item.created` event
947
+ * with the user message item that is created from the audio buffer.
948
+ */
949
+ export interface InputAudioBufferSpeechStoppedEvent {
950
+ /**
951
+ * Milliseconds since the session started when speech stopped. This will correspond
952
+ * to the end of audio sent to the model, and thus includes the
953
+ * `min_silence_duration_ms` configured in the Session.
954
+ */
955
+ audio_end_ms: number;
956
+
957
+ /**
958
+ * The unique ID of the server event.
959
+ */
960
+ event_id: string;
961
+
962
+ /**
963
+ * The ID of the user message item that will be created.
964
+ */
965
+ item_id: string;
966
+
967
+ /**
968
+ * The event type, must be `input_audio_buffer.speech_stopped`.
969
+ */
970
+ type: 'input_audio_buffer.speech_stopped';
971
+ }
972
+
973
+ /**
974
+ * Returned when the Server VAD timeout is triggered for the input audio buffer.
975
+ * This is configured with `idle_timeout_ms` in the `turn_detection` settings of
976
+ * the session, and it indicates that there hasn't been any speech detected for the
977
+ * configured duration.
978
+ *
979
+ * The `audio_start_ms` and `audio_end_ms` fields indicate the segment of audio
980
+ * after the last model response up to the triggering time, as an offset from the
981
+ * beginning of audio written to the input audio buffer. This means it demarcates
982
+ * the segment of audio that was silent and the difference between the start and
983
+ * end values will roughly match the configured timeout.
984
+ *
985
+ * The empty audio will be committed to the conversation as an `input_audio` item
986
+ * (there will be a `input_audio_buffer.committed` event) and a model response will
987
+ * be generated. There may be speech that didn't trigger VAD but is still detected
988
+ * by the model, so the model may respond with something relevant to the
989
+ * conversation or a prompt to continue speaking.
990
+ */
991
+ export interface InputAudioBufferTimeoutTriggered {
992
+ /**
993
+ * Millisecond offset of audio written to the input audio buffer at the time the
994
+ * timeout was triggered.
995
+ */
996
+ audio_end_ms: number;
997
+
998
+ /**
999
+ * Millisecond offset of audio written to the input audio buffer that was after the
1000
+ * playback time of the last model response.
1001
+ */
1002
+ audio_start_ms: number;
1003
+
1004
+ /**
1005
+ * The unique ID of the server event.
1006
+ */
1007
+ event_id: string;
1008
+
1009
+ /**
1010
+ * The ID of the item associated with this segment.
1011
+ */
1012
+ item_id: string;
1013
+
1014
+ /**
1015
+ * The event type, must be `input_audio_buffer.timeout_triggered`.
1016
+ */
1017
+ type: 'input_audio_buffer.timeout_triggered';
1018
+ }
1019
+
1020
+ /**
1021
+ * A log probability object.
1022
+ */
1023
+ export interface LogProbProperties {
1024
+ /**
1025
+ * The token that was used to generate the log probability.
1026
+ */
1027
+ token: string;
1028
+
1029
+ /**
1030
+ * The bytes that were used to generate the log probability.
1031
+ */
1032
+ bytes: Array<number>;
1033
+
1034
+ /**
1035
+ * The log probability of the token.
1036
+ */
1037
+ logprob: number;
1038
+ }
1039
+
1040
+ /**
1041
+ * Returned when listing MCP tools has completed for an item.
1042
+ */
1043
+ export interface McpListToolsCompleted {
1044
+ /**
1045
+ * The unique ID of the server event.
1046
+ */
1047
+ event_id: string;
1048
+
1049
+ /**
1050
+ * The ID of the MCP list tools item.
1051
+ */
1052
+ item_id: string;
1053
+
1054
+ /**
1055
+ * The event type, must be `mcp_list_tools.completed`.
1056
+ */
1057
+ type: 'mcp_list_tools.completed';
1058
+ }
1059
+
1060
+ /**
1061
+ * Returned when listing MCP tools has failed for an item.
1062
+ */
1063
+ export interface McpListToolsFailed {
1064
+ /**
1065
+ * The unique ID of the server event.
1066
+ */
1067
+ event_id: string;
1068
+
1069
+ /**
1070
+ * The ID of the MCP list tools item.
1071
+ */
1072
+ item_id: string;
1073
+
1074
+ /**
1075
+ * The event type, must be `mcp_list_tools.failed`.
1076
+ */
1077
+ type: 'mcp_list_tools.failed';
1078
+ }
1079
+
1080
+ /**
1081
+ * Returned when listing MCP tools is in progress for an item.
1082
+ */
1083
+ export interface McpListToolsInProgress {
1084
+ /**
1085
+ * The unique ID of the server event.
1086
+ */
1087
+ event_id: string;
1088
+
1089
+ /**
1090
+ * The ID of the MCP list tools item.
1091
+ */
1092
+ item_id: string;
1093
+
1094
+ /**
1095
+ * The event type, must be `mcp_list_tools.in_progress`.
1096
+ */
1097
+ type: 'mcp_list_tools.in_progress';
1098
+ }
1099
+
1100
+ /**
1101
+ * Type of noise reduction. `near_field` is for close-talking microphones such as
1102
+ * headphones, `far_field` is for far-field microphones such as laptop or
1103
+ * conference room microphones.
1104
+ */
1105
+ export type NoiseReductionType = 'near_field' | 'far_field';
1106
+
1107
+ /**
1108
+ * **WebRTC/SIP Only:** Emit to cut off the current audio response. This will
1109
+ * trigger the server to stop generating audio and emit a
1110
+ * `output_audio_buffer.cleared` event. This event should be preceded by a
1111
+ * `response.cancel` client event to stop the generation of the current response.
1112
+ * [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
1113
+ */
1114
+ export interface OutputAudioBufferClearEvent {
1115
+ /**
1116
+ * The event type, must be `output_audio_buffer.clear`.
1117
+ */
1118
+ type: 'output_audio_buffer.clear';
1119
+
1120
+ /**
1121
+ * The unique ID of the client event used for error handling.
1122
+ */
1123
+ event_id?: string;
1124
+ }
1125
+
1126
+ /**
1127
+ * Emitted at the beginning of a Response to indicate the updated rate limits. When
1128
+ * a Response is created some tokens will be "reserved" for the output tokens, the
1129
+ * rate limits shown here reflect that reservation, which is then adjusted
1130
+ * accordingly once the Response is completed.
1131
+ */
1132
+ export interface RateLimitsUpdatedEvent {
1133
+ /**
1134
+ * The unique ID of the server event.
1135
+ */
1136
+ event_id: string;
1137
+
1138
+ /**
1139
+ * List of rate limit information.
1140
+ */
1141
+ rate_limits: Array<RateLimitsUpdatedEvent.RateLimit>;
1142
+
1143
+ /**
1144
+ * The event type, must be `rate_limits.updated`.
1145
+ */
1146
+ type: 'rate_limits.updated';
1147
+ }
1148
+
1149
+ export namespace RateLimitsUpdatedEvent {
1150
+ export interface RateLimit {
1151
+ /**
1152
+ * The maximum allowed value for the rate limit.
1153
+ */
1154
+ limit?: number;
1155
+
1156
+ /**
1157
+ * The name of the rate limit (`requests`, `tokens`).
1158
+ */
1159
+ name?: 'requests' | 'tokens';
1160
+
1161
+ /**
1162
+ * The remaining value before the limit is reached.
1163
+ */
1164
+ remaining?: number;
1165
+
1166
+ /**
1167
+ * Seconds until the rate limit resets.
1168
+ */
1169
+ reset_seconds?: number;
1170
+ }
1171
+ }
1172
+
1173
+ /**
1174
+ * Configuration for input and output audio.
1175
+ */
1176
+ export interface RealtimeAudioConfig {
1177
+ input?: RealtimeAudioConfigInput;
1178
+
1179
+ output?: RealtimeAudioConfigOutput;
1180
+ }
1181
+
1182
+ export interface RealtimeAudioConfigInput {
1183
+ /**
1184
+ * The format of the input audio.
1185
+ */
1186
+ format?: RealtimeAudioFormats;
1187
+
1188
+ /**
1189
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
1190
+ * off. Noise reduction filters audio added to the input audio buffer before it is
1191
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
1192
+ * detection accuracy (reducing false positives) and model performance by improving
1193
+ * perception of the input audio.
1194
+ */
1195
+ noise_reduction?: RealtimeAudioConfigInput.NoiseReduction;
1196
+
1197
+ /**
1198
+ * Configuration for input audio transcription, defaults to off and can be set to
1199
+ * `null` to turn off once on. Input audio transcription is not native to the
1200
+ * model, since the model consumes audio directly. Transcription runs
1201
+ * asynchronously through
1202
+ * [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
1203
+ * and should be treated as guidance of input audio content rather than precisely
1204
+ * what the model heard. The client can optionally set the language and prompt for
1205
+ * transcription, these offer additional guidance to the transcription service.
1206
+ */
1207
+ transcription?: AudioTranscription;
1208
+
1209
+ /**
1210
+ * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
1211
+ * set to `null` to turn off, in which case the client must manually trigger model
1212
+ * response.
1213
+ *
1214
+ * Server VAD means that the model will detect the start and end of speech based on
1215
+ * audio volume and respond at the end of user speech.
1216
+ *
1217
+ * Semantic VAD is more advanced and uses a turn detection model (in conjunction
1218
+ * with VAD) to semantically estimate whether the user has finished speaking, then
1219
+ * dynamically sets a timeout based on this probability. For example, if user audio
1220
+ * trails off with "uhhm", the model will score a low probability of turn end and
1221
+ * wait longer for the user to continue speaking. This can be useful for more
1222
+ * natural conversations, but may have a higher latency.
1223
+ */
1224
+ turn_detection?: RealtimeAudioInputTurnDetection | null;
1225
+ }
1226
+
1227
+ export namespace RealtimeAudioConfigInput {
1228
+ /**
1229
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
1230
+ * off. Noise reduction filters audio added to the input audio buffer before it is
1231
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
1232
+ * detection accuracy (reducing false positives) and model performance by improving
1233
+ * perception of the input audio.
1234
+ */
1235
+ export interface NoiseReduction {
1236
+ /**
1237
+ * Type of noise reduction. `near_field` is for close-talking microphones such as
1238
+ * headphones, `far_field` is for far-field microphones such as laptop or
1239
+ * conference room microphones.
1240
+ */
1241
+ type?: RealtimeAPI.NoiseReductionType;
1242
+ }
1243
+ }
1244
+
1245
+ export interface RealtimeAudioConfigOutput {
1246
+ /**
1247
+ * The format of the output audio.
1248
+ */
1249
+ format?: RealtimeAudioFormats;
1250
+
1251
+ /**
1252
+ * The speed of the model's spoken response as a multiple of the original speed.
1253
+ * 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
1254
+ * This value can only be changed in between model turns, not while a response is
1255
+ * in progress.
1256
+ *
1257
+ * This parameter is a post-processing adjustment to the audio after it is
1258
+ * generated, it's also possible to prompt the model to speak faster or slower.
1259
+ */
1260
+ speed?: number;
1261
+
1262
+ /**
1263
+ * The voice the model uses to respond. Supported built-in voices are `alloy`,
1264
+ * `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
1265
+ * `cedar`. Voice cannot be changed during the session once the model has responded
1266
+ * with audio at least once. We recommend `marin` and `cedar` for best quality.
1267
+ */
1268
+ voice?:
1269
+ | (string & {})
1270
+ | 'alloy'
1271
+ | 'ash'
1272
+ | 'ballad'
1273
+ | 'coral'
1274
+ | 'echo'
1275
+ | 'sage'
1276
+ | 'shimmer'
1277
+ | 'verse'
1278
+ | 'marin'
1279
+ | 'cedar';
1280
+ }
1281
+
1282
+ /**
1283
+ * The PCM audio format. Only a 24kHz sample rate is supported.
1284
+ */
1285
+ export type RealtimeAudioFormats =
1286
+ | RealtimeAudioFormats.AudioPCM
1287
+ | RealtimeAudioFormats.AudioPCMU
1288
+ | RealtimeAudioFormats.AudioPCMA;
1289
+
1290
+ export namespace RealtimeAudioFormats {
1291
+ /**
1292
+ * The PCM audio format. Only a 24kHz sample rate is supported.
1293
+ */
1294
+ export interface AudioPCM {
1295
+ /**
1296
+ * The sample rate of the audio. Always `24000`.
1297
+ */
1298
+ rate?: 24000;
1299
+
1300
+ /**
1301
+ * The audio format. Always `audio/pcm`.
1302
+ */
1303
+ type?: 'audio/pcm';
1304
+ }
1305
+
1306
+ /**
1307
+ * The G.711 μ-law format.
1308
+ */
1309
+ export interface AudioPCMU {
1310
+ /**
1311
+ * The audio format. Always `audio/pcmu`.
1312
+ */
1313
+ type?: 'audio/pcmu';
1314
+ }
1315
+
1316
+ /**
1317
+ * The G.711 A-law format.
1318
+ */
1319
+ export interface AudioPCMA {
1320
+ /**
1321
+ * The audio format. Always `audio/pcma`.
1322
+ */
1323
+ type?: 'audio/pcma';
1324
+ }
1325
+ }
1326
+
1327
+ /**
1328
+ * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
1329
+ * set to `null` to turn off, in which case the client must manually trigger model
1330
+ * response.
1331
+ *
1332
+ * Server VAD means that the model will detect the start and end of speech based on
1333
+ * audio volume and respond at the end of user speech.
1334
+ *
1335
+ * Semantic VAD is more advanced and uses a turn detection model (in conjunction
1336
+ * with VAD) to semantically estimate whether the user has finished speaking, then
1337
+ * dynamically sets a timeout based on this probability. For example, if user audio
1338
+ * trails off with "uhhm", the model will score a low probability of turn end and
1339
+ * wait longer for the user to continue speaking. This can be useful for more
1340
+ * natural conversations, but may have a higher latency.
1341
+ */
1342
+ export type RealtimeAudioInputTurnDetection =
1343
+ | RealtimeAudioInputTurnDetection.ServerVad
1344
+ | RealtimeAudioInputTurnDetection.SemanticVad;
1345
+
1346
+ export namespace RealtimeAudioInputTurnDetection {
1347
+ /**
1348
+ * Server-side voice activity detection (VAD) which flips on when user speech is
1349
+ * detected and off after a period of silence.
1350
+ */
1351
+ export interface ServerVad {
1352
+ /**
1353
+ * Type of turn detection, `server_vad` to turn on simple Server VAD.
1354
+ */
1355
+ type: 'server_vad';
1356
+
1357
+ /**
1358
+ * Whether or not to automatically generate a response when a VAD stop event
1359
+ * occurs. If `interrupt_response` is set to `false` this may fail to create a
1360
+ * response if the model is already responding.
1361
+ *
1362
+ * If both `create_response` and `interrupt_response` are set to `false`, the model
1363
+ * will never respond automatically but VAD events will still be emitted.
1364
+ */
1365
+ create_response?: boolean;
1366
+
1367
+ /**
1368
+ * Optional timeout after which a model response will be triggered automatically.
1369
+ * This is useful for situations in which a long pause from the user is unexpected,
1370
+ * such as a phone call. The model will effectively prompt the user to continue the
1371
+ * conversation based on the current context.
1372
+ *
1373
+ * The timeout value will be applied after the last model response's audio has
1374
+ * finished playing, i.e. it's set to the `response.done` time plus audio playback
1375
+ * duration.
1376
+ *
1377
+ * An `input_audio_buffer.timeout_triggered` event (plus events associated with the
1378
+ * Response) will be emitted when the timeout is reached. Idle timeout is currently
1379
+ * only supported for `server_vad` mode.
1380
+ */
1381
+ idle_timeout_ms?: number | null;
1382
+
1383
+ /**
1384
+ * Whether or not to automatically interrupt (cancel) any ongoing response with
1385
+ * output to the default conversation (i.e. `conversation` of `auto`) when a VAD
1386
+ * start event occurs. If `true` then the response will be cancelled, otherwise it
1387
+ * will continue until complete.
1388
+ *
1389
+ * If both `create_response` and `interrupt_response` are set to `false`, the model
1390
+ * will never respond automatically but VAD events will still be emitted.
1391
+ */
1392
+ interrupt_response?: boolean;
1393
+
1394
+ /**
1395
+ * Used only for `server_vad` mode. Amount of audio to include before the VAD
1396
+ * detected speech (in milliseconds). Defaults to 300ms.
1397
+ */
1398
+ prefix_padding_ms?: number;
1399
+
1400
+ /**
1401
+ * Used only for `server_vad` mode. Duration of silence to detect speech stop (in
1402
+ * milliseconds). Defaults to 500ms. With shorter values the model will respond
1403
+ * more quickly, but may jump in on short pauses from the user.
1404
+ */
1405
+ silence_duration_ms?: number;
1406
+
1407
+ /**
1408
+ * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
1409
+ * defaults to 0.5. A higher threshold will require louder audio to activate the
1410
+ * model, and thus might perform better in noisy environments.
1411
+ */
1412
+ threshold?: number;
1413
+ }
1414
+
1415
+ /**
1416
+ * Server-side semantic turn detection which uses a model to determine when the
1417
+ * user has finished speaking.
1418
+ */
1419
+ export interface SemanticVad {
1420
+ /**
1421
+ * Type of turn detection, `semantic_vad` to turn on Semantic VAD.
1422
+ */
1423
+ type: 'semantic_vad';
1424
+
1425
+ /**
1426
+ * Whether or not to automatically generate a response when a VAD stop event
1427
+ * occurs.
1428
+ */
1429
+ create_response?: boolean;
1430
+
1431
+ /**
1432
+ * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
1433
+ * will wait longer for the user to continue speaking, `high` will respond more
1434
+ * quickly. `auto` is the default and is equivalent to `medium`. `low`, `medium`,
1435
+ * and `high` have max timeouts of 8s, 4s, and 2s respectively.
1436
+ */
1437
+ eagerness?: 'low' | 'medium' | 'high' | 'auto';
1438
+
1439
+ /**
1440
+ * Whether or not to automatically interrupt any ongoing response with output to
1441
+ * the default conversation (i.e. `conversation` of `auto`) when a VAD start event
1442
+ * occurs.
1443
+ */
1444
+ interrupt_response?: boolean;
1445
+ }
1446
+ }
1447
+
1448
+ /**
1449
+ * A realtime client event.
1450
+ */
1451
+ export type RealtimeClientEvent =
1452
+ | ConversationItemCreateEvent
1453
+ | ConversationItemDeleteEvent
1454
+ | ConversationItemRetrieveEvent
1455
+ | ConversationItemTruncateEvent
1456
+ | InputAudioBufferAppendEvent
1457
+ | InputAudioBufferClearEvent
1458
+ | OutputAudioBufferClearEvent
1459
+ | InputAudioBufferCommitEvent
1460
+ | ResponseCancelEvent
1461
+ | ResponseCreateEvent
1462
+ | SessionUpdateEvent;
1463
+
1464
+ /**
1465
+ * An assistant message item in a Realtime conversation.
1466
+ */
1467
+ export interface RealtimeConversationItemAssistantMessage {
1468
+ /**
1469
+ * The content of the message.
1470
+ */
1471
+ content: Array<RealtimeConversationItemAssistantMessage.Content>;
1472
+
1473
+ /**
1474
+ * The role of the message sender. Always `assistant`.
1475
+ */
1476
+ role: 'assistant';
1477
+
1478
+ /**
1479
+ * The type of the item. Always `message`.
1480
+ */
1481
+ type: 'message';
1482
+
1483
+ /**
1484
+ * The unique ID of the item. This may be provided by the client or generated by
1485
+ * the server.
1486
+ */
1487
+ id?: string;
1488
+
1489
+ /**
1490
+ * Identifier for the API object being returned - always `realtime.item`. Optional
1491
+ * when creating a new item.
1492
+ */
1493
+ object?: 'realtime.item';
1494
+
1495
+ /**
1496
+ * The status of the item. Has no effect on the conversation.
1497
+ */
1498
+ status?: 'completed' | 'incomplete' | 'in_progress';
1499
+ }
1500
+
1501
+ export namespace RealtimeConversationItemAssistantMessage {
1502
+ export interface Content {
1503
+ /**
1504
+ * Base64-encoded audio bytes, these will be parsed as the format specified in the
1505
+ * session output audio type configuration. This defaults to PCM 16-bit 24kHz mono
1506
+ * if not specified.
1507
+ */
1508
+ audio?: string;
1509
+
1510
+ /**
1511
+ * The text content.
1512
+ */
1513
+ text?: string;
1514
+
1515
+ /**
1516
+ * The transcript of the audio content, this will always be present if the output
1517
+ * type is `audio`.
1518
+ */
1519
+ transcript?: string;
1520
+
1521
+ /**
1522
+ * The content type, `output_text` or `output_audio` depending on the session
1523
+ * `output_modalities` configuration.
1524
+ */
1525
+ type?: 'output_text' | 'output_audio';
1526
+ }
1527
+ }
1528
+
1529
+ /**
1530
+ * A function call item in a Realtime conversation.
1531
+ */
1532
+ export interface RealtimeConversationItemFunctionCall {
1533
+ /**
1534
+ * The arguments of the function call. This is a JSON-encoded string representing
1535
+ * the arguments passed to the function, for example
1536
+ * `{"arg1": "value1", "arg2": 42}`.
1537
+ */
1538
+ arguments: string;
1539
+
1540
+ /**
1541
+ * The name of the function being called.
1542
+ */
1543
+ name: string;
1544
+
1545
+ /**
1546
+ * The type of the item. Always `function_call`.
1547
+ */
1548
+ type: 'function_call';
1549
+
1550
+ /**
1551
+ * The unique ID of the item. This may be provided by the client or generated by
1552
+ * the server.
1553
+ */
1554
+ id?: string;
1555
+
1556
+ /**
1557
+ * The ID of the function call.
1558
+ */
1559
+ call_id?: string;
1560
+
1561
+ /**
1562
+ * Identifier for the API object being returned - always `realtime.item`. Optional
1563
+ * when creating a new item.
1564
+ */
1565
+ object?: 'realtime.item';
1566
+
1567
+ /**
1568
+ * The status of the item. Has no effect on the conversation.
1569
+ */
1570
+ status?: 'completed' | 'incomplete' | 'in_progress';
1571
+ }
1572
+
1573
+ /**
1574
+ * A function call output item in a Realtime conversation.
1575
+ */
1576
+ export interface RealtimeConversationItemFunctionCallOutput {
1577
+ /**
1578
+ * The ID of the function call this output is for.
1579
+ */
1580
+ call_id: string;
1581
+
1582
+ /**
1583
+ * The output of the function call, this is free text and can contain any
1584
+ * information or simply be empty.
1585
+ */
1586
+ output: string;
1587
+
1588
+ /**
1589
+ * The type of the item. Always `function_call_output`.
1590
+ */
1591
+ type: 'function_call_output';
1592
+
1593
+ /**
1594
+ * The unique ID of the item. This may be provided by the client or generated by
1595
+ * the server.
1596
+ */
1597
+ id?: string;
1598
+
1599
+ /**
1600
+ * Identifier for the API object being returned - always `realtime.item`. Optional
1601
+ * when creating a new item.
1602
+ */
1603
+ object?: 'realtime.item';
1604
+
1605
+ /**
1606
+ * The status of the item. Has no effect on the conversation.
1607
+ */
1608
+ status?: 'completed' | 'incomplete' | 'in_progress';
1609
+ }
1610
+
1611
+ /**
1612
+ * A system message in a Realtime conversation can be used to provide additional
1613
+ * context or instructions to the model. This is similar but distinct from the
1614
+ * instruction prompt provided at the start of a conversation, as system messages
1615
+ * can be added at any point in the conversation. For major changes to the
1616
+ * conversation's behavior, use instructions, but for smaller updates (e.g. "the
1617
+ * user is now asking about a different topic"), use system messages.
1618
+ */
1619
+ export interface RealtimeConversationItemSystemMessage {
1620
+ /**
1621
+ * The content of the message.
1622
+ */
1623
+ content: Array<RealtimeConversationItemSystemMessage.Content>;
1624
+
1625
+ /**
1626
+ * The role of the message sender. Always `system`.
1627
+ */
1628
+ role: 'system';
1629
+
1630
+ /**
1631
+ * The type of the item. Always `message`.
1632
+ */
1633
+ type: 'message';
1634
+
1635
+ /**
1636
+ * The unique ID of the item. This may be provided by the client or generated by
1637
+ * the server.
1638
+ */
1639
+ id?: string;
1640
+
1641
+ /**
1642
+ * Identifier for the API object being returned - always `realtime.item`. Optional
1643
+ * when creating a new item.
1644
+ */
1645
+ object?: 'realtime.item';
1646
+
1647
+ /**
1648
+ * The status of the item. Has no effect on the conversation.
1649
+ */
1650
+ status?: 'completed' | 'incomplete' | 'in_progress';
1651
+ }
1652
+
1653
+ export namespace RealtimeConversationItemSystemMessage {
1654
+ export interface Content {
1655
+ /**
1656
+ * The text content.
1657
+ */
1658
+ text?: string;
1659
+
1660
+ /**
1661
+ * The content type. Always `input_text` for system messages.
1662
+ */
1663
+ type?: 'input_text';
1664
+ }
1665
+ }
1666
+
1667
+ /**
1668
+ * A user message item in a Realtime conversation.
1669
+ */
1670
+ export interface RealtimeConversationItemUserMessage {
1671
+ /**
1672
+ * The content of the message.
1673
+ */
1674
+ content: Array<RealtimeConversationItemUserMessage.Content>;
1675
+
1676
+ /**
1677
+ * The role of the message sender. Always `user`.
1678
+ */
1679
+ role: 'user';
1680
+
1681
+ /**
1682
+ * The type of the item. Always `message`.
1683
+ */
1684
+ type: 'message';
1685
+
1686
+ /**
1687
+ * The unique ID of the item. This may be provided by the client or generated by
1688
+ * the server.
1689
+ */
1690
+ id?: string;
1691
+
1692
+ /**
1693
+ * Identifier for the API object being returned - always `realtime.item`. Optional
1694
+ * when creating a new item.
1695
+ */
1696
+ object?: 'realtime.item';
1697
+
1698
+ /**
1699
+ * The status of the item. Has no effect on the conversation.
1700
+ */
1701
+ status?: 'completed' | 'incomplete' | 'in_progress';
1702
+ }
1703
+
1704
+ export namespace RealtimeConversationItemUserMessage {
1705
+ export interface Content {
1706
+ /**
1707
+ * Base64-encoded audio bytes (for `input_audio`), these will be parsed as the
1708
+ * format specified in the session input audio type configuration. This defaults to
1709
+ * PCM 16-bit 24kHz mono if not specified.
1710
+ */
1711
+ audio?: string;
1712
+
1713
+ /**
1714
+ * The detail level of the image (for `input_image`). `auto` will default to
1715
+ * `high`.
1716
+ */
1717
+ detail?: 'auto' | 'low' | 'high';
1718
+
1719
+ /**
1720
+ * Base64-encoded image bytes (for `input_image`) as a data URI. For example
1721
+ * `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...`. Supported formats are PNG
1722
+ * and JPEG.
1723
+ */
1724
+ image_url?: string;
1725
+
1726
+ /**
1727
+ * The text content (for `input_text`).
1728
+ */
1729
+ text?: string;
1730
+
1731
+ /**
1732
+ * Transcript of the audio (for `input_audio`). This is not sent to the model, but
1733
+ * will be attached to the message item for reference.
1734
+ */
1735
+ transcript?: string;
1736
+
1737
+ /**
1738
+ * The content type (`input_text`, `input_audio`, or `input_image`).
1739
+ */
1740
+ type?: 'input_text' | 'input_audio' | 'input_image';
1741
+ }
1742
+ }
1743
+
1744
+ /**
1745
+ * Details of the error.
1746
+ */
1747
+ export interface RealtimeError {
1748
+ /**
1749
+ * A human-readable error message.
1750
+ */
1751
+ message: string;
1752
+
1753
+ /**
1754
+ * The type of error (e.g., "invalid_request_error", "server_error").
1755
+ */
1756
+ type: string;
1757
+
1758
+ /**
1759
+ * Error code, if any.
1760
+ */
1761
+ code?: string | null;
1762
+
1763
+ /**
1764
+ * The event_id of the client event that caused the error, if applicable.
1765
+ */
1766
+ event_id?: string | null;
1767
+
1768
+ /**
1769
+ * Parameter related to the error, if any.
1770
+ */
1771
+ param?: string | null;
1772
+ }
1773
+
1774
+ /**
1775
+ * Returned when an error occurs, which could be a client problem or a server
1776
+ * problem. Most errors are recoverable and the session will stay open, we
1777
+ * recommend to implementors to monitor and log error messages by default.
1778
+ */
1779
+ export interface RealtimeErrorEvent {
1780
+ /**
1781
+ * Details of the error.
1782
+ */
1783
+ error: RealtimeError;
1784
+
1785
+ /**
1786
+ * The unique ID of the server event.
1787
+ */
1788
+ event_id: string;
1789
+
1790
+ /**
1791
+ * The event type, must be `error`.
1792
+ */
1793
+ type: 'error';
1794
+ }
1795
+
1796
+ export interface RealtimeFunctionTool {
1797
+ /**
1798
+ * The description of the function, including guidance on when and how to call it,
1799
+ * and guidance about what to tell the user when calling (if anything).
1800
+ */
1801
+ description?: string;
1802
+
1803
+ /**
1804
+ * The name of the function.
1805
+ */
1806
+ name?: string;
1807
+
1808
+ /**
1809
+ * Parameters of the function in JSON Schema.
1810
+ */
1811
+ parameters?: unknown;
1812
+
1813
+ /**
1814
+ * The type of the tool, i.e. `function`.
1815
+ */
1816
+ type?: 'function';
1817
+ }
1818
+
1819
+ /**
1820
+ * A Realtime item requesting human approval of a tool invocation.
1821
+ */
1822
+ export interface RealtimeMcpApprovalRequest {
1823
+ /**
1824
+ * The unique ID of the approval request.
1825
+ */
1826
+ id: string;
1827
+
1828
+ /**
1829
+ * A JSON string of arguments for the tool.
1830
+ */
1831
+ arguments: string;
1832
+
1833
+ /**
1834
+ * The name of the tool to run.
1835
+ */
1836
+ name: string;
1837
+
1838
+ /**
1839
+ * The label of the MCP server making the request.
1840
+ */
1841
+ server_label: string;
1842
+
1843
+ /**
1844
+ * The type of the item. Always `mcp_approval_request`.
1845
+ */
1846
+ type: 'mcp_approval_request';
1847
+ }
1848
+
1849
+ /**
1850
+ * A Realtime item responding to an MCP approval request.
1851
+ */
1852
+ export interface RealtimeMcpApprovalResponse {
1853
+ /**
1854
+ * The unique ID of the approval response.
1855
+ */
1856
+ id: string;
1857
+
1858
+ /**
1859
+ * The ID of the approval request being answered.
1860
+ */
1861
+ approval_request_id: string;
1862
+
1863
+ /**
1864
+ * Whether the request was approved.
1865
+ */
1866
+ approve: boolean;
1867
+
1868
+ /**
1869
+ * The type of the item. Always `mcp_approval_response`.
1870
+ */
1871
+ type: 'mcp_approval_response';
1872
+
1873
+ /**
1874
+ * Optional reason for the decision.
1875
+ */
1876
+ reason?: string | null;
1877
+ }
1878
+
1879
+ /**
1880
+ * A Realtime item listing tools available on an MCP server.
1881
+ */
1882
+ export interface RealtimeMcpListTools {
1883
+ /**
1884
+ * The label of the MCP server.
1885
+ */
1886
+ server_label: string;
1887
+
1888
+ /**
1889
+ * The tools available on the server.
1890
+ */
1891
+ tools: Array<RealtimeMcpListTools.Tool>;
1892
+
1893
+ /**
1894
+ * The type of the item. Always `mcp_list_tools`.
1895
+ */
1896
+ type: 'mcp_list_tools';
1897
+
1898
+ /**
1899
+ * The unique ID of the list.
1900
+ */
1901
+ id?: string;
1902
+ }
1903
+
1904
+ export namespace RealtimeMcpListTools {
1905
+ /**
1906
+ * A tool available on an MCP server.
1907
+ */
1908
+ export interface Tool {
1909
+ /**
1910
+ * The JSON schema describing the tool's input.
1911
+ */
1912
+ input_schema: unknown;
1913
+
1914
+ /**
1915
+ * The name of the tool.
1916
+ */
1917
+ name: string;
1918
+
1919
+ /**
1920
+ * Additional annotations about the tool.
1921
+ */
1922
+ annotations?: unknown | null;
1923
+
1924
+ /**
1925
+ * The description of the tool.
1926
+ */
1927
+ description?: string | null;
1928
+ }
1929
+ }
1930
+
1931
+ export interface RealtimeMcpProtocolError {
1932
+ code: number;
1933
+
1934
+ message: string;
1935
+
1936
+ type: 'protocol_error';
1937
+ }
1938
+
1939
+ /**
1940
+ * A Realtime item representing an invocation of a tool on an MCP server.
1941
+ */
1942
+ export interface RealtimeMcpToolCall {
1943
+ /**
1944
+ * The unique ID of the tool call.
1945
+ */
1946
+ id: string;
1947
+
1948
+ /**
1949
+ * A JSON string of the arguments passed to the tool.
1950
+ */
1951
+ arguments: string;
1952
+
1953
+ /**
1954
+ * The name of the tool that was run.
1955
+ */
1956
+ name: string;
1957
+
1958
+ /**
1959
+ * The label of the MCP server running the tool.
1960
+ */
1961
+ server_label: string;
1962
+
1963
+ /**
1964
+ * The type of the item. Always `mcp_call`.
1965
+ */
1966
+ type: 'mcp_call';
1967
+
1968
+ /**
1969
+ * The ID of an associated approval request, if any.
1970
+ */
1971
+ approval_request_id?: string | null;
1972
+
1973
+ /**
1974
+ * The error from the tool call, if any.
1975
+ */
1976
+ error?: RealtimeMcpProtocolError | RealtimeMcpToolExecutionError | RealtimeMcphttpError | null;
1977
+
1978
+ /**
1979
+ * The output from the tool call.
1980
+ */
1981
+ output?: string | null;
1982
+ }
1983
+
1984
+ export interface RealtimeMcpToolExecutionError {
1985
+ message: string;
1986
+
1987
+ type: 'tool_execution_error';
1988
+ }
1989
+
1990
+ export interface RealtimeMcphttpError {
1991
+ code: number;
1992
+
1993
+ message: string;
1994
+
1995
+ type: 'http_error';
1996
+ }
1997
+
1998
+ /**
1999
+ * The response resource.
2000
+ */
2001
+ export interface RealtimeResponse {
2002
+ /**
2003
+ * The unique ID of the response, will look like `resp_1234`.
2004
+ */
2005
+ id?: string;
2006
+
2007
+ /**
2008
+ * Configuration for audio output.
2009
+ */
2010
+ audio?: RealtimeResponse.Audio;
2011
+
2012
+ /**
2013
+ * Which conversation the response is added to, determined by the `conversation`
2014
+ * field in the `response.create` event. If `auto`, the response will be added to
2015
+ * the default conversation and the value of `conversation_id` will be an id like
2016
+ * `conv_1234`. If `none`, the response will not be added to any conversation and
2017
+ * the value of `conversation_id` will be `null`. If responses are being triggered
2018
+ * automatically by VAD the response will be added to the default conversation
2019
+ */
2020
+ conversation_id?: string;
2021
+
2022
+ /**
2023
+ * Maximum number of output tokens for a single assistant response, inclusive of
2024
+ * tool calls, that was used in this response.
2025
+ */
2026
+ max_output_tokens?: number | 'inf';
2027
+
2028
+ /**
2029
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
2030
+ * for storing additional information about the object in a structured format, and
2031
+ * querying for objects via API or the dashboard.
2032
+ *
2033
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
2034
+ * a maximum length of 512 characters.
2035
+ */
2036
+ metadata?: Shared.Metadata | null;
2037
+
2038
+ /**
2039
+ * The object type, must be `realtime.response`.
2040
+ */
2041
+ object?: 'realtime.response';
2042
+
2043
+ /**
2044
+ * The list of output items generated by the response.
2045
+ */
2046
+ output?: Array<ConversationItem>;
2047
+
2048
+ /**
2049
+ * The set of modalities the model used to respond, currently the only possible
2050
+ * values are `[\"audio\"]`, `[\"text\"]`. Audio output always include a text
2051
+ * transcript. Setting the output to mode `text` will disable audio output from the
2052
+ * model.
2053
+ */
2054
+ output_modalities?: Array<'text' | 'audio'>;
2055
+
2056
+ /**
2057
+ * The final status of the response (`completed`, `cancelled`, `failed`, or
2058
+ * `incomplete`, `in_progress`).
2059
+ */
2060
+ status?: 'completed' | 'cancelled' | 'failed' | 'incomplete' | 'in_progress';
2061
+
2062
+ /**
2063
+ * Additional details about the status.
2064
+ */
2065
+ status_details?: RealtimeResponseStatus;
2066
+
2067
+ /**
2068
+ * Usage statistics for the Response, this will correspond to billing. A Realtime
2069
+ * API session will maintain a conversation context and append new Items to the
2070
+ * Conversation, thus output from previous turns (text and audio tokens) will
2071
+ * become the input for later turns.
2072
+ */
2073
+ usage?: RealtimeResponseUsage;
2074
+ }
2075
+
2076
+ export namespace RealtimeResponse {
2077
+ /**
2078
+ * Configuration for audio output.
2079
+ */
2080
+ export interface Audio {
2081
+ output?: Audio.Output;
2082
+ }
2083
+
2084
+ export namespace Audio {
2085
+ export interface Output {
2086
+ /**
2087
+ * The format of the output audio.
2088
+ */
2089
+ format?: RealtimeAPI.RealtimeAudioFormats;
2090
+
2091
+ /**
2092
+ * The voice the model uses to respond. Voice cannot be changed during the session
2093
+ * once the model has responded with audio at least once. Current voice options are
2094
+ * `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
2095
+ * and `cedar`. We recommend `marin` and `cedar` for best quality.
2096
+ */
2097
+ voice?:
2098
+ | (string & {})
2099
+ | 'alloy'
2100
+ | 'ash'
2101
+ | 'ballad'
2102
+ | 'coral'
2103
+ | 'echo'
2104
+ | 'sage'
2105
+ | 'shimmer'
2106
+ | 'verse'
2107
+ | 'marin'
2108
+ | 'cedar';
2109
+ }
2110
+ }
2111
+ }
2112
+
2113
+ /**
2114
+ * Configuration for audio input and output.
2115
+ */
2116
+ export interface RealtimeResponseCreateAudioOutput {
2117
+ output?: RealtimeResponseCreateAudioOutput.Output;
2118
+ }
2119
+
2120
+ export namespace RealtimeResponseCreateAudioOutput {
2121
+ export interface Output {
2122
+ /**
2123
+ * The format of the output audio.
2124
+ */
2125
+ format?: RealtimeAPI.RealtimeAudioFormats;
2126
+
2127
+ /**
2128
+ * The voice the model uses to respond. Supported built-in voices are `alloy`,
2129
+ * `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
2130
+ * `cedar`. Voice cannot be changed during the session once the model has responded
2131
+ * with audio at least once.
2132
+ */
2133
+ voice?:
2134
+ | (string & {})
2135
+ | 'alloy'
2136
+ | 'ash'
2137
+ | 'ballad'
2138
+ | 'coral'
2139
+ | 'echo'
2140
+ | 'sage'
2141
+ | 'shimmer'
2142
+ | 'verse'
2143
+ | 'marin'
2144
+ | 'cedar';
2145
+ }
2146
+ }
2147
+
2148
+ /**
2149
+ * Give the model access to additional tools via remote Model Context Protocol
2150
+ * (MCP) servers.
2151
+ * [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
2152
+ */
2153
+ export interface RealtimeResponseCreateMcpTool {
2154
+ /**
2155
+ * A label for this MCP server, used to identify it in tool calls.
2156
+ */
2157
+ server_label: string;
2158
+
2159
+ /**
2160
+ * The type of the MCP tool. Always `mcp`.
2161
+ */
2162
+ type: 'mcp';
2163
+
2164
+ /**
2165
+ * List of allowed tool names or a filter object.
2166
+ */
2167
+ allowed_tools?: Array<string> | RealtimeResponseCreateMcpTool.McpToolFilter | null;
2168
+
2169
+ /**
2170
+ * An OAuth access token that can be used with a remote MCP server, either with a
2171
+ * custom MCP server URL or a service connector. Your application must handle the
2172
+ * OAuth authorization flow and provide the token here.
2173
+ */
2174
+ authorization?: string;
2175
+
2176
+ /**
2177
+ * Identifier for service connectors, like those available in ChatGPT. One of
2178
+ * `server_url` or `connector_id` must be provided. Learn more about service
2179
+ * connectors
2180
+ * [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
2181
+ *
2182
+ * Currently supported `connector_id` values are:
2183
+ *
2184
+ * - Dropbox: `connector_dropbox`
2185
+ * - Gmail: `connector_gmail`
2186
+ * - Google Calendar: `connector_googlecalendar`
2187
+ * - Google Drive: `connector_googledrive`
2188
+ * - Microsoft Teams: `connector_microsoftteams`
2189
+ * - Outlook Calendar: `connector_outlookcalendar`
2190
+ * - Outlook Email: `connector_outlookemail`
2191
+ * - SharePoint: `connector_sharepoint`
2192
+ */
2193
+ connector_id?:
2194
+ | 'connector_dropbox'
2195
+ | 'connector_gmail'
2196
+ | 'connector_googlecalendar'
2197
+ | 'connector_googledrive'
2198
+ | 'connector_microsoftteams'
2199
+ | 'connector_outlookcalendar'
2200
+ | 'connector_outlookemail'
2201
+ | 'connector_sharepoint';
2202
+
2203
+ /**
2204
+ * Optional HTTP headers to send to the MCP server. Use for authentication or other
2205
+ * purposes.
2206
+ */
2207
+ headers?: { [key: string]: string } | null;
2208
+
2209
+ /**
2210
+ * Specify which of the MCP server's tools require approval.
2211
+ */
2212
+ require_approval?: RealtimeResponseCreateMcpTool.McpToolApprovalFilter | 'always' | 'never' | null;
2213
+
2214
+ /**
2215
+ * Optional description of the MCP server, used to provide more context.
2216
+ */
2217
+ server_description?: string;
2218
+
2219
+ /**
2220
+ * The URL for the MCP server. One of `server_url` or `connector_id` must be
2221
+ * provided.
2222
+ */
2223
+ server_url?: string;
2224
+ }
2225
+
2226
+ export namespace RealtimeResponseCreateMcpTool {
2227
+ /**
2228
+ * A filter object to specify which tools are allowed.
2229
+ */
2230
+ export interface McpToolFilter {
2231
+ /**
2232
+ * Indicates whether or not a tool modifies data or is read-only. If an MCP server
2233
+ * is
2234
+ * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
2235
+ * it will match this filter.
2236
+ */
2237
+ read_only?: boolean;
2238
+
2239
+ /**
2240
+ * List of allowed tool names.
2241
+ */
2242
+ tool_names?: Array<string>;
2243
+ }
2244
+
2245
+ /**
2246
+ * Specify which of the MCP server's tools require approval. Can be `always`,
2247
+ * `never`, or a filter object associated with tools that require approval.
2248
+ */
2249
+ export interface McpToolApprovalFilter {
2250
+ /**
2251
+ * A filter object to specify which tools are allowed.
2252
+ */
2253
+ always?: McpToolApprovalFilter.Always;
2254
+
2255
+ /**
2256
+ * A filter object to specify which tools are allowed.
2257
+ */
2258
+ never?: McpToolApprovalFilter.Never;
2259
+ }
2260
+
2261
+ export namespace McpToolApprovalFilter {
2262
+ /**
2263
+ * A filter object to specify which tools are allowed.
2264
+ */
2265
+ export interface Always {
2266
+ /**
2267
+ * Indicates whether or not a tool modifies data or is read-only. If an MCP server
2268
+ * is
2269
+ * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
2270
+ * it will match this filter.
2271
+ */
2272
+ read_only?: boolean;
2273
+
2274
+ /**
2275
+ * List of allowed tool names.
2276
+ */
2277
+ tool_names?: Array<string>;
2278
+ }
2279
+
2280
+ /**
2281
+ * A filter object to specify which tools are allowed.
2282
+ */
2283
+ export interface Never {
2284
+ /**
2285
+ * Indicates whether or not a tool modifies data or is read-only. If an MCP server
2286
+ * is
2287
+ * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
2288
+ * it will match this filter.
2289
+ */
2290
+ read_only?: boolean;
2291
+
2292
+ /**
2293
+ * List of allowed tool names.
2294
+ */
2295
+ tool_names?: Array<string>;
2296
+ }
2297
+ }
2298
+ }
2299
+
2300
+ /**
2301
+ * Create a new Realtime response with these parameters
2302
+ */
2303
+ export interface RealtimeResponseCreateParams {
2304
+ /**
2305
+ * Configuration for audio input and output.
2306
+ */
2307
+ audio?: RealtimeResponseCreateAudioOutput;
2308
+
2309
+ /**
2310
+ * Controls which conversation the response is added to. Currently supports `auto`
2311
+ * and `none`, with `auto` as the default value. The `auto` value means that the
2312
+ * contents of the response will be added to the default conversation. Set this to
2313
+ * `none` to create an out-of-band response which will not add items to default
2314
+ * conversation.
2315
+ */
2316
+ conversation?: (string & {}) | 'auto' | 'none';
2317
+
2318
+ /**
2319
+ * Input items to include in the prompt for the model. Using this field creates a
2320
+ * new context for this Response instead of using the default conversation. An
2321
+ * empty array `[]` will clear the context for this Response. Note that this can
2322
+ * include references to items that previously appeared in the session using their
2323
+ * id.
2324
+ */
2325
+ input?: Array<ConversationItem>;
2326
+
2327
+ /**
2328
+ * The default system instructions (i.e. system message) prepended to model calls.
2329
+ * This field allows the client to guide the model on desired responses. The model
2330
+ * can be instructed on response content and format, (e.g. "be extremely succinct",
2331
+ * "act friendly", "here are examples of good responses") and on audio behavior
2332
+ * (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
2333
+ * instructions are not guaranteed to be followed by the model, but they provide
2334
+ * guidance to the model on the desired behavior. Note that the server sets default
2335
+ * instructions which will be used if this field is not set and are visible in the
2336
+ * `session.created` event at the start of the session.
2337
+ */
2338
+ instructions?: string;
2339
+
2340
+ /**
2341
+ * Maximum number of output tokens for a single assistant response, inclusive of
2342
+ * tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
2343
+ * `inf` for the maximum available tokens for a given model. Defaults to `inf`.
2344
+ */
2345
+ max_output_tokens?: number | 'inf';
2346
+
2347
+ /**
2348
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful
2349
+ * for storing additional information about the object in a structured format, and
2350
+ * querying for objects via API or the dashboard.
2351
+ *
2352
+ * Keys are strings with a maximum length of 64 characters. Values are strings with
2353
+ * a maximum length of 512 characters.
2354
+ */
2355
+ metadata?: Shared.Metadata | null;
2356
+
2357
+ /**
2358
+ * The set of modalities the model used to respond, currently the only possible
2359
+ * values are `[\"audio\"]`, `[\"text\"]`. Audio output always include a text
2360
+ * transcript. Setting the output to mode `text` will disable audio output from the
2361
+ * model.
2362
+ */
2363
+ output_modalities?: Array<'text' | 'audio'>;
2364
+
2365
+ /**
2366
+ * Reference to a prompt template and its variables.
2367
+ * [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
2368
+ */
2369
+ prompt?: ResponsesAPI.ResponsePrompt | null;
2370
+
2371
+ /**
2372
+ * How the model chooses tools. Provide one of the string modes or force a specific
2373
+ * function/MCP tool.
2374
+ */
2375
+ tool_choice?: ResponsesAPI.ToolChoiceOptions | ResponsesAPI.ToolChoiceFunction | ResponsesAPI.ToolChoiceMcp;
2376
+
2377
+ /**
2378
+ * Tools available to the model.
2379
+ */
2380
+ tools?: Array<RealtimeFunctionTool | RealtimeResponseCreateMcpTool>;
2381
+ }
2382
+
2383
+ /**
2384
+ * Additional details about the status.
2385
+ */
2386
+ export interface RealtimeResponseStatus {
2387
+ /**
2388
+ * A description of the error that caused the response to fail, populated when the
2389
+ * `status` is `failed`.
2390
+ */
2391
+ error?: RealtimeResponseStatus.Error;
2392
+
2393
+ /**
2394
+ * The reason the Response did not complete. For a `cancelled` Response, one of
2395
+ * `turn_detected` (the server VAD detected a new start of speech) or
2396
+ * `client_cancelled` (the client sent a cancel event). For an `incomplete`
2397
+ * Response, one of `max_output_tokens` or `content_filter` (the server-side safety
2398
+ * filter activated and cut off the response).
2399
+ */
2400
+ reason?: 'turn_detected' | 'client_cancelled' | 'max_output_tokens' | 'content_filter';
2401
+
2402
+ /**
2403
+ * The type of error that caused the response to fail, corresponding with the
2404
+ * `status` field (`completed`, `cancelled`, `incomplete`, `failed`).
2405
+ */
2406
+ type?: 'completed' | 'cancelled' | 'incomplete' | 'failed';
2407
+ }
2408
+
2409
+ export namespace RealtimeResponseStatus {
2410
+ /**
2411
+ * A description of the error that caused the response to fail, populated when the
2412
+ * `status` is `failed`.
2413
+ */
2414
+ export interface Error {
2415
+ /**
2416
+ * Error code, if any.
2417
+ */
2418
+ code?: string;
2419
+
2420
+ /**
2421
+ * The type of error.
2422
+ */
2423
+ type?: string;
2424
+ }
2425
+ }
2426
+
2427
+ /**
2428
+ * Usage statistics for the Response, this will correspond to billing. A Realtime
2429
+ * API session will maintain a conversation context and append new Items to the
2430
+ * Conversation, thus output from previous turns (text and audio tokens) will
2431
+ * become the input for later turns.
2432
+ */
2433
+ export interface RealtimeResponseUsage {
2434
+ /**
2435
+ * Details about the input tokens used in the Response. Cached tokens are tokens
2436
+ * from previous turns in the conversation that are included as context for the
2437
+ * current response. Cached tokens here are counted as a subset of input tokens,
2438
+ * meaning input tokens will include cached and uncached tokens.
2439
+ */
2440
+ input_token_details?: RealtimeResponseUsageInputTokenDetails;
2441
+
2442
+ /**
2443
+ * The number of input tokens used in the Response, including text and audio
2444
+ * tokens.
2445
+ */
2446
+ input_tokens?: number;
2447
+
2448
+ /**
2449
+ * Details about the output tokens used in the Response.
2450
+ */
2451
+ output_token_details?: RealtimeResponseUsageOutputTokenDetails;
2452
+
2453
+ /**
2454
+ * The number of output tokens sent in the Response, including text and audio
2455
+ * tokens.
2456
+ */
2457
+ output_tokens?: number;
2458
+
2459
+ /**
2460
+ * The total number of tokens in the Response including input and output text and
2461
+ * audio tokens.
2462
+ */
2463
+ total_tokens?: number;
2464
+ }
2465
+
2466
+ /**
2467
+ * Details about the input tokens used in the Response. Cached tokens are tokens
2468
+ * from previous turns in the conversation that are included as context for the
2469
+ * current response. Cached tokens here are counted as a subset of input tokens,
2470
+ * meaning input tokens will include cached and uncached tokens.
2471
+ */
2472
+ export interface RealtimeResponseUsageInputTokenDetails {
2473
+ /**
2474
+ * The number of audio tokens used as input for the Response.
2475
+ */
2476
+ audio_tokens?: number;
2477
+
2478
+ /**
2479
+ * The number of cached tokens used as input for the Response.
2480
+ */
2481
+ cached_tokens?: number;
2482
+
2483
+ /**
2484
+ * Details about the cached tokens used as input for the Response.
2485
+ */
2486
+ cached_tokens_details?: RealtimeResponseUsageInputTokenDetails.CachedTokensDetails;
2487
+
2488
+ /**
2489
+ * The number of image tokens used as input for the Response.
2490
+ */
2491
+ image_tokens?: number;
2492
+
2493
+ /**
2494
+ * The number of text tokens used as input for the Response.
2495
+ */
2496
+ text_tokens?: number;
2497
+ }
2498
+
2499
+ export namespace RealtimeResponseUsageInputTokenDetails {
2500
+ /**
2501
+ * Details about the cached tokens used as input for the Response.
2502
+ */
2503
+ export interface CachedTokensDetails {
2504
+ /**
2505
+ * The number of cached audio tokens used as input for the Response.
2506
+ */
2507
+ audio_tokens?: number;
2508
+
2509
+ /**
2510
+ * The number of cached image tokens used as input for the Response.
2511
+ */
2512
+ image_tokens?: number;
2513
+
2514
+ /**
2515
+ * The number of cached text tokens used as input for the Response.
2516
+ */
2517
+ text_tokens?: number;
2518
+ }
2519
+ }
2520
+
2521
+ /**
2522
+ * Details about the output tokens used in the Response.
2523
+ */
2524
+ export interface RealtimeResponseUsageOutputTokenDetails {
2525
+ /**
2526
+ * The number of audio tokens used in the Response.
2527
+ */
2528
+ audio_tokens?: number;
2529
+
2530
+ /**
2531
+ * The number of text tokens used in the Response.
2532
+ */
2533
+ text_tokens?: number;
2534
+ }
2535
+
2536
+ /**
2537
+ * A realtime server event.
2538
+ */
2539
+ export type RealtimeServerEvent =
2540
+ | ConversationCreatedEvent
2541
+ | ConversationItemCreatedEvent
2542
+ | ConversationItemDeletedEvent
2543
+ | ConversationItemInputAudioTranscriptionCompletedEvent
2544
+ | ConversationItemInputAudioTranscriptionDeltaEvent
2545
+ | ConversationItemInputAudioTranscriptionFailedEvent
2546
+ | RealtimeServerEvent.ConversationItemRetrieved
2547
+ | ConversationItemTruncatedEvent
2548
+ | RealtimeErrorEvent
2549
+ | InputAudioBufferClearedEvent
2550
+ | InputAudioBufferCommittedEvent
2551
+ | InputAudioBufferDtmfEventReceivedEvent
2552
+ | InputAudioBufferSpeechStartedEvent
2553
+ | InputAudioBufferSpeechStoppedEvent
2554
+ | RateLimitsUpdatedEvent
2555
+ | ResponseAudioDeltaEvent
2556
+ | ResponseAudioDoneEvent
2557
+ | ResponseAudioTranscriptDeltaEvent
2558
+ | ResponseAudioTranscriptDoneEvent
2559
+ | ResponseContentPartAddedEvent
2560
+ | ResponseContentPartDoneEvent
2561
+ | ResponseCreatedEvent
2562
+ | ResponseDoneEvent
2563
+ | ResponseFunctionCallArgumentsDeltaEvent
2564
+ | ResponseFunctionCallArgumentsDoneEvent
2565
+ | ResponseOutputItemAddedEvent
2566
+ | ResponseOutputItemDoneEvent
2567
+ | ResponseTextDeltaEvent
2568
+ | ResponseTextDoneEvent
2569
+ | SessionCreatedEvent
2570
+ | SessionUpdatedEvent
2571
+ | RealtimeServerEvent.OutputAudioBufferStarted
2572
+ | RealtimeServerEvent.OutputAudioBufferStopped
2573
+ | RealtimeServerEvent.OutputAudioBufferCleared
2574
+ | ConversationItemAdded
2575
+ | ConversationItemDone
2576
+ | InputAudioBufferTimeoutTriggered
2577
+ | ConversationItemInputAudioTranscriptionSegment
2578
+ | McpListToolsInProgress
2579
+ | McpListToolsCompleted
2580
+ | McpListToolsFailed
2581
+ | ResponseMcpCallArgumentsDelta
2582
+ | ResponseMcpCallArgumentsDone
2583
+ | ResponseMcpCallInProgress
2584
+ | ResponseMcpCallCompleted
2585
+ | ResponseMcpCallFailed;
2586
+
2587
+ export namespace RealtimeServerEvent {
2588
+ /**
2589
+ * Returned when a conversation item is retrieved with
2590
+ * `conversation.item.retrieve`. This is provided as a way to fetch the server's
2591
+ * representation of an item, for example to get access to the post-processed audio
2592
+ * data after noise cancellation and VAD. It includes the full content of the Item,
2593
+ * including audio data.
2594
+ */
2595
+ export interface ConversationItemRetrieved {
2596
+ /**
2597
+ * The unique ID of the server event.
2598
+ */
2599
+ event_id: string;
2600
+
2601
+ /**
2602
+ * A single item within a Realtime conversation.
2603
+ */
2604
+ item: RealtimeAPI.ConversationItem;
2605
+
2606
+ /**
2607
+ * The event type, must be `conversation.item.retrieved`.
2608
+ */
2609
+ type: 'conversation.item.retrieved';
2610
+ }
2611
+
2612
+ /**
2613
+ * **WebRTC/SIP Only:** Emitted when the server begins streaming audio to the
2614
+ * client. This event is emitted after an audio content part has been added
2615
+ * (`response.content_part.added`) to the response.
2616
+ * [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
2617
+ */
2618
+ export interface OutputAudioBufferStarted {
2619
+ /**
2620
+ * The unique ID of the server event.
2621
+ */
2622
+ event_id: string;
2623
+
2624
+ /**
2625
+ * The unique ID of the response that produced the audio.
2626
+ */
2627
+ response_id: string;
2628
+
2629
+ /**
2630
+ * The event type, must be `output_audio_buffer.started`.
2631
+ */
2632
+ type: 'output_audio_buffer.started';
2633
+ }
2634
+
2635
+ /**
2636
+ * **WebRTC/SIP Only:** Emitted when the output audio buffer has been completely
2637
+ * drained on the server, and no more audio is forthcoming. This event is emitted
2638
+ * after the full response data has been sent to the client (`response.done`).
2639
+ * [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
2640
+ */
2641
+ export interface OutputAudioBufferStopped {
2642
+ /**
2643
+ * The unique ID of the server event.
2644
+ */
2645
+ event_id: string;
2646
+
2647
+ /**
2648
+ * The unique ID of the response that produced the audio.
2649
+ */
2650
+ response_id: string;
2651
+
2652
+ /**
2653
+ * The event type, must be `output_audio_buffer.stopped`.
2654
+ */
2655
+ type: 'output_audio_buffer.stopped';
2656
+ }
2657
+
2658
+ /**
2659
+ * **WebRTC/SIP Only:** Emitted when the output audio buffer is cleared. This
2660
+ * happens either in VAD mode when the user has interrupted
2661
+ * (`input_audio_buffer.speech_started`), or when the client has emitted the
2662
+ * `output_audio_buffer.clear` event to manually cut off the current audio
2663
+ * response.
2664
+ * [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
2665
+ */
2666
+ export interface OutputAudioBufferCleared {
2667
+ /**
2668
+ * The unique ID of the server event.
2669
+ */
2670
+ event_id: string;
2671
+
2672
+ /**
2673
+ * The unique ID of the response that produced the audio.
2674
+ */
2675
+ response_id: string;
2676
+
2677
+ /**
2678
+ * The event type, must be `output_audio_buffer.cleared`.
2679
+ */
2680
+ type: 'output_audio_buffer.cleared';
2681
+ }
2682
+ }
2683
+
2684
+ /**
2685
+ * Realtime session object for the beta interface.
2686
+ */
2687
+ export interface RealtimeSession {
2688
+ /**
2689
+ * Unique identifier for the session that looks like `sess_1234567890abcdef`.
2690
+ */
2691
+ id?: string;
2692
+
2693
+ /**
2694
+ * Expiration timestamp for the session, in seconds since epoch.
2695
+ */
2696
+ expires_at?: number;
2697
+
2698
+ /**
2699
+ * Additional fields to include in server outputs.
2700
+ *
2701
+ * - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
2702
+ * transcription.
2703
+ */
2704
+ include?: Array<'item.input_audio_transcription.logprobs'> | null;
2705
+
2706
+ /**
2707
+ * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
2708
+ * `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
2709
+ * (mono), and little-endian byte order.
2710
+ */
2711
+ input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
2712
+
2713
+ /**
2714
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
2715
+ * off. Noise reduction filters audio added to the input audio buffer before it is
2716
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
2717
+ * detection accuracy (reducing false positives) and model performance by improving
2718
+ * perception of the input audio.
2719
+ */
2720
+ input_audio_noise_reduction?: RealtimeSession.InputAudioNoiseReduction;
2721
+
2722
+ /**
2723
+ * Configuration for input audio transcription, defaults to off and can be set to
2724
+ * `null` to turn off once on. Input audio transcription is not native to the
2725
+ * model, since the model consumes audio directly. Transcription runs
2726
+ * asynchronously through
2727
+ * [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
2728
+ * and should be treated as guidance of input audio content rather than precisely
2729
+ * what the model heard. The client can optionally set the language and prompt for
2730
+ * transcription, these offer additional guidance to the transcription service.
2731
+ */
2732
+ input_audio_transcription?: AudioTranscription | null;
2733
+
2734
+ /**
2735
+ * The default system instructions (i.e. system message) prepended to model calls.
2736
+ * This field allows the client to guide the model on desired responses. The model
2737
+ * can be instructed on response content and format, (e.g. "be extremely succinct",
2738
+ * "act friendly", "here are examples of good responses") and on audio behavior
2739
+ * (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
2740
+ * instructions are not guaranteed to be followed by the model, but they provide
2741
+ * guidance to the model on the desired behavior.
2742
+ *
2743
+ * Note that the server sets default instructions which will be used if this field
2744
+ * is not set and are visible in the `session.created` event at the start of the
2745
+ * session.
2746
+ */
2747
+ instructions?: string;
2748
+
2749
+ /**
2750
+ * Maximum number of output tokens for a single assistant response, inclusive of
2751
+ * tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
2752
+ * `inf` for the maximum available tokens for a given model. Defaults to `inf`.
2753
+ */
2754
+ max_response_output_tokens?: number | 'inf';
2755
+
2756
+ /**
2757
+ * The set of modalities the model can respond with. To disable audio, set this to
2758
+ * ["text"].
2759
+ */
2760
+ modalities?: Array<'text' | 'audio'>;
2761
+
2762
+ /**
2763
+ * The Realtime model used for this session.
2764
+ */
2765
+ model?:
2766
+ | (string & {})
2767
+ | 'gpt-realtime'
2768
+ | 'gpt-realtime-2025-08-28'
2769
+ | 'gpt-4o-realtime-preview'
2770
+ | 'gpt-4o-realtime-preview-2024-10-01'
2771
+ | 'gpt-4o-realtime-preview-2024-12-17'
2772
+ | 'gpt-4o-realtime-preview-2025-06-03'
2773
+ | 'gpt-4o-mini-realtime-preview'
2774
+ | 'gpt-4o-mini-realtime-preview-2024-12-17'
2775
+ | 'gpt-realtime-mini'
2776
+ | 'gpt-realtime-mini-2025-10-06'
2777
+ | 'gpt-realtime-mini-2025-12-15'
2778
+ | 'gpt-audio-mini'
2779
+ | 'gpt-audio-mini-2025-10-06'
2780
+ | 'gpt-audio-mini-2025-12-15';
2781
+
2782
+ /**
2783
+ * The object type. Always `realtime.session`.
2784
+ */
2785
+ object?: 'realtime.session';
2786
+
2787
+ /**
2788
+ * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
2789
+ * For `pcm16`, output audio is sampled at a rate of 24kHz.
2790
+ */
2791
+ output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
2792
+
2793
+ /**
2794
+ * Reference to a prompt template and its variables.
2795
+ * [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
2796
+ */
2797
+ prompt?: ResponsesAPI.ResponsePrompt | null;
2798
+
2799
+ /**
2800
+ * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
2801
+ * minimum speed. 1.5 is the maximum speed. This value can only be changed in
2802
+ * between model turns, not while a response is in progress.
2803
+ */
2804
+ speed?: number;
2805
+
2806
+ /**
2807
+ * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
2808
+ * temperature of 0.8 is highly recommended for best performance.
2809
+ */
2810
+ temperature?: number;
2811
+
2812
+ /**
2813
+ * How the model chooses tools. Options are `auto`, `none`, `required`, or specify
2814
+ * a function.
2815
+ */
2816
+ tool_choice?: string;
2817
+
2818
+ /**
2819
+ * Tools (functions) available to the model.
2820
+ */
2821
+ tools?: Array<RealtimeFunctionTool>;
2822
+
2823
+ /**
2824
+ * Configuration options for tracing. Set to null to disable tracing. Once tracing
2825
+ * is enabled for a session, the configuration cannot be modified.
2826
+ *
2827
+ * `auto` will create a trace for the session with default values for the workflow
2828
+ * name, group id, and metadata.
2829
+ */
2830
+ tracing?: 'auto' | RealtimeSession.TracingConfiguration | null;
2831
+
2832
+ /**
2833
+ * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
2834
+ * set to `null` to turn off, in which case the client must manually trigger model
2835
+ * response.
2836
+ *
2837
+ * Server VAD means that the model will detect the start and end of speech based on
2838
+ * audio volume and respond at the end of user speech.
2839
+ *
2840
+ * Semantic VAD is more advanced and uses a turn detection model (in conjunction
2841
+ * with VAD) to semantically estimate whether the user has finished speaking, then
2842
+ * dynamically sets a timeout based on this probability. For example, if user audio
2843
+ * trails off with "uhhm", the model will score a low probability of turn end and
2844
+ * wait longer for the user to continue speaking. This can be useful for more
2845
+ * natural conversations, but may have a higher latency.
2846
+ */
2847
+ turn_detection?: RealtimeSession.ServerVad | RealtimeSession.SemanticVad | null;
2848
+
2849
+ /**
2850
+ * The voice the model uses to respond. Voice cannot be changed during the session
2851
+ * once the model has responded with audio at least once. Current voice options are
2852
+ * `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
2853
+ */
2854
+ voice?:
2855
+ | (string & {})
2856
+ | 'alloy'
2857
+ | 'ash'
2858
+ | 'ballad'
2859
+ | 'coral'
2860
+ | 'echo'
2861
+ | 'sage'
2862
+ | 'shimmer'
2863
+ | 'verse'
2864
+ | 'marin'
2865
+ | 'cedar';
2866
+ }
2867
+
2868
+ export namespace RealtimeSession {
2869
+ /**
2870
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
2871
+ * off. Noise reduction filters audio added to the input audio buffer before it is
2872
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
2873
+ * detection accuracy (reducing false positives) and model performance by improving
2874
+ * perception of the input audio.
2875
+ */
2876
+ export interface InputAudioNoiseReduction {
2877
+ /**
2878
+ * Type of noise reduction. `near_field` is for close-talking microphones such as
2879
+ * headphones, `far_field` is for far-field microphones such as laptop or
2880
+ * conference room microphones.
2881
+ */
2882
+ type?: RealtimeAPI.NoiseReductionType;
2883
+ }
2884
+
2885
+ /**
2886
+ * Granular configuration for tracing.
2887
+ */
2888
+ export interface TracingConfiguration {
2889
+ /**
2890
+ * The group id to attach to this trace to enable filtering and grouping in the
2891
+ * traces dashboard.
2892
+ */
2893
+ group_id?: string;
2894
+
2895
+ /**
2896
+ * The arbitrary metadata to attach to this trace to enable filtering in the traces
2897
+ * dashboard.
2898
+ */
2899
+ metadata?: unknown;
2900
+
2901
+ /**
2902
+ * The name of the workflow to attach to this trace. This is used to name the trace
2903
+ * in the traces dashboard.
2904
+ */
2905
+ workflow_name?: string;
2906
+ }
2907
+
2908
+ /**
2909
+ * Server-side voice activity detection (VAD) which flips on when user speech is
2910
+ * detected and off after a period of silence.
2911
+ */
2912
+ export interface ServerVad {
2913
+ /**
2914
+ * Type of turn detection, `server_vad` to turn on simple Server VAD.
2915
+ */
2916
+ type: 'server_vad';
2917
+
2918
+ /**
2919
+ * Whether or not to automatically generate a response when a VAD stop event
2920
+ * occurs. If `interrupt_response` is set to `false` this may fail to create a
2921
+ * response if the model is already responding.
2922
+ *
2923
+ * If both `create_response` and `interrupt_response` are set to `false`, the model
2924
+ * will never respond automatically but VAD events will still be emitted.
2925
+ */
2926
+ create_response?: boolean;
2927
+
2928
+ /**
2929
+ * Optional timeout after which a model response will be triggered automatically.
2930
+ * This is useful for situations in which a long pause from the user is unexpected,
2931
+ * such as a phone call. The model will effectively prompt the user to continue the
2932
+ * conversation based on the current context.
2933
+ *
2934
+ * The timeout value will be applied after the last model response's audio has
2935
+ * finished playing, i.e. it's set to the `response.done` time plus audio playback
2936
+ * duration.
2937
+ *
2938
+ * An `input_audio_buffer.timeout_triggered` event (plus events associated with the
2939
+ * Response) will be emitted when the timeout is reached. Idle timeout is currently
2940
+ * only supported for `server_vad` mode.
2941
+ */
2942
+ idle_timeout_ms?: number | null;
2943
+
2944
+ /**
2945
+ * Whether or not to automatically interrupt (cancel) any ongoing response with
2946
+ * output to the default conversation (i.e. `conversation` of `auto`) when a VAD
2947
+ * start event occurs. If `true` then the response will be cancelled, otherwise it
2948
+ * will continue until complete.
2949
+ *
2950
+ * If both `create_response` and `interrupt_response` are set to `false`, the model
2951
+ * will never respond automatically but VAD events will still be emitted.
2952
+ */
2953
+ interrupt_response?: boolean;
2954
+
2955
+ /**
2956
+ * Used only for `server_vad` mode. Amount of audio to include before the VAD
2957
+ * detected speech (in milliseconds). Defaults to 300ms.
2958
+ */
2959
+ prefix_padding_ms?: number;
2960
+
2961
+ /**
2962
+ * Used only for `server_vad` mode. Duration of silence to detect speech stop (in
2963
+ * milliseconds). Defaults to 500ms. With shorter values the model will respond
2964
+ * more quickly, but may jump in on short pauses from the user.
2965
+ */
2966
+ silence_duration_ms?: number;
2967
+
2968
+ /**
2969
+ * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
2970
+ * defaults to 0.5. A higher threshold will require louder audio to activate the
2971
+ * model, and thus might perform better in noisy environments.
2972
+ */
2973
+ threshold?: number;
2974
+ }
2975
+
2976
+ /**
2977
+ * Server-side semantic turn detection which uses a model to determine when the
2978
+ * user has finished speaking.
2979
+ */
2980
+ export interface SemanticVad {
2981
+ /**
2982
+ * Type of turn detection, `semantic_vad` to turn on Semantic VAD.
2983
+ */
2984
+ type: 'semantic_vad';
2985
+
2986
+ /**
2987
+ * Whether or not to automatically generate a response when a VAD stop event
2988
+ * occurs.
2989
+ */
2990
+ create_response?: boolean;
2991
+
2992
+ /**
2993
+ * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
2994
+ * will wait longer for the user to continue speaking, `high` will respond more
2995
+ * quickly. `auto` is the default and is equivalent to `medium`. `low`, `medium`,
2996
+ * and `high` have max timeouts of 8s, 4s, and 2s respectively.
2997
+ */
2998
+ eagerness?: 'low' | 'medium' | 'high' | 'auto';
2999
+
3000
+ /**
3001
+ * Whether or not to automatically interrupt any ongoing response with output to
3002
+ * the default conversation (i.e. `conversation` of `auto`) when a VAD start event
3003
+ * occurs.
3004
+ */
3005
+ interrupt_response?: boolean;
3006
+ }
3007
+ }
3008
+
3009
+ /**
3010
+ * Realtime session object configuration.
3011
+ */
3012
+ export interface RealtimeSessionCreateRequest {
3013
+ /**
3014
+ * The type of session to create. Always `realtime` for the Realtime API.
3015
+ */
3016
+ type: 'realtime';
3017
+
3018
+ /**
3019
+ * Configuration for input and output audio.
3020
+ */
3021
+ audio?: RealtimeAudioConfig;
3022
+
3023
+ /**
3024
+ * Additional fields to include in server outputs.
3025
+ *
3026
+ * `item.input_audio_transcription.logprobs`: Include logprobs for input audio
3027
+ * transcription.
3028
+ */
3029
+ include?: Array<'item.input_audio_transcription.logprobs'>;
3030
+
3031
+ /**
3032
+ * The default system instructions (i.e. system message) prepended to model calls.
3033
+ * This field allows the client to guide the model on desired responses. The model
3034
+ * can be instructed on response content and format, (e.g. "be extremely succinct",
3035
+ * "act friendly", "here are examples of good responses") and on audio behavior
3036
+ * (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
3037
+ * instructions are not guaranteed to be followed by the model, but they provide
3038
+ * guidance to the model on the desired behavior.
3039
+ *
3040
+ * Note that the server sets default instructions which will be used if this field
3041
+ * is not set and are visible in the `session.created` event at the start of the
3042
+ * session.
3043
+ */
3044
+ instructions?: string;
3045
+
3046
+ /**
3047
+ * Maximum number of output tokens for a single assistant response, inclusive of
3048
+ * tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
3049
+ * `inf` for the maximum available tokens for a given model. Defaults to `inf`.
3050
+ */
3051
+ max_output_tokens?: number | 'inf';
3052
+
3053
+ /**
3054
+ * The Realtime model used for this session.
3055
+ */
3056
+ model?:
3057
+ | (string & {})
3058
+ | 'gpt-realtime'
3059
+ | 'gpt-realtime-2025-08-28'
3060
+ | 'gpt-4o-realtime-preview'
3061
+ | 'gpt-4o-realtime-preview-2024-10-01'
3062
+ | 'gpt-4o-realtime-preview-2024-12-17'
3063
+ | 'gpt-4o-realtime-preview-2025-06-03'
3064
+ | 'gpt-4o-mini-realtime-preview'
3065
+ | 'gpt-4o-mini-realtime-preview-2024-12-17'
3066
+ | 'gpt-realtime-mini'
3067
+ | 'gpt-realtime-mini-2025-10-06'
3068
+ | 'gpt-realtime-mini-2025-12-15'
3069
+ | 'gpt-audio-mini'
3070
+ | 'gpt-audio-mini-2025-10-06'
3071
+ | 'gpt-audio-mini-2025-12-15';
3072
+
3073
+ /**
3074
+ * The set of modalities the model can respond with. It defaults to `["audio"]`,
3075
+ * indicating that the model will respond with audio plus a transcript. `["text"]`
3076
+ * can be used to make the model respond with text only. It is not possible to
3077
+ * request both `text` and `audio` at the same time.
3078
+ */
3079
+ output_modalities?: Array<'text' | 'audio'>;
3080
+
3081
+ /**
3082
+ * Reference to a prompt template and its variables.
3083
+ * [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
3084
+ */
3085
+ prompt?: ResponsesAPI.ResponsePrompt | null;
3086
+
3087
+ /**
3088
+ * How the model chooses tools. Provide one of the string modes or force a specific
3089
+ * function/MCP tool.
3090
+ */
3091
+ tool_choice?: RealtimeToolChoiceConfig;
3092
+
3093
+ /**
3094
+ * Tools available to the model.
3095
+ */
3096
+ tools?: RealtimeToolsConfig;
3097
+
3098
+ /**
3099
+ * Realtime API can write session traces to the
3100
+ * [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once
3101
+ * tracing is enabled for a session, the configuration cannot be modified.
3102
+ *
3103
+ * `auto` will create a trace for the session with default values for the workflow
3104
+ * name, group id, and metadata.
3105
+ */
3106
+ tracing?: RealtimeTracingConfig | null;
3107
+
3108
+ /**
3109
+ * When the number of tokens in a conversation exceeds the model's input token
3110
+ * limit, the conversation be truncated, meaning messages (starting from the
3111
+ * oldest) will not be included in the model's context. A 32k context model with
3112
+ * 4,096 max output tokens can only include 28,224 tokens in the context before
3113
+ * truncation occurs.
3114
+ *
3115
+ * Clients can configure truncation behavior to truncate with a lower max token
3116
+ * limit, which is an effective way to control token usage and cost.
3117
+ *
3118
+ * Truncation will reduce the number of cached tokens on the next turn (busting the
3119
+ * cache), since messages are dropped from the beginning of the context. However,
3120
+ * clients can also configure truncation to retain messages up to a fraction of the
3121
+ * maximum context size, which will reduce the need for future truncations and thus
3122
+ * improve the cache rate.
3123
+ *
3124
+ * Truncation can be disabled entirely, which means the server will never truncate
3125
+ * but would instead return an error if the conversation exceeds the model's input
3126
+ * token limit.
3127
+ */
3128
+ truncation?: RealtimeTruncation;
3129
+ }
3130
+
3131
+ /**
3132
+ * How the model chooses tools. Provide one of the string modes or force a specific
3133
+ * function/MCP tool.
3134
+ */
3135
+ export type RealtimeToolChoiceConfig =
3136
+ | ResponsesAPI.ToolChoiceOptions
3137
+ | ResponsesAPI.ToolChoiceFunction
3138
+ | ResponsesAPI.ToolChoiceMcp;
3139
+
3140
+ /**
3141
+ * Tools available to the model.
3142
+ */
3143
+ export type RealtimeToolsConfig = Array<RealtimeToolsConfigUnion>;
3144
+
3145
+ /**
3146
+ * Give the model access to additional tools via remote Model Context Protocol
3147
+ * (MCP) servers.
3148
+ * [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
3149
+ */
3150
+ export type RealtimeToolsConfigUnion = RealtimeFunctionTool | RealtimeToolsConfigUnion.Mcp;
3151
+
3152
+ export namespace RealtimeToolsConfigUnion {
3153
+ /**
3154
+ * Give the model access to additional tools via remote Model Context Protocol
3155
+ * (MCP) servers.
3156
+ * [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
3157
+ */
3158
+ export interface Mcp {
3159
+ /**
3160
+ * A label for this MCP server, used to identify it in tool calls.
3161
+ */
3162
+ server_label: string;
3163
+
3164
+ /**
3165
+ * The type of the MCP tool. Always `mcp`.
3166
+ */
3167
+ type: 'mcp';
3168
+
3169
+ /**
3170
+ * List of allowed tool names or a filter object.
3171
+ */
3172
+ allowed_tools?: Array<string> | Mcp.McpToolFilter | null;
3173
+
3174
+ /**
3175
+ * An OAuth access token that can be used with a remote MCP server, either with a
3176
+ * custom MCP server URL or a service connector. Your application must handle the
3177
+ * OAuth authorization flow and provide the token here.
3178
+ */
3179
+ authorization?: string;
3180
+
3181
+ /**
3182
+ * Identifier for service connectors, like those available in ChatGPT. One of
3183
+ * `server_url` or `connector_id` must be provided. Learn more about service
3184
+ * connectors
3185
+ * [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
3186
+ *
3187
+ * Currently supported `connector_id` values are:
3188
+ *
3189
+ * - Dropbox: `connector_dropbox`
3190
+ * - Gmail: `connector_gmail`
3191
+ * - Google Calendar: `connector_googlecalendar`
3192
+ * - Google Drive: `connector_googledrive`
3193
+ * - Microsoft Teams: `connector_microsoftteams`
3194
+ * - Outlook Calendar: `connector_outlookcalendar`
3195
+ * - Outlook Email: `connector_outlookemail`
3196
+ * - SharePoint: `connector_sharepoint`
3197
+ */
3198
+ connector_id?:
3199
+ | 'connector_dropbox'
3200
+ | 'connector_gmail'
3201
+ | 'connector_googlecalendar'
3202
+ | 'connector_googledrive'
3203
+ | 'connector_microsoftteams'
3204
+ | 'connector_outlookcalendar'
3205
+ | 'connector_outlookemail'
3206
+ | 'connector_sharepoint';
3207
+
3208
+ /**
3209
+ * Optional HTTP headers to send to the MCP server. Use for authentication or other
3210
+ * purposes.
3211
+ */
3212
+ headers?: { [key: string]: string } | null;
3213
+
3214
+ /**
3215
+ * Specify which of the MCP server's tools require approval.
3216
+ */
3217
+ require_approval?: Mcp.McpToolApprovalFilter | 'always' | 'never' | null;
3218
+
3219
+ /**
3220
+ * Optional description of the MCP server, used to provide more context.
3221
+ */
3222
+ server_description?: string;
3223
+
3224
+ /**
3225
+ * The URL for the MCP server. One of `server_url` or `connector_id` must be
3226
+ * provided.
3227
+ */
3228
+ server_url?: string;
3229
+ }
3230
+
3231
+ export namespace Mcp {
3232
+ /**
3233
+ * A filter object to specify which tools are allowed.
3234
+ */
3235
+ export interface McpToolFilter {
3236
+ /**
3237
+ * Indicates whether or not a tool modifies data or is read-only. If an MCP server
3238
+ * is
3239
+ * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
3240
+ * it will match this filter.
3241
+ */
3242
+ read_only?: boolean;
3243
+
3244
+ /**
3245
+ * List of allowed tool names.
3246
+ */
3247
+ tool_names?: Array<string>;
3248
+ }
3249
+
3250
+ /**
3251
+ * Specify which of the MCP server's tools require approval. Can be `always`,
3252
+ * `never`, or a filter object associated with tools that require approval.
3253
+ */
3254
+ export interface McpToolApprovalFilter {
3255
+ /**
3256
+ * A filter object to specify which tools are allowed.
3257
+ */
3258
+ always?: McpToolApprovalFilter.Always;
3259
+
3260
+ /**
3261
+ * A filter object to specify which tools are allowed.
3262
+ */
3263
+ never?: McpToolApprovalFilter.Never;
3264
+ }
3265
+
3266
+ export namespace McpToolApprovalFilter {
3267
+ /**
3268
+ * A filter object to specify which tools are allowed.
3269
+ */
3270
+ export interface Always {
3271
+ /**
3272
+ * Indicates whether or not a tool modifies data or is read-only. If an MCP server
3273
+ * is
3274
+ * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
3275
+ * it will match this filter.
3276
+ */
3277
+ read_only?: boolean;
3278
+
3279
+ /**
3280
+ * List of allowed tool names.
3281
+ */
3282
+ tool_names?: Array<string>;
3283
+ }
3284
+
3285
+ /**
3286
+ * A filter object to specify which tools are allowed.
3287
+ */
3288
+ export interface Never {
3289
+ /**
3290
+ * Indicates whether or not a tool modifies data or is read-only. If an MCP server
3291
+ * is
3292
+ * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
3293
+ * it will match this filter.
3294
+ */
3295
+ read_only?: boolean;
3296
+
3297
+ /**
3298
+ * List of allowed tool names.
3299
+ */
3300
+ tool_names?: Array<string>;
3301
+ }
3302
+ }
3303
+ }
3304
+ }
3305
+
3306
+ /**
3307
+ * Realtime API can write session traces to the
3308
+ * [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once
3309
+ * tracing is enabled for a session, the configuration cannot be modified.
3310
+ *
3311
+ * `auto` will create a trace for the session with default values for the workflow
3312
+ * name, group id, and metadata.
3313
+ */
3314
+ export type RealtimeTracingConfig = 'auto' | RealtimeTracingConfig.TracingConfiguration;
3315
+
3316
+ export namespace RealtimeTracingConfig {
3317
+ /**
3318
+ * Granular configuration for tracing.
3319
+ */
3320
+ export interface TracingConfiguration {
3321
+ /**
3322
+ * The group id to attach to this trace to enable filtering and grouping in the
3323
+ * Traces Dashboard.
3324
+ */
3325
+ group_id?: string;
3326
+
3327
+ /**
3328
+ * The arbitrary metadata to attach to this trace to enable filtering in the Traces
3329
+ * Dashboard.
3330
+ */
3331
+ metadata?: unknown;
3332
+
3333
+ /**
3334
+ * The name of the workflow to attach to this trace. This is used to name the trace
3335
+ * in the Traces Dashboard.
3336
+ */
3337
+ workflow_name?: string;
3338
+ }
3339
+ }
3340
+
3341
+ /**
3342
+ * Configuration for input and output audio.
3343
+ */
3344
+ export interface RealtimeTranscriptionSessionAudio {
3345
+ input?: RealtimeTranscriptionSessionAudioInput;
3346
+ }
3347
+
3348
+ export interface RealtimeTranscriptionSessionAudioInput {
3349
+ /**
3350
+ * The PCM audio format. Only a 24kHz sample rate is supported.
3351
+ */
3352
+ format?: RealtimeAudioFormats;
3353
+
3354
+ /**
3355
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
3356
+ * off. Noise reduction filters audio added to the input audio buffer before it is
3357
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
3358
+ * detection accuracy (reducing false positives) and model performance by improving
3359
+ * perception of the input audio.
3360
+ */
3361
+ noise_reduction?: RealtimeTranscriptionSessionAudioInput.NoiseReduction;
3362
+
3363
+ /**
3364
+ * Configuration for input audio transcription, defaults to off and can be set to
3365
+ * `null` to turn off once on. Input audio transcription is not native to the
3366
+ * model, since the model consumes audio directly. Transcription runs
3367
+ * asynchronously through
3368
+ * [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
3369
+ * and should be treated as guidance of input audio content rather than precisely
3370
+ * what the model heard. The client can optionally set the language and prompt for
3371
+ * transcription, these offer additional guidance to the transcription service.
3372
+ */
3373
+ transcription?: AudioTranscription;
3374
+
3375
+ /**
3376
+ * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
3377
+ * set to `null` to turn off, in which case the client must manually trigger model
3378
+ * response.
3379
+ *
3380
+ * Server VAD means that the model will detect the start and end of speech based on
3381
+ * audio volume and respond at the end of user speech.
3382
+ *
3383
+ * Semantic VAD is more advanced and uses a turn detection model (in conjunction
3384
+ * with VAD) to semantically estimate whether the user has finished speaking, then
3385
+ * dynamically sets a timeout based on this probability. For example, if user audio
3386
+ * trails off with "uhhm", the model will score a low probability of turn end and
3387
+ * wait longer for the user to continue speaking. This can be useful for more
3388
+ * natural conversations, but may have a higher latency.
3389
+ */
3390
+ turn_detection?: RealtimeTranscriptionSessionAudioInputTurnDetection | null;
3391
+ }
3392
+
3393
+ export namespace RealtimeTranscriptionSessionAudioInput {
3394
+ /**
3395
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
3396
+ * off. Noise reduction filters audio added to the input audio buffer before it is
3397
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
3398
+ * detection accuracy (reducing false positives) and model performance by improving
3399
+ * perception of the input audio.
3400
+ */
3401
+ export interface NoiseReduction {
3402
+ /**
3403
+ * Type of noise reduction. `near_field` is for close-talking microphones such as
3404
+ * headphones, `far_field` is for far-field microphones such as laptop or
3405
+ * conference room microphones.
3406
+ */
3407
+ type?: RealtimeAPI.NoiseReductionType;
3408
+ }
3409
+ }
3410
+
3411
+ /**
3412
+ * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
3413
+ * set to `null` to turn off, in which case the client must manually trigger model
3414
+ * response.
3415
+ *
3416
+ * Server VAD means that the model will detect the start and end of speech based on
3417
+ * audio volume and respond at the end of user speech.
3418
+ *
3419
+ * Semantic VAD is more advanced and uses a turn detection model (in conjunction
3420
+ * with VAD) to semantically estimate whether the user has finished speaking, then
3421
+ * dynamically sets a timeout based on this probability. For example, if user audio
3422
+ * trails off with "uhhm", the model will score a low probability of turn end and
3423
+ * wait longer for the user to continue speaking. This can be useful for more
3424
+ * natural conversations, but may have a higher latency.
3425
+ */
3426
+ export type RealtimeTranscriptionSessionAudioInputTurnDetection =
3427
+ | RealtimeTranscriptionSessionAudioInputTurnDetection.ServerVad
3428
+ | RealtimeTranscriptionSessionAudioInputTurnDetection.SemanticVad;
3429
+
3430
+ export namespace RealtimeTranscriptionSessionAudioInputTurnDetection {
3431
+ /**
3432
+ * Server-side voice activity detection (VAD) which flips on when user speech is
3433
+ * detected and off after a period of silence.
3434
+ */
3435
+ export interface ServerVad {
3436
+ /**
3437
+ * Type of turn detection, `server_vad` to turn on simple Server VAD.
3438
+ */
3439
+ type: 'server_vad';
3440
+
3441
+ /**
3442
+ * Whether or not to automatically generate a response when a VAD stop event
3443
+ * occurs. If `interrupt_response` is set to `false` this may fail to create a
3444
+ * response if the model is already responding.
3445
+ *
3446
+ * If both `create_response` and `interrupt_response` are set to `false`, the model
3447
+ * will never respond automatically but VAD events will still be emitted.
3448
+ */
3449
+ create_response?: boolean;
3450
+
3451
+ /**
3452
+ * Optional timeout after which a model response will be triggered automatically.
3453
+ * This is useful for situations in which a long pause from the user is unexpected,
3454
+ * such as a phone call. The model will effectively prompt the user to continue the
3455
+ * conversation based on the current context.
3456
+ *
3457
+ * The timeout value will be applied after the last model response's audio has
3458
+ * finished playing, i.e. it's set to the `response.done` time plus audio playback
3459
+ * duration.
3460
+ *
3461
+ * An `input_audio_buffer.timeout_triggered` event (plus events associated with the
3462
+ * Response) will be emitted when the timeout is reached. Idle timeout is currently
3463
+ * only supported for `server_vad` mode.
3464
+ */
3465
+ idle_timeout_ms?: number | null;
3466
+
3467
+ /**
3468
+ * Whether or not to automatically interrupt (cancel) any ongoing response with
3469
+ * output to the default conversation (i.e. `conversation` of `auto`) when a VAD
3470
+ * start event occurs. If `true` then the response will be cancelled, otherwise it
3471
+ * will continue until complete.
3472
+ *
3473
+ * If both `create_response` and `interrupt_response` are set to `false`, the model
3474
+ * will never respond automatically but VAD events will still be emitted.
3475
+ */
3476
+ interrupt_response?: boolean;
3477
+
3478
+ /**
3479
+ * Used only for `server_vad` mode. Amount of audio to include before the VAD
3480
+ * detected speech (in milliseconds). Defaults to 300ms.
3481
+ */
3482
+ prefix_padding_ms?: number;
3483
+
3484
+ /**
3485
+ * Used only for `server_vad` mode. Duration of silence to detect speech stop (in
3486
+ * milliseconds). Defaults to 500ms. With shorter values the model will respond
3487
+ * more quickly, but may jump in on short pauses from the user.
3488
+ */
3489
+ silence_duration_ms?: number;
3490
+
3491
+ /**
3492
+ * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
3493
+ * defaults to 0.5. A higher threshold will require louder audio to activate the
3494
+ * model, and thus might perform better in noisy environments.
3495
+ */
3496
+ threshold?: number;
3497
+ }
3498
+
3499
+ /**
3500
+ * Server-side semantic turn detection which uses a model to determine when the
3501
+ * user has finished speaking.
3502
+ */
3503
+ export interface SemanticVad {
3504
+ /**
3505
+ * Type of turn detection, `semantic_vad` to turn on Semantic VAD.
3506
+ */
3507
+ type: 'semantic_vad';
3508
+
3509
+ /**
3510
+ * Whether or not to automatically generate a response when a VAD stop event
3511
+ * occurs.
3512
+ */
3513
+ create_response?: boolean;
3514
+
3515
+ /**
3516
+ * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
3517
+ * will wait longer for the user to continue speaking, `high` will respond more
3518
+ * quickly. `auto` is the default and is equivalent to `medium`. `low`, `medium`,
3519
+ * and `high` have max timeouts of 8s, 4s, and 2s respectively.
3520
+ */
3521
+ eagerness?: 'low' | 'medium' | 'high' | 'auto';
3522
+
3523
+ /**
3524
+ * Whether or not to automatically interrupt any ongoing response with output to
3525
+ * the default conversation (i.e. `conversation` of `auto`) when a VAD start event
3526
+ * occurs.
3527
+ */
3528
+ interrupt_response?: boolean;
3529
+ }
3530
+ }
3531
+
3532
+ /**
3533
+ * Realtime transcription session object configuration.
3534
+ */
3535
+ export interface RealtimeTranscriptionSessionCreateRequest {
3536
+ /**
3537
+ * The type of session to create. Always `transcription` for transcription
3538
+ * sessions.
3539
+ */
3540
+ type: 'transcription';
3541
+
3542
+ /**
3543
+ * Configuration for input and output audio.
3544
+ */
3545
+ audio?: RealtimeTranscriptionSessionAudio;
3546
+
3547
+ /**
3548
+ * Additional fields to include in server outputs.
3549
+ *
3550
+ * `item.input_audio_transcription.logprobs`: Include logprobs for input audio
3551
+ * transcription.
3552
+ */
3553
+ include?: Array<'item.input_audio_transcription.logprobs'>;
3554
+ }
3555
+
3556
+ /**
3557
+ * When the number of tokens in a conversation exceeds the model's input token
3558
+ * limit, the conversation be truncated, meaning messages (starting from the
3559
+ * oldest) will not be included in the model's context. A 32k context model with
3560
+ * 4,096 max output tokens can only include 28,224 tokens in the context before
3561
+ * truncation occurs.
3562
+ *
3563
+ * Clients can configure truncation behavior to truncate with a lower max token
3564
+ * limit, which is an effective way to control token usage and cost.
3565
+ *
3566
+ * Truncation will reduce the number of cached tokens on the next turn (busting the
3567
+ * cache), since messages are dropped from the beginning of the context. However,
3568
+ * clients can also configure truncation to retain messages up to a fraction of the
3569
+ * maximum context size, which will reduce the need for future truncations and thus
3570
+ * improve the cache rate.
3571
+ *
3572
+ * Truncation can be disabled entirely, which means the server will never truncate
3573
+ * but would instead return an error if the conversation exceeds the model's input
3574
+ * token limit.
3575
+ */
3576
+ export type RealtimeTruncation = 'auto' | 'disabled' | RealtimeTruncationRetentionRatio;
3577
+
3578
+ /**
3579
+ * Retain a fraction of the conversation tokens when the conversation exceeds the
3580
+ * input token limit. This allows you to amortize truncations across multiple
3581
+ * turns, which can help improve cached token usage.
3582
+ */
3583
+ export interface RealtimeTruncationRetentionRatio {
3584
+ /**
3585
+ * Fraction of post-instruction conversation tokens to retain (`0.0` - `1.0`) when
3586
+ * the conversation exceeds the input token limit. Setting this to `0.8` means that
3587
+ * messages will be dropped until 80% of the maximum allowed tokens are used. This
3588
+ * helps reduce the frequency of truncations and improve cache rates.
3589
+ */
3590
+ retention_ratio: number;
3591
+
3592
+ /**
3593
+ * Use retention ratio truncation.
3594
+ */
3595
+ type: 'retention_ratio';
3596
+
3597
+ /**
3598
+ * Optional custom token limits for this truncation strategy. If not provided, the
3599
+ * model's default token limits will be used.
3600
+ */
3601
+ token_limits?: RealtimeTruncationRetentionRatio.TokenLimits;
3602
+ }
3603
+
3604
+ export namespace RealtimeTruncationRetentionRatio {
3605
+ /**
3606
+ * Optional custom token limits for this truncation strategy. If not provided, the
3607
+ * model's default token limits will be used.
3608
+ */
3609
+ export interface TokenLimits {
3610
+ /**
3611
+ * Maximum tokens allowed in the conversation after instructions (which including
3612
+ * tool definitions). For example, setting this to 5,000 would mean that truncation
3613
+ * would occur when the conversation exceeds 5,000 tokens after instructions. This
3614
+ * cannot be higher than the model's context window size minus the maximum output
3615
+ * tokens.
3616
+ */
3617
+ post_instructions?: number;
3618
+ }
3619
+ }
3620
+
3621
+ /**
3622
+ * Returned when the model-generated audio is updated.
3623
+ */
3624
+ export interface ResponseAudioDeltaEvent {
3625
+ /**
3626
+ * The index of the content part in the item's content array.
3627
+ */
3628
+ content_index: number;
3629
+
3630
+ /**
3631
+ * Base64-encoded audio data delta.
3632
+ */
3633
+ delta: string;
3634
+
3635
+ /**
3636
+ * The unique ID of the server event.
3637
+ */
3638
+ event_id: string;
3639
+
3640
+ /**
3641
+ * The ID of the item.
3642
+ */
3643
+ item_id: string;
3644
+
3645
+ /**
3646
+ * The index of the output item in the response.
3647
+ */
3648
+ output_index: number;
3649
+
3650
+ /**
3651
+ * The ID of the response.
3652
+ */
3653
+ response_id: string;
3654
+
3655
+ /**
3656
+ * The event type, must be `response.output_audio.delta`.
3657
+ */
3658
+ type: 'response.output_audio.delta';
3659
+ }
3660
+
3661
+ /**
3662
+ * Returned when the model-generated audio is done. Also emitted when a Response is
3663
+ * interrupted, incomplete, or cancelled.
3664
+ */
3665
+ export interface ResponseAudioDoneEvent {
3666
+ /**
3667
+ * The index of the content part in the item's content array.
3668
+ */
3669
+ content_index: number;
3670
+
3671
+ /**
3672
+ * The unique ID of the server event.
3673
+ */
3674
+ event_id: string;
3675
+
3676
+ /**
3677
+ * The ID of the item.
3678
+ */
3679
+ item_id: string;
3680
+
3681
+ /**
3682
+ * The index of the output item in the response.
3683
+ */
3684
+ output_index: number;
3685
+
3686
+ /**
3687
+ * The ID of the response.
3688
+ */
3689
+ response_id: string;
3690
+
3691
+ /**
3692
+ * The event type, must be `response.output_audio.done`.
3693
+ */
3694
+ type: 'response.output_audio.done';
3695
+ }
3696
+
3697
+ /**
3698
+ * Returned when the model-generated transcription of audio output is updated.
3699
+ */
3700
+ export interface ResponseAudioTranscriptDeltaEvent {
3701
+ /**
3702
+ * The index of the content part in the item's content array.
3703
+ */
3704
+ content_index: number;
3705
+
3706
+ /**
3707
+ * The transcript delta.
3708
+ */
3709
+ delta: string;
3710
+
3711
+ /**
3712
+ * The unique ID of the server event.
3713
+ */
3714
+ event_id: string;
3715
+
3716
+ /**
3717
+ * The ID of the item.
3718
+ */
3719
+ item_id: string;
3720
+
3721
+ /**
3722
+ * The index of the output item in the response.
3723
+ */
3724
+ output_index: number;
3725
+
3726
+ /**
3727
+ * The ID of the response.
3728
+ */
3729
+ response_id: string;
3730
+
3731
+ /**
3732
+ * The event type, must be `response.output_audio_transcript.delta`.
3733
+ */
3734
+ type: 'response.output_audio_transcript.delta';
3735
+ }
3736
+
3737
+ /**
3738
+ * Returned when the model-generated transcription of audio output is done
3739
+ * streaming. Also emitted when a Response is interrupted, incomplete, or
3740
+ * cancelled.
3741
+ */
3742
+ export interface ResponseAudioTranscriptDoneEvent {
3743
+ /**
3744
+ * The index of the content part in the item's content array.
3745
+ */
3746
+ content_index: number;
3747
+
3748
+ /**
3749
+ * The unique ID of the server event.
3750
+ */
3751
+ event_id: string;
3752
+
3753
+ /**
3754
+ * The ID of the item.
3755
+ */
3756
+ item_id: string;
3757
+
3758
+ /**
3759
+ * The index of the output item in the response.
3760
+ */
3761
+ output_index: number;
3762
+
3763
+ /**
3764
+ * The ID of the response.
3765
+ */
3766
+ response_id: string;
3767
+
3768
+ /**
3769
+ * The final transcript of the audio.
3770
+ */
3771
+ transcript: string;
3772
+
3773
+ /**
3774
+ * The event type, must be `response.output_audio_transcript.done`.
3775
+ */
3776
+ type: 'response.output_audio_transcript.done';
3777
+ }
3778
+
3779
+ /**
3780
+ * Send this event to cancel an in-progress response. The server will respond with
3781
+ * a `response.done` event with a status of `response.status=cancelled`. If there
3782
+ * is no response to cancel, the server will respond with an error. It's safe to
3783
+ * call `response.cancel` even if no response is in progress, an error will be
3784
+ * returned the session will remain unaffected.
3785
+ */
3786
+ export interface ResponseCancelEvent {
3787
+ /**
3788
+ * The event type, must be `response.cancel`.
3789
+ */
3790
+ type: 'response.cancel';
3791
+
3792
+ /**
3793
+ * Optional client-generated ID used to identify this event.
3794
+ */
3795
+ event_id?: string;
3796
+
3797
+ /**
3798
+ * A specific response ID to cancel - if not provided, will cancel an in-progress
3799
+ * response in the default conversation.
3800
+ */
3801
+ response_id?: string;
3802
+ }
3803
+
3804
+ /**
3805
+ * Returned when a new content part is added to an assistant message item during
3806
+ * response generation.
3807
+ */
3808
+ export interface ResponseContentPartAddedEvent {
3809
+ /**
3810
+ * The index of the content part in the item's content array.
3811
+ */
3812
+ content_index: number;
3813
+
3814
+ /**
3815
+ * The unique ID of the server event.
3816
+ */
3817
+ event_id: string;
3818
+
3819
+ /**
3820
+ * The ID of the item to which the content part was added.
3821
+ */
3822
+ item_id: string;
3823
+
3824
+ /**
3825
+ * The index of the output item in the response.
3826
+ */
3827
+ output_index: number;
3828
+
3829
+ /**
3830
+ * The content part that was added.
3831
+ */
3832
+ part: ResponseContentPartAddedEvent.Part;
3833
+
3834
+ /**
3835
+ * The ID of the response.
3836
+ */
3837
+ response_id: string;
3838
+
3839
+ /**
3840
+ * The event type, must be `response.content_part.added`.
3841
+ */
3842
+ type: 'response.content_part.added';
3843
+ }
3844
+
3845
+ export namespace ResponseContentPartAddedEvent {
3846
+ /**
3847
+ * The content part that was added.
3848
+ */
3849
+ export interface Part {
3850
+ /**
3851
+ * Base64-encoded audio data (if type is "audio").
3852
+ */
3853
+ audio?: string;
3854
+
3855
+ /**
3856
+ * The text content (if type is "text").
3857
+ */
3858
+ text?: string;
3859
+
3860
+ /**
3861
+ * The transcript of the audio (if type is "audio").
3862
+ */
3863
+ transcript?: string;
3864
+
3865
+ /**
3866
+ * The content type ("text", "audio").
3867
+ */
3868
+ type?: 'text' | 'audio';
3869
+ }
3870
+ }
3871
+
3872
+ /**
3873
+ * Returned when a content part is done streaming in an assistant message item.
3874
+ * Also emitted when a Response is interrupted, incomplete, or cancelled.
3875
+ */
3876
+ export interface ResponseContentPartDoneEvent {
3877
+ /**
3878
+ * The index of the content part in the item's content array.
3879
+ */
3880
+ content_index: number;
3881
+
3882
+ /**
3883
+ * The unique ID of the server event.
3884
+ */
3885
+ event_id: string;
3886
+
3887
+ /**
3888
+ * The ID of the item.
3889
+ */
3890
+ item_id: string;
3891
+
3892
+ /**
3893
+ * The index of the output item in the response.
3894
+ */
3895
+ output_index: number;
3896
+
3897
+ /**
3898
+ * The content part that is done.
3899
+ */
3900
+ part: ResponseContentPartDoneEvent.Part;
3901
+
3902
+ /**
3903
+ * The ID of the response.
3904
+ */
3905
+ response_id: string;
3906
+
3907
+ /**
3908
+ * The event type, must be `response.content_part.done`.
3909
+ */
3910
+ type: 'response.content_part.done';
3911
+ }
3912
+
3913
+ export namespace ResponseContentPartDoneEvent {
3914
+ /**
3915
+ * The content part that is done.
3916
+ */
3917
+ export interface Part {
3918
+ /**
3919
+ * Base64-encoded audio data (if type is "audio").
3920
+ */
3921
+ audio?: string;
3922
+
3923
+ /**
3924
+ * The text content (if type is "text").
3925
+ */
3926
+ text?: string;
3927
+
3928
+ /**
3929
+ * The transcript of the audio (if type is "audio").
3930
+ */
3931
+ transcript?: string;
3932
+
3933
+ /**
3934
+ * The content type ("text", "audio").
3935
+ */
3936
+ type?: 'text' | 'audio';
3937
+ }
3938
+ }
3939
+
3940
+ /**
3941
+ * This event instructs the server to create a Response, which means triggering
3942
+ * model inference. When in Server VAD mode, the server will create Responses
3943
+ * automatically.
3944
+ *
3945
+ * A Response will include at least one Item, and may have two, in which case the
3946
+ * second will be a function call. These Items will be appended to the conversation
3947
+ * history by default.
3948
+ *
3949
+ * The server will respond with a `response.created` event, events for Items and
3950
+ * content created, and finally a `response.done` event to indicate the Response is
3951
+ * complete.
3952
+ *
3953
+ * The `response.create` event includes inference configuration like `instructions`
3954
+ * and `tools`. If these are set, they will override the Session's configuration
3955
+ * for this Response only.
3956
+ *
3957
+ * Responses can be created out-of-band of the default Conversation, meaning that
3958
+ * they can have arbitrary input, and it's possible to disable writing the output
3959
+ * to the Conversation. Only one Response can write to the default Conversation at
3960
+ * a time, but otherwise multiple Responses can be created in parallel. The
3961
+ * `metadata` field is a good way to disambiguate multiple simultaneous Responses.
3962
+ *
3963
+ * Clients can set `conversation` to `none` to create a Response that does not
3964
+ * write to the default Conversation. Arbitrary input can be provided with the
3965
+ * `input` field, which is an array accepting raw Items and references to existing
3966
+ * Items.
3967
+ */
3968
+ export interface ResponseCreateEvent {
3969
+ /**
3970
+ * The event type, must be `response.create`.
3971
+ */
3972
+ type: 'response.create';
3973
+
3974
+ /**
3975
+ * Optional client-generated ID used to identify this event.
3976
+ */
3977
+ event_id?: string;
3978
+
3979
+ /**
3980
+ * Create a new Realtime response with these parameters
3981
+ */
3982
+ response?: RealtimeResponseCreateParams;
3983
+ }
3984
+
3985
+ /**
3986
+ * Returned when a new Response is created. The first event of response creation,
3987
+ * where the response is in an initial state of `in_progress`.
3988
+ */
3989
+ export interface ResponseCreatedEvent {
3990
+ /**
3991
+ * The unique ID of the server event.
3992
+ */
3993
+ event_id: string;
3994
+
3995
+ /**
3996
+ * The response resource.
3997
+ */
3998
+ response: RealtimeResponse;
3999
+
4000
+ /**
4001
+ * The event type, must be `response.created`.
4002
+ */
4003
+ type: 'response.created';
4004
+ }
4005
+
4006
+ /**
4007
+ * Returned when a Response is done streaming. Always emitted, no matter the final
4008
+ * state. The Response object included in the `response.done` event will include
4009
+ * all output Items in the Response but will omit the raw audio data.
4010
+ *
4011
+ * Clients should check the `status` field of the Response to determine if it was
4012
+ * successful (`completed`) or if there was another outcome: `cancelled`, `failed`,
4013
+ * or `incomplete`.
4014
+ *
4015
+ * A response will contain all output items that were generated during the
4016
+ * response, excluding any audio content.
4017
+ */
4018
+ export interface ResponseDoneEvent {
4019
+ /**
4020
+ * The unique ID of the server event.
4021
+ */
4022
+ event_id: string;
4023
+
4024
+ /**
4025
+ * The response resource.
4026
+ */
4027
+ response: RealtimeResponse;
4028
+
4029
+ /**
4030
+ * The event type, must be `response.done`.
4031
+ */
4032
+ type: 'response.done';
4033
+ }
4034
+
4035
+ /**
4036
+ * Returned when the model-generated function call arguments are updated.
4037
+ */
4038
+ export interface ResponseFunctionCallArgumentsDeltaEvent {
4039
+ /**
4040
+ * The ID of the function call.
4041
+ */
4042
+ call_id: string;
4043
+
4044
+ /**
4045
+ * The arguments delta as a JSON string.
4046
+ */
4047
+ delta: string;
4048
+
4049
+ /**
4050
+ * The unique ID of the server event.
4051
+ */
4052
+ event_id: string;
4053
+
4054
+ /**
4055
+ * The ID of the function call item.
4056
+ */
4057
+ item_id: string;
4058
+
4059
+ /**
4060
+ * The index of the output item in the response.
4061
+ */
4062
+ output_index: number;
4063
+
4064
+ /**
4065
+ * The ID of the response.
4066
+ */
4067
+ response_id: string;
4068
+
4069
+ /**
4070
+ * The event type, must be `response.function_call_arguments.delta`.
4071
+ */
4072
+ type: 'response.function_call_arguments.delta';
4073
+ }
4074
+
4075
+ /**
4076
+ * Returned when the model-generated function call arguments are done streaming.
4077
+ * Also emitted when a Response is interrupted, incomplete, or cancelled.
4078
+ */
4079
+ export interface ResponseFunctionCallArgumentsDoneEvent {
4080
+ /**
4081
+ * The final arguments as a JSON string.
4082
+ */
4083
+ arguments: string;
4084
+
4085
+ /**
4086
+ * The ID of the function call.
4087
+ */
4088
+ call_id: string;
4089
+
4090
+ /**
4091
+ * The unique ID of the server event.
4092
+ */
4093
+ event_id: string;
4094
+
4095
+ /**
4096
+ * The ID of the function call item.
4097
+ */
4098
+ item_id: string;
4099
+
4100
+ /**
4101
+ * The name of the function that was called.
4102
+ */
4103
+ name: string;
4104
+
4105
+ /**
4106
+ * The index of the output item in the response.
4107
+ */
4108
+ output_index: number;
4109
+
4110
+ /**
4111
+ * The ID of the response.
4112
+ */
4113
+ response_id: string;
4114
+
4115
+ /**
4116
+ * The event type, must be `response.function_call_arguments.done`.
4117
+ */
4118
+ type: 'response.function_call_arguments.done';
4119
+ }
4120
+
4121
+ /**
4122
+ * Returned when MCP tool call arguments are updated during response generation.
4123
+ */
4124
+ export interface ResponseMcpCallArgumentsDelta {
4125
+ /**
4126
+ * The JSON-encoded arguments delta.
4127
+ */
4128
+ delta: string;
4129
+
4130
+ /**
4131
+ * The unique ID of the server event.
4132
+ */
4133
+ event_id: string;
4134
+
4135
+ /**
4136
+ * The ID of the MCP tool call item.
4137
+ */
4138
+ item_id: string;
4139
+
4140
+ /**
4141
+ * The index of the output item in the response.
4142
+ */
4143
+ output_index: number;
4144
+
4145
+ /**
4146
+ * The ID of the response.
4147
+ */
4148
+ response_id: string;
4149
+
4150
+ /**
4151
+ * The event type, must be `response.mcp_call_arguments.delta`.
4152
+ */
4153
+ type: 'response.mcp_call_arguments.delta';
4154
+
4155
+ /**
4156
+ * If present, indicates the delta text was obfuscated.
4157
+ */
4158
+ obfuscation?: string | null;
4159
+ }
4160
+
4161
+ /**
4162
+ * Returned when MCP tool call arguments are finalized during response generation.
4163
+ */
4164
+ export interface ResponseMcpCallArgumentsDone {
4165
+ /**
4166
+ * The final JSON-encoded arguments string.
4167
+ */
4168
+ arguments: string;
4169
+
4170
+ /**
4171
+ * The unique ID of the server event.
4172
+ */
4173
+ event_id: string;
4174
+
4175
+ /**
4176
+ * The ID of the MCP tool call item.
4177
+ */
4178
+ item_id: string;
4179
+
4180
+ /**
4181
+ * The index of the output item in the response.
4182
+ */
4183
+ output_index: number;
4184
+
4185
+ /**
4186
+ * The ID of the response.
4187
+ */
4188
+ response_id: string;
4189
+
4190
+ /**
4191
+ * The event type, must be `response.mcp_call_arguments.done`.
4192
+ */
4193
+ type: 'response.mcp_call_arguments.done';
4194
+ }
4195
+
4196
+ /**
4197
+ * Returned when an MCP tool call has completed successfully.
4198
+ */
4199
+ export interface ResponseMcpCallCompleted {
4200
+ /**
4201
+ * The unique ID of the server event.
4202
+ */
4203
+ event_id: string;
4204
+
4205
+ /**
4206
+ * The ID of the MCP tool call item.
4207
+ */
4208
+ item_id: string;
4209
+
4210
+ /**
4211
+ * The index of the output item in the response.
4212
+ */
4213
+ output_index: number;
4214
+
4215
+ /**
4216
+ * The event type, must be `response.mcp_call.completed`.
4217
+ */
4218
+ type: 'response.mcp_call.completed';
4219
+ }
4220
+
4221
+ /**
4222
+ * Returned when an MCP tool call has failed.
4223
+ */
4224
+ export interface ResponseMcpCallFailed {
4225
+ /**
4226
+ * The unique ID of the server event.
4227
+ */
4228
+ event_id: string;
4229
+
4230
+ /**
4231
+ * The ID of the MCP tool call item.
4232
+ */
4233
+ item_id: string;
4234
+
4235
+ /**
4236
+ * The index of the output item in the response.
4237
+ */
4238
+ output_index: number;
4239
+
4240
+ /**
4241
+ * The event type, must be `response.mcp_call.failed`.
4242
+ */
4243
+ type: 'response.mcp_call.failed';
4244
+ }
4245
+
4246
+ /**
4247
+ * Returned when an MCP tool call has started and is in progress.
4248
+ */
4249
+ export interface ResponseMcpCallInProgress {
4250
+ /**
4251
+ * The unique ID of the server event.
4252
+ */
4253
+ event_id: string;
4254
+
4255
+ /**
4256
+ * The ID of the MCP tool call item.
4257
+ */
4258
+ item_id: string;
4259
+
4260
+ /**
4261
+ * The index of the output item in the response.
4262
+ */
4263
+ output_index: number;
4264
+
4265
+ /**
4266
+ * The event type, must be `response.mcp_call.in_progress`.
4267
+ */
4268
+ type: 'response.mcp_call.in_progress';
4269
+ }
4270
+
4271
+ /**
4272
+ * Returned when a new Item is created during Response generation.
4273
+ */
4274
+ export interface ResponseOutputItemAddedEvent {
4275
+ /**
4276
+ * The unique ID of the server event.
4277
+ */
4278
+ event_id: string;
4279
+
4280
+ /**
4281
+ * A single item within a Realtime conversation.
4282
+ */
4283
+ item: ConversationItem;
4284
+
4285
+ /**
4286
+ * The index of the output item in the Response.
4287
+ */
4288
+ output_index: number;
4289
+
4290
+ /**
4291
+ * The ID of the Response to which the item belongs.
4292
+ */
4293
+ response_id: string;
4294
+
4295
+ /**
4296
+ * The event type, must be `response.output_item.added`.
4297
+ */
4298
+ type: 'response.output_item.added';
4299
+ }
4300
+
4301
+ /**
4302
+ * Returned when an Item is done streaming. Also emitted when a Response is
4303
+ * interrupted, incomplete, or cancelled.
4304
+ */
4305
+ export interface ResponseOutputItemDoneEvent {
4306
+ /**
4307
+ * The unique ID of the server event.
4308
+ */
4309
+ event_id: string;
4310
+
4311
+ /**
4312
+ * A single item within a Realtime conversation.
4313
+ */
4314
+ item: ConversationItem;
4315
+
4316
+ /**
4317
+ * The index of the output item in the Response.
4318
+ */
4319
+ output_index: number;
4320
+
4321
+ /**
4322
+ * The ID of the Response to which the item belongs.
4323
+ */
4324
+ response_id: string;
4325
+
4326
+ /**
4327
+ * The event type, must be `response.output_item.done`.
4328
+ */
4329
+ type: 'response.output_item.done';
4330
+ }
4331
+
4332
+ /**
4333
+ * Returned when the text value of an "output_text" content part is updated.
4334
+ */
4335
+ export interface ResponseTextDeltaEvent {
4336
+ /**
4337
+ * The index of the content part in the item's content array.
4338
+ */
4339
+ content_index: number;
4340
+
4341
+ /**
4342
+ * The text delta.
4343
+ */
4344
+ delta: string;
4345
+
4346
+ /**
4347
+ * The unique ID of the server event.
4348
+ */
4349
+ event_id: string;
4350
+
4351
+ /**
4352
+ * The ID of the item.
4353
+ */
4354
+ item_id: string;
4355
+
4356
+ /**
4357
+ * The index of the output item in the response.
4358
+ */
4359
+ output_index: number;
4360
+
4361
+ /**
4362
+ * The ID of the response.
4363
+ */
4364
+ response_id: string;
4365
+
4366
+ /**
4367
+ * The event type, must be `response.output_text.delta`.
4368
+ */
4369
+ type: 'response.output_text.delta';
4370
+ }
4371
+
4372
+ /**
4373
+ * Returned when the text value of an "output_text" content part is done streaming.
4374
+ * Also emitted when a Response is interrupted, incomplete, or cancelled.
4375
+ */
4376
+ export interface ResponseTextDoneEvent {
4377
+ /**
4378
+ * The index of the content part in the item's content array.
4379
+ */
4380
+ content_index: number;
4381
+
4382
+ /**
4383
+ * The unique ID of the server event.
4384
+ */
4385
+ event_id: string;
4386
+
4387
+ /**
4388
+ * The ID of the item.
4389
+ */
4390
+ item_id: string;
4391
+
4392
+ /**
4393
+ * The index of the output item in the response.
4394
+ */
4395
+ output_index: number;
4396
+
4397
+ /**
4398
+ * The ID of the response.
4399
+ */
4400
+ response_id: string;
4401
+
4402
+ /**
4403
+ * The final text content.
4404
+ */
4405
+ text: string;
4406
+
4407
+ /**
4408
+ * The event type, must be `response.output_text.done`.
4409
+ */
4410
+ type: 'response.output_text.done';
4411
+ }
4412
+
4413
+ /**
4414
+ * Returned when a Session is created. Emitted automatically when a new connection
4415
+ * is established as the first server event. This event will contain the default
4416
+ * Session configuration.
4417
+ */
4418
+ export interface SessionCreatedEvent {
4419
+ /**
4420
+ * The unique ID of the server event.
4421
+ */
4422
+ event_id: string;
4423
+
4424
+ /**
4425
+ * The session configuration.
4426
+ */
4427
+ session: RealtimeSessionCreateRequest | RealtimeTranscriptionSessionCreateRequest;
4428
+
4429
+ /**
4430
+ * The event type, must be `session.created`.
4431
+ */
4432
+ type: 'session.created';
4433
+ }
4434
+
4435
+ /**
4436
+ * Send this event to update the session’s configuration. The client may send this
4437
+ * event at any time to update any field except for `voice` and `model`. `voice`
4438
+ * can be updated only if there have been no other audio outputs yet.
4439
+ *
4440
+ * When the server receives a `session.update`, it will respond with a
4441
+ * `session.updated` event showing the full, effective configuration. Only the
4442
+ * fields that are present in the `session.update` are updated. To clear a field
4443
+ * like `instructions`, pass an empty string. To clear a field like `tools`, pass
4444
+ * an empty array. To clear a field like `turn_detection`, pass `null`.
4445
+ */
4446
+ export interface SessionUpdateEvent {
4447
+ /**
4448
+ * Update the Realtime session. Choose either a realtime session or a transcription
4449
+ * session.
4450
+ */
4451
+ session: RealtimeSessionCreateRequest | RealtimeTranscriptionSessionCreateRequest;
4452
+
4453
+ /**
4454
+ * The event type, must be `session.update`.
4455
+ */
4456
+ type: 'session.update';
4457
+
4458
+ /**
4459
+ * Optional client-generated ID used to identify this event. This is an arbitrary
4460
+ * string that a client may assign. It will be passed back if there is an error
4461
+ * with the event, but the corresponding `session.updated` event will not include
4462
+ * it.
4463
+ */
4464
+ event_id?: string;
4465
+ }
4466
+
4467
+ /**
4468
+ * Returned when a session is updated with a `session.update` event, unless there
4469
+ * is an error.
4470
+ */
4471
+ export interface SessionUpdatedEvent {
4472
+ /**
4473
+ * The unique ID of the server event.
4474
+ */
4475
+ event_id: string;
4476
+
4477
+ /**
4478
+ * The session configuration.
4479
+ */
4480
+ session: RealtimeSessionCreateRequest | RealtimeTranscriptionSessionCreateRequest;
4481
+
4482
+ /**
4483
+ * The event type, must be `session.updated`.
4484
+ */
4485
+ type: 'session.updated';
4486
+ }
4487
+
4488
+ /**
4489
+ * Send this event to update a transcription session.
4490
+ */
4491
+ export interface TranscriptionSessionUpdate {
4492
+ /**
4493
+ * Realtime transcription session object configuration.
4494
+ */
4495
+ session: TranscriptionSessionUpdate.Session;
4496
+
4497
+ /**
4498
+ * The event type, must be `transcription_session.update`.
4499
+ */
4500
+ type: 'transcription_session.update';
4501
+
4502
+ /**
4503
+ * Optional client-generated ID used to identify this event.
4504
+ */
4505
+ event_id?: string;
4506
+ }
4507
+
4508
+ export namespace TranscriptionSessionUpdate {
4509
+ /**
4510
+ * Realtime transcription session object configuration.
4511
+ */
4512
+ export interface Session {
4513
+ /**
4514
+ * The set of items to include in the transcription. Current available items are:
4515
+ * `item.input_audio_transcription.logprobs`
4516
+ */
4517
+ include?: Array<'item.input_audio_transcription.logprobs'>;
4518
+
4519
+ /**
4520
+ * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
4521
+ * `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
4522
+ * (mono), and little-endian byte order.
4523
+ */
4524
+ input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
4525
+
4526
+ /**
4527
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
4528
+ * off. Noise reduction filters audio added to the input audio buffer before it is
4529
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
4530
+ * detection accuracy (reducing false positives) and model performance by improving
4531
+ * perception of the input audio.
4532
+ */
4533
+ input_audio_noise_reduction?: Session.InputAudioNoiseReduction;
4534
+
4535
+ /**
4536
+ * Configuration for input audio transcription. The client can optionally set the
4537
+ * language and prompt for transcription, these offer additional guidance to the
4538
+ * transcription service.
4539
+ */
4540
+ input_audio_transcription?: RealtimeAPI.AudioTranscription;
4541
+
4542
+ /**
4543
+ * Configuration for turn detection. Can be set to `null` to turn off. Server VAD
4544
+ * means that the model will detect the start and end of speech based on audio
4545
+ * volume and respond at the end of user speech.
4546
+ */
4547
+ turn_detection?: Session.TurnDetection;
4548
+ }
4549
+
4550
+ export namespace Session {
4551
+ /**
4552
+ * Configuration for input audio noise reduction. This can be set to `null` to turn
4553
+ * off. Noise reduction filters audio added to the input audio buffer before it is
4554
+ * sent to VAD and the model. Filtering the audio can improve VAD and turn
4555
+ * detection accuracy (reducing false positives) and model performance by improving
4556
+ * perception of the input audio.
4557
+ */
4558
+ export interface InputAudioNoiseReduction {
4559
+ /**
4560
+ * Type of noise reduction. `near_field` is for close-talking microphones such as
4561
+ * headphones, `far_field` is for far-field microphones such as laptop or
4562
+ * conference room microphones.
4563
+ */
4564
+ type?: RealtimeAPI.NoiseReductionType;
4565
+ }
4566
+
4567
+ /**
4568
+ * Configuration for turn detection. Can be set to `null` to turn off. Server VAD
4569
+ * means that the model will detect the start and end of speech based on audio
4570
+ * volume and respond at the end of user speech.
4571
+ */
4572
+ export interface TurnDetection {
4573
+ /**
4574
+ * Amount of audio to include before the VAD detected speech (in milliseconds).
4575
+ * Defaults to 300ms.
4576
+ */
4577
+ prefix_padding_ms?: number;
4578
+
4579
+ /**
4580
+ * Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
4581
+ * With shorter values the model will respond more quickly, but may jump in on
4582
+ * short pauses from the user.
4583
+ */
4584
+ silence_duration_ms?: number;
4585
+
4586
+ /**
4587
+ * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
4588
+ * threshold will require louder audio to activate the model, and thus might
4589
+ * perform better in noisy environments.
4590
+ */
4591
+ threshold?: number;
4592
+
4593
+ /**
4594
+ * Type of turn detection. Only `server_vad` is currently supported for
4595
+ * transcription sessions.
4596
+ */
4597
+ type?: 'server_vad';
4598
+ }
4599
+ }
4600
+ }
4601
+
4602
+ /**
4603
+ * Returned when a transcription session is updated with a
4604
+ * `transcription_session.update` event, unless there is an error.
4605
+ */
4606
+ export interface TranscriptionSessionUpdatedEvent {
4607
+ /**
4608
+ * The unique ID of the server event.
4609
+ */
4610
+ event_id: string;
4611
+
4612
+ /**
4613
+ * A new Realtime transcription session configuration.
4614
+ *
4615
+ * When a session is created on the server via REST API, the session object also
4616
+ * contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
4617
+ * not present when a session is updated via the WebSocket API.
4618
+ */
4619
+ session: TranscriptionSessionUpdatedEvent.Session;
4620
+
4621
+ /**
4622
+ * The event type, must be `transcription_session.updated`.
4623
+ */
4624
+ type: 'transcription_session.updated';
4625
+ }
4626
+
4627
+ export namespace TranscriptionSessionUpdatedEvent {
4628
+ /**
4629
+ * A new Realtime transcription session configuration.
4630
+ *
4631
+ * When a session is created on the server via REST API, the session object also
4632
+ * contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
4633
+ * not present when a session is updated via the WebSocket API.
4634
+ */
4635
+ export interface Session {
4636
+ /**
4637
+ * Ephemeral key returned by the API. Only present when the session is created on
4638
+ * the server via REST API.
4639
+ */
4640
+ client_secret: Session.ClientSecret;
4641
+
4642
+ /**
4643
+ * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
4644
+ */
4645
+ input_audio_format?: string;
4646
+
4647
+ /**
4648
+ * Configuration of the transcription model.
4649
+ */
4650
+ input_audio_transcription?: RealtimeAPI.AudioTranscription;
4651
+
4652
+ /**
4653
+ * The set of modalities the model can respond with. To disable audio, set this to
4654
+ * ["text"].
4655
+ */
4656
+ modalities?: Array<'text' | 'audio'>;
4657
+
4658
+ /**
4659
+ * Configuration for turn detection. Can be set to `null` to turn off. Server VAD
4660
+ * means that the model will detect the start and end of speech based on audio
4661
+ * volume and respond at the end of user speech.
4662
+ */
4663
+ turn_detection?: Session.TurnDetection;
4664
+ }
4665
+
4666
+ export namespace Session {
4667
+ /**
4668
+ * Ephemeral key returned by the API. Only present when the session is created on
4669
+ * the server via REST API.
4670
+ */
4671
+ export interface ClientSecret {
4672
+ /**
4673
+ * Timestamp for when the token expires. Currently, all tokens expire after one
4674
+ * minute.
4675
+ */
4676
+ expires_at: number;
4677
+
4678
+ /**
4679
+ * Ephemeral key usable in client environments to authenticate connections to the
4680
+ * Realtime API. Use this in client-side environments rather than a standard API
4681
+ * token, which should only be used server-side.
4682
+ */
4683
+ value: string;
4684
+ }
4685
+
4686
+ /**
4687
+ * Configuration for turn detection. Can be set to `null` to turn off. Server VAD
4688
+ * means that the model will detect the start and end of speech based on audio
4689
+ * volume and respond at the end of user speech.
4690
+ */
4691
+ export interface TurnDetection {
4692
+ /**
4693
+ * Amount of audio to include before the VAD detected speech (in milliseconds).
4694
+ * Defaults to 300ms.
4695
+ */
4696
+ prefix_padding_ms?: number;
4697
+
4698
+ /**
4699
+ * Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
4700
+ * With shorter values the model will respond more quickly, but may jump in on
4701
+ * short pauses from the user.
4702
+ */
4703
+ silence_duration_ms?: number;
4704
+
4705
+ /**
4706
+ * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
4707
+ * threshold will require louder audio to activate the model, and thus might
4708
+ * perform better in noisy environments.
4709
+ */
4710
+ threshold?: number;
4711
+
4712
+ /**
4713
+ * Type of turn detection, only `server_vad` is currently supported.
4714
+ */
4715
+ type?: string;
4716
+ }
4717
+ }
4718
+ }
4719
+
4720
+ Realtime.ClientSecrets = ClientSecrets;
4721
+ Realtime.Calls = Calls;
4722
+
4723
+ export declare namespace Realtime {
4724
+ export {
4725
+ type AudioTranscription as AudioTranscription,
4726
+ type ConversationCreatedEvent as ConversationCreatedEvent,
4727
+ type ConversationItem as ConversationItem,
4728
+ type ConversationItemAdded as ConversationItemAdded,
4729
+ type ConversationItemCreateEvent as ConversationItemCreateEvent,
4730
+ type ConversationItemCreatedEvent as ConversationItemCreatedEvent,
4731
+ type ConversationItemDeleteEvent as ConversationItemDeleteEvent,
4732
+ type ConversationItemDeletedEvent as ConversationItemDeletedEvent,
4733
+ type ConversationItemDone as ConversationItemDone,
4734
+ type ConversationItemInputAudioTranscriptionCompletedEvent as ConversationItemInputAudioTranscriptionCompletedEvent,
4735
+ type ConversationItemInputAudioTranscriptionDeltaEvent as ConversationItemInputAudioTranscriptionDeltaEvent,
4736
+ type ConversationItemInputAudioTranscriptionFailedEvent as ConversationItemInputAudioTranscriptionFailedEvent,
4737
+ type ConversationItemInputAudioTranscriptionSegment as ConversationItemInputAudioTranscriptionSegment,
4738
+ type ConversationItemRetrieveEvent as ConversationItemRetrieveEvent,
4739
+ type ConversationItemTruncateEvent as ConversationItemTruncateEvent,
4740
+ type ConversationItemTruncatedEvent as ConversationItemTruncatedEvent,
4741
+ type ConversationItemWithReference as ConversationItemWithReference,
4742
+ type InputAudioBufferAppendEvent as InputAudioBufferAppendEvent,
4743
+ type InputAudioBufferClearEvent as InputAudioBufferClearEvent,
4744
+ type InputAudioBufferClearedEvent as InputAudioBufferClearedEvent,
4745
+ type InputAudioBufferCommitEvent as InputAudioBufferCommitEvent,
4746
+ type InputAudioBufferCommittedEvent as InputAudioBufferCommittedEvent,
4747
+ type InputAudioBufferDtmfEventReceivedEvent as InputAudioBufferDtmfEventReceivedEvent,
4748
+ type InputAudioBufferSpeechStartedEvent as InputAudioBufferSpeechStartedEvent,
4749
+ type InputAudioBufferSpeechStoppedEvent as InputAudioBufferSpeechStoppedEvent,
4750
+ type InputAudioBufferTimeoutTriggered as InputAudioBufferTimeoutTriggered,
4751
+ type LogProbProperties as LogProbProperties,
4752
+ type McpListToolsCompleted as McpListToolsCompleted,
4753
+ type McpListToolsFailed as McpListToolsFailed,
4754
+ type McpListToolsInProgress as McpListToolsInProgress,
4755
+ type NoiseReductionType as NoiseReductionType,
4756
+ type OutputAudioBufferClearEvent as OutputAudioBufferClearEvent,
4757
+ type RateLimitsUpdatedEvent as RateLimitsUpdatedEvent,
4758
+ type RealtimeAudioConfig as RealtimeAudioConfig,
4759
+ type RealtimeAudioConfigInput as RealtimeAudioConfigInput,
4760
+ type RealtimeAudioConfigOutput as RealtimeAudioConfigOutput,
4761
+ type RealtimeAudioFormats as RealtimeAudioFormats,
4762
+ type RealtimeAudioInputTurnDetection as RealtimeAudioInputTurnDetection,
4763
+ type RealtimeClientEvent as RealtimeClientEvent,
4764
+ type RealtimeConversationItemAssistantMessage as RealtimeConversationItemAssistantMessage,
4765
+ type RealtimeConversationItemFunctionCall as RealtimeConversationItemFunctionCall,
4766
+ type RealtimeConversationItemFunctionCallOutput as RealtimeConversationItemFunctionCallOutput,
4767
+ type RealtimeConversationItemSystemMessage as RealtimeConversationItemSystemMessage,
4768
+ type RealtimeConversationItemUserMessage as RealtimeConversationItemUserMessage,
4769
+ type RealtimeError as RealtimeError,
4770
+ type RealtimeErrorEvent as RealtimeErrorEvent,
4771
+ type RealtimeFunctionTool as RealtimeFunctionTool,
4772
+ type RealtimeMcpApprovalRequest as RealtimeMcpApprovalRequest,
4773
+ type RealtimeMcpApprovalResponse as RealtimeMcpApprovalResponse,
4774
+ type RealtimeMcpListTools as RealtimeMcpListTools,
4775
+ type RealtimeMcpProtocolError as RealtimeMcpProtocolError,
4776
+ type RealtimeMcpToolCall as RealtimeMcpToolCall,
4777
+ type RealtimeMcpToolExecutionError as RealtimeMcpToolExecutionError,
4778
+ type RealtimeMcphttpError as RealtimeMcphttpError,
4779
+ type RealtimeResponse as RealtimeResponse,
4780
+ type RealtimeResponseCreateAudioOutput as RealtimeResponseCreateAudioOutput,
4781
+ type RealtimeResponseCreateMcpTool as RealtimeResponseCreateMcpTool,
4782
+ type RealtimeResponseCreateParams as RealtimeResponseCreateParams,
4783
+ type RealtimeResponseStatus as RealtimeResponseStatus,
4784
+ type RealtimeResponseUsage as RealtimeResponseUsage,
4785
+ type RealtimeResponseUsageInputTokenDetails as RealtimeResponseUsageInputTokenDetails,
4786
+ type RealtimeResponseUsageOutputTokenDetails as RealtimeResponseUsageOutputTokenDetails,
4787
+ type RealtimeServerEvent as RealtimeServerEvent,
4788
+ type RealtimeSession as RealtimeSession,
4789
+ type RealtimeSessionCreateRequest as RealtimeSessionCreateRequest,
4790
+ type RealtimeToolChoiceConfig as RealtimeToolChoiceConfig,
4791
+ type RealtimeToolsConfig as RealtimeToolsConfig,
4792
+ type RealtimeToolsConfigUnion as RealtimeToolsConfigUnion,
4793
+ type RealtimeTracingConfig as RealtimeTracingConfig,
4794
+ type RealtimeTranscriptionSessionAudio as RealtimeTranscriptionSessionAudio,
4795
+ type RealtimeTranscriptionSessionAudioInput as RealtimeTranscriptionSessionAudioInput,
4796
+ type RealtimeTranscriptionSessionAudioInputTurnDetection as RealtimeTranscriptionSessionAudioInputTurnDetection,
4797
+ type RealtimeTranscriptionSessionCreateRequest as RealtimeTranscriptionSessionCreateRequest,
4798
+ type RealtimeTruncation as RealtimeTruncation,
4799
+ type RealtimeTruncationRetentionRatio as RealtimeTruncationRetentionRatio,
4800
+ type ResponseAudioDeltaEvent as ResponseAudioDeltaEvent,
4801
+ type ResponseAudioDoneEvent as ResponseAudioDoneEvent,
4802
+ type ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent,
4803
+ type ResponseAudioTranscriptDoneEvent as ResponseAudioTranscriptDoneEvent,
4804
+ type ResponseCancelEvent as ResponseCancelEvent,
4805
+ type ResponseContentPartAddedEvent as ResponseContentPartAddedEvent,
4806
+ type ResponseContentPartDoneEvent as ResponseContentPartDoneEvent,
4807
+ type ResponseCreateEvent as ResponseCreateEvent,
4808
+ type ResponseCreatedEvent as ResponseCreatedEvent,
4809
+ type ResponseDoneEvent as ResponseDoneEvent,
4810
+ type ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent,
4811
+ type ResponseFunctionCallArgumentsDoneEvent as ResponseFunctionCallArgumentsDoneEvent,
4812
+ type ResponseMcpCallArgumentsDelta as ResponseMcpCallArgumentsDelta,
4813
+ type ResponseMcpCallArgumentsDone as ResponseMcpCallArgumentsDone,
4814
+ type ResponseMcpCallCompleted as ResponseMcpCallCompleted,
4815
+ type ResponseMcpCallFailed as ResponseMcpCallFailed,
4816
+ type ResponseMcpCallInProgress as ResponseMcpCallInProgress,
4817
+ type ResponseOutputItemAddedEvent as ResponseOutputItemAddedEvent,
4818
+ type ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent,
4819
+ type ResponseTextDeltaEvent as ResponseTextDeltaEvent,
4820
+ type ResponseTextDoneEvent as ResponseTextDoneEvent,
4821
+ type SessionCreatedEvent as SessionCreatedEvent,
4822
+ type SessionUpdateEvent as SessionUpdateEvent,
4823
+ type SessionUpdatedEvent as SessionUpdatedEvent,
4824
+ type TranscriptionSessionUpdate as TranscriptionSessionUpdate,
4825
+ type TranscriptionSessionUpdatedEvent as TranscriptionSessionUpdatedEvent,
4826
+ };
4827
+
4828
+ export {
4829
+ ClientSecrets as ClientSecrets,
4830
+ type RealtimeSessionClientSecret as RealtimeSessionClientSecret,
4831
+ type RealtimeSessionCreateResponse as RealtimeSessionCreateResponse,
4832
+ type RealtimeTranscriptionSessionCreateResponse as RealtimeTranscriptionSessionCreateResponse,
4833
+ type RealtimeTranscriptionSessionTurnDetection as RealtimeTranscriptionSessionTurnDetection,
4834
+ type ClientSecretCreateResponse as ClientSecretCreateResponse,
4835
+ type ClientSecretCreateParams as ClientSecretCreateParams,
4836
+ };
4837
+
4838
+ export {
4839
+ Calls as Calls,
4840
+ type CallAcceptParams as CallAcceptParams,
4841
+ type CallReferParams as CallReferParams,
4842
+ type CallRejectParams as CallRejectParams,
4843
+ };
4844
+ }