openai 0.113.0 → 0.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -0
  3. data/README.md +17 -2
  4. data/docs/architecture/security-model.md +11 -16
  5. data/examples/responses/websocket_workflows.rb +78 -3
  6. data/lib/openai/auth/subject_token_providers/azure_managed_identity_token_provider.rb +10 -8
  7. data/lib/openai/auth/subject_token_providers/gcp_id_token_provider.rb +8 -7
  8. data/lib/openai/helpers/chat/tool_runner.rb +1 -1
  9. data/lib/openai/helpers/live/websocket.rb +31 -0
  10. data/lib/openai/helpers/realtime/connection.rb +33 -0
  11. data/lib/openai/helpers/realtime/connection_manager.rb +1 -0
  12. data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +5 -0
  13. data/lib/openai/helpers/realtime/recovery.rb +5 -1
  14. data/lib/openai/helpers/realtime/translation.rb +5 -0
  15. data/lib/openai/helpers/realtime/transports/async_websocket.rb +19 -0
  16. data/lib/openai/helpers/responses_websocket/connection.rb +53 -15
  17. data/lib/openai/helpers/responses_websocket/connection_manager.rb +1 -0
  18. data/lib/openai/helpers/responses_websocket/connection_resources.rb +1 -1
  19. data/lib/openai/helpers/structured_output/response_parser.rb +1 -0
  20. data/lib/openai/helpers/structured_output.rb +58 -0
  21. data/lib/openai/helpers/websocket/connection_manager.rb +11 -0
  22. data/lib/openai/helpers/websocket/resource.rb +1 -0
  23. data/lib/openai/helpers/websocket/typed_connection.rb +1 -0
  24. data/lib/openai/internal/type/array_of.rb +1 -1
  25. data/lib/openai/internal/type/hash_of.rb +1 -1
  26. data/lib/openai/internal/type/request_parameters.rb +2 -1
  27. data/lib/openai/internal/type/union.rb +18 -6
  28. data/lib/openai/models/admin/organization/external_key.rb +169 -0
  29. data/lib/openai/models/admin/organization/external_key_create_params.rb +311 -0
  30. data/lib/openai/models/admin/organization/external_key_delete_params.rb +24 -0
  31. data/lib/openai/models/admin/organization/external_key_list_params.rb +69 -0
  32. data/lib/openai/models/admin/organization/external_key_retrieve_params.rb +24 -0
  33. data/lib/openai/models/admin/organization/external_key_validate_params.rb +24 -0
  34. data/lib/openai/models/admin/organization/external_key_validate_response.rb +20 -0
  35. data/lib/openai/models/audio/speech_model.rb +12 -0
  36. data/lib/openai/models/audio_model.rb +15 -0
  37. data/lib/openai/models/beta/agent.rb +49 -1
  38. data/lib/openai/models/beta/agent_create_params.rb +51 -1
  39. data/lib/openai/models/beta/agent_session.rb +75 -2
  40. data/lib/openai/models/beta/agent_update_params.rb +62 -1
  41. data/lib/openai/models/beta/agents/session_create_params.rb +94 -2
  42. data/lib/openai/models/beta/agents/session_list_params.rb +16 -1
  43. data/lib/openai/models/beta/agents/session_update_params.rb +50 -5
  44. data/lib/openai/models/beta/assistant_update_params.rb +18 -0
  45. data/lib/openai/models/beta/beta_response.rb +224 -1
  46. data/lib/openai/models/beta/beta_response_configuration_update_item.rb +64 -3
  47. data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +64 -4
  48. data/lib/openai/models/beta/beta_response_input_file.rb +9 -9
  49. data/lib/openai/models/beta/beta_response_input_file_content.rb +9 -9
  50. data/lib/openai/models/beta/beta_response_input_image.rb +9 -9
  51. data/lib/openai/models/beta/beta_response_input_image_content.rb +9 -9
  52. data/lib/openai/models/beta/beta_response_input_item.rb +2 -3
  53. data/lib/openai/models/beta/beta_response_input_text.rb +9 -9
  54. data/lib/openai/models/beta/beta_response_input_text_content.rb +9 -9
  55. data/lib/openai/models/beta/beta_response_item.rb +11 -11
  56. data/lib/openai/models/beta/beta_response_output_item.rb +9 -9
  57. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +6 -6
  58. data/lib/openai/models/beta/beta_responses_client_event.rb +20 -1
  59. data/lib/openai/models/beta/beta_tool.rb +6 -6
  60. data/lib/openai/models/beta/response_compact_params.rb +6 -0
  61. data/lib/openai/models/beta/response_create_params.rb +6 -0
  62. data/lib/openai/models/chat/chat_completion_content_part.rb +9 -9
  63. data/lib/openai/models/chat/chat_completion_content_part_image.rb +9 -9
  64. data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +9 -9
  65. data/lib/openai/models/chat/chat_completion_content_part_text.rb +9 -9
  66. data/lib/openai/models/chat_model.rb +6 -0
  67. data/lib/openai/models/conversations/computer_screenshot_content.rb +9 -9
  68. data/lib/openai/models/conversations/conversation_item.rb +2 -2
  69. data/lib/openai/models/image_edit_params.rb +46 -25
  70. data/lib/openai/models/live/fork_server_event.rb +43 -3
  71. data/lib/openai/models/live/server_event.rb +43 -3
  72. data/lib/openai/models/live/sideband_client_event.rb +40 -1
  73. data/lib/openai/models/live/sideband_server_event.rb +43 -3
  74. data/lib/openai/models/realtime/audio_transcription.rb +15 -0
  75. data/lib/openai/models/realtime/conversation_item_added.rb +2 -2
  76. data/lib/openai/models/realtime/conversation_item_create_event.rb +2 -2
  77. data/lib/openai/models/realtime/conversation_item_created_event.rb +2 -2
  78. data/lib/openai/models/realtime/conversation_item_done.rb +2 -2
  79. data/lib/openai/models/realtime/realtime_response.rb +2 -2
  80. data/lib/openai/models/realtime/realtime_response_create_params.rb +2 -2
  81. data/lib/openai/models/realtime/realtime_server_event.rb +2 -2
  82. data/lib/openai/models/realtime/realtime_session.rb +18 -0
  83. data/lib/openai/models/realtime/realtime_session_create_request.rb +18 -0
  84. data/lib/openai/models/realtime/realtime_session_create_response.rb +18 -0
  85. data/lib/openai/models/realtime/response_output_item_added_event.rb +2 -2
  86. data/lib/openai/models/realtime/response_output_item_done_event.rb +2 -2
  87. data/lib/openai/models/responses/response.rb +221 -1
  88. data/lib/openai/models/responses/response_compact_params.rb +6 -0
  89. data/lib/openai/models/responses/response_configuration_update_item.rb +50 -3
  90. data/lib/openai/models/responses/response_configuration_update_item_param.rb +50 -4
  91. data/lib/openai/models/responses/response_input_file.rb +9 -9
  92. data/lib/openai/models/responses/response_input_file_content.rb +9 -9
  93. data/lib/openai/models/responses/response_input_image.rb +9 -9
  94. data/lib/openai/models/responses/response_input_image_content.rb +9 -9
  95. data/lib/openai/models/responses/response_input_item.rb +2 -3
  96. data/lib/openai/models/responses/response_input_text.rb +9 -9
  97. data/lib/openai/models/responses/response_input_text_content.rb +9 -9
  98. data/lib/openai/models/responses/response_item.rb +2 -2
  99. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +6 -6
  100. data/lib/openai/models/responses/responses_client_event.rb +14 -1
  101. data/lib/openai/models/responses/tool.rb +6 -6
  102. data/lib/openai/net_http_client.rb +6 -0
  103. data/lib/openai/providers/vertex.rb +0 -10
  104. data/lib/openai/resources/admin/organization/external_keys.rb +132 -0
  105. data/lib/openai/resources/admin/organization.rb +4 -0
  106. data/lib/openai/resources/audio/speech.rb +8 -0
  107. data/lib/openai/resources/audio/translations.rb +8 -0
  108. data/lib/openai/resources/beta/agents/sessions.rb +22 -6
  109. data/lib/openai/resources/beta/agents.rb +17 -2
  110. data/lib/openai/resources/images.rb +36 -18
  111. data/lib/openai/version.rb +1 -1
  112. data/lib/openai.rb +8 -0
  113. data/rbi/openai/helpers/live/websocket.rbi +1 -12
  114. data/rbi/openai/helpers/realtime/connection.rbi +5 -0
  115. data/rbi/openai/helpers/realtime/transports/async_websocket.rbi +5 -0
  116. data/rbi/openai/helpers/responses_websocket/connection.rbi +7 -2
  117. data/rbi/openai/helpers/structured_output.rbi +10 -0
  118. data/rbi/openai/internal/type/array_of.rbi +1 -1
  119. data/rbi/openai/internal/type/hash_of.rbi +1 -1
  120. data/rbi/openai/internal/type/union.rbi +5 -0
  121. data/rbi/openai/models/admin/organization/external_key.rbi +301 -0
  122. data/rbi/openai/models/admin/organization/external_key_create_params.rbi +532 -0
  123. data/rbi/openai/models/admin/organization/external_key_delete_params.rbi +57 -0
  124. data/rbi/openai/models/admin/organization/external_key_list_params.rbi +129 -0
  125. data/rbi/openai/models/admin/organization/external_key_retrieve_params.rbi +57 -0
  126. data/rbi/openai/models/admin/organization/external_key_validate_params.rbi +57 -0
  127. data/rbi/openai/models/admin/organization/external_key_validate_response.rbi +50 -0
  128. data/rbi/openai/models/beta/agent.rbi +103 -1
  129. data/rbi/openai/models/beta/agent_create_params.rbi +109 -0
  130. data/rbi/openai/models/beta/agent_session.rbi +136 -3
  131. data/rbi/openai/models/beta/agent_update_params.rbi +120 -0
  132. data/rbi/openai/models/beta/agents/session_create_params.rbi +153 -0
  133. data/rbi/openai/models/beta/agents/session_list_params.rbi +19 -0
  134. data/rbi/openai/models/beta/agents/session_update_params.rbi +94 -6
  135. data/rbi/openai/models/beta/beta_response.rbi +394 -0
  136. data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +113 -3
  137. data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +125 -4
  138. data/rbi/openai/models/beta/beta_response_input_file.rbi +9 -9
  139. data/rbi/openai/models/beta/beta_response_input_file_content.rbi +9 -9
  140. data/rbi/openai/models/beta/beta_response_input_image.rbi +9 -9
  141. data/rbi/openai/models/beta/beta_response_input_image_content.rbi +9 -9
  142. data/rbi/openai/models/beta/beta_response_input_text.rbi +9 -9
  143. data/rbi/openai/models/beta/beta_response_input_text_content.rbi +9 -9
  144. data/rbi/openai/models/beta/beta_response_item.rbi +9 -9
  145. data/rbi/openai/models/beta/beta_response_output_item.rbi +9 -9
  146. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +6 -6
  147. data/rbi/openai/models/beta/beta_responses_client_event.rbi +17 -0
  148. data/rbi/openai/models/beta/beta_tool.rbi +6 -6
  149. data/rbi/openai/models/chat/chat_completion_content_part.rbi +9 -9
  150. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +9 -9
  151. data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +9 -9
  152. data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +9 -9
  153. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +9 -9
  154. data/rbi/openai/models/decision_create_params.rbi +4 -1
  155. data/rbi/openai/models/image_edit_params.rbi +49 -24
  156. data/rbi/openai/models/live/fork_server_event.rbi +65 -1
  157. data/rbi/openai/models/live/server_event.rbi +65 -1
  158. data/rbi/openai/models/live/sideband_client_event.rbi +60 -0
  159. data/rbi/openai/models/live/sideband_server_event.rbi +65 -1
  160. data/rbi/openai/models/realtime/conversation_item_added.rbi +6 -3
  161. data/rbi/openai/models/realtime/conversation_item_create_event.rbi +6 -3
  162. data/rbi/openai/models/realtime/conversation_item_created_event.rbi +6 -3
  163. data/rbi/openai/models/realtime/conversation_item_done.rbi +6 -3
  164. data/rbi/openai/models/realtime/realtime_response.rbi +8 -4
  165. data/rbi/openai/models/realtime/realtime_response_create_params.rbi +8 -4
  166. data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -3
  167. data/rbi/openai/models/realtime/response_output_item_added_event.rbi +6 -3
  168. data/rbi/openai/models/realtime/response_output_item_done_event.rbi +6 -3
  169. data/rbi/openai/models/responses/response.rbi +394 -0
  170. data/rbi/openai/models/responses/response_configuration_update_item.rbi +76 -3
  171. data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +74 -4
  172. data/rbi/openai/models/responses/response_input_file.rbi +9 -9
  173. data/rbi/openai/models/responses/response_input_file_content.rbi +9 -9
  174. data/rbi/openai/models/responses/response_input_image.rbi +9 -9
  175. data/rbi/openai/models/responses/response_input_image_content.rbi +9 -9
  176. data/rbi/openai/models/responses/response_input_text.rbi +9 -9
  177. data/rbi/openai/models/responses/response_input_text_content.rbi +9 -9
  178. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +6 -6
  179. data/rbi/openai/models/responses/responses_client_event.rbi +17 -0
  180. data/rbi/openai/models/responses/tool.rbi +6 -6
  181. data/rbi/openai/net_http_client.rbi +5 -0
  182. data/rbi/openai/resources/admin/organization/external_keys.rbi +86 -0
  183. data/rbi/openai/resources/admin/organization.rbi +3 -0
  184. data/rbi/openai/resources/audio/speech.rbi +8 -0
  185. data/rbi/openai/resources/audio/translations.rbi +6 -0
  186. data/rbi/openai/resources/beta/agents/sessions.rbi +18 -2
  187. data/rbi/openai/resources/beta/agents.rbi +15 -0
  188. data/rbi/openai/resources/images.rbi +34 -16
  189. data/rbi/openai/resources/responses.rbi +2 -0
  190. data/realtime.md +6 -0
  191. data/responses-websocket.md +53 -0
  192. data/sig/openai/helpers/live/websocket.rbs +1 -9
  193. data/sig/openai/helpers/realtime/connection.rbs +3 -0
  194. data/sig/openai/helpers/realtime/transports/async_websocket.rbs +3 -0
  195. data/sig/openai/helpers/responses_websocket/connection.rbs +7 -1
  196. data/sig/openai/helpers/structured_output.rbs +9 -0
  197. data/sig/openai/internal/type/union.rbs +4 -0
  198. data/sig/openai/models/admin/organization/external_key.rbs +186 -0
  199. data/sig/openai/models/admin/organization/external_key_create_params.rbs +423 -0
  200. data/sig/openai/models/admin/organization/external_key_delete_params.rbs +27 -0
  201. data/sig/openai/models/admin/organization/external_key_list_params.rbs +81 -0
  202. data/sig/openai/models/admin/organization/external_key_retrieve_params.rbs +27 -0
  203. data/sig/openai/models/admin/organization/external_key_validate_params.rbs +27 -0
  204. data/sig/openai/models/admin/organization/external_key_validate_response.rbs +17 -0
  205. data/sig/openai/models/admin/organization/external_storage_create_params.rbs +72 -2
  206. data/sig/openai/models/audio/speech_create_params.rbs +15 -2
  207. data/sig/openai/models/audio/transcription_create_params.rbs +30 -2
  208. data/sig/openai/models/audio/voice_create_params.rbs +47 -2
  209. data/sig/openai/models/beta/agent.rbs +54 -2
  210. data/sig/openai/models/beta/agent_create_params.rbs +54 -0
  211. data/sig/openai/models/beta/agent_session.rbs +82 -3
  212. data/sig/openai/models/beta/agent_update_params.rbs +64 -0
  213. data/sig/openai/models/beta/agents/session_create_params.rbs +91 -0
  214. data/sig/openai/models/beta/agents/session_list_params.rbs +20 -0
  215. data/sig/openai/models/beta/agents/session_update_params.rbs +48 -6
  216. data/sig/openai/models/beta/assistant_create_params.rbs +5 -2
  217. data/sig/openai/models/beta/beta_response.rbs +223 -0
  218. data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +58 -2
  219. data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +58 -2
  220. data/sig/openai/models/beta/beta_response_input_file.rbs +9 -9
  221. data/sig/openai/models/beta/beta_response_input_file_content.rbs +6 -6
  222. data/sig/openai/models/beta/beta_response_input_image.rbs +9 -9
  223. data/sig/openai/models/beta/beta_response_input_image_content.rbs +6 -6
  224. data/sig/openai/models/beta/beta_response_input_text.rbs +9 -9
  225. data/sig/openai/models/beta/beta_response_input_text_content.rbs +6 -6
  226. data/sig/openai/models/beta/beta_response_item.rbs +9 -9
  227. data/sig/openai/models/beta/beta_response_output_item.rbs +9 -9
  228. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +4 -4
  229. data/sig/openai/models/beta/beta_responses_client_event.rbs +17 -0
  230. data/sig/openai/models/beta/beta_tool.rbs +4 -4
  231. data/sig/openai/models/beta/response_create_params.rbs +5 -2
  232. data/sig/openai/models/beta/responses/input_token_count_params.rbs +10 -2
  233. data/sig/openai/models/beta/thread_create_and_run_params.rbs +11 -5
  234. data/sig/openai/models/beta/thread_create_params.rbs +11 -5
  235. data/sig/openai/models/beta/threads/message_create_params.rbs +6 -3
  236. data/sig/openai/models/beta/threads/run_create_params.rbs +6 -3
  237. data/sig/openai/models/chat/chat_completion_content_part.rbs +9 -9
  238. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +9 -9
  239. data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +9 -9
  240. data/sig/openai/models/chat/chat_completion_content_part_text.rbs +9 -9
  241. data/sig/openai/models/conversations/computer_screenshot_content.rbs +9 -9
  242. data/sig/openai/models/decision_create_params.rbs +27 -2
  243. data/sig/openai/models/eval_create_params.rbs +25 -4
  244. data/sig/openai/models/evals/run_create_params.rbs +52 -8
  245. data/sig/openai/models/image_edit_params.rbs +47 -16
  246. data/sig/openai/models/live/fork_server_event.rbs +39 -0
  247. data/sig/openai/models/live/server_event.rbs +39 -0
  248. data/sig/openai/models/live/session_accept_params.rbs +39 -2
  249. data/sig/openai/models/live/sideband_client_event.rbs +32 -0
  250. data/sig/openai/models/live/sideband_server_event.rbs +39 -0
  251. data/sig/openai/models/realtime/conversation_item.rbs +1 -0
  252. data/sig/openai/models/responses/input_token_count_params.rbs +10 -2
  253. data/sig/openai/models/responses/response.rbs +223 -0
  254. data/sig/openai/models/responses/response_configuration_update_item.rbs +45 -2
  255. data/sig/openai/models/responses/response_configuration_update_item_param.rbs +45 -2
  256. data/sig/openai/models/responses/response_create_params.rbs +5 -2
  257. data/sig/openai/models/responses/response_input_file.rbs +9 -9
  258. data/sig/openai/models/responses/response_input_file_content.rbs +6 -6
  259. data/sig/openai/models/responses/response_input_image.rbs +9 -9
  260. data/sig/openai/models/responses/response_input_image_content.rbs +6 -6
  261. data/sig/openai/models/responses/response_input_text.rbs +9 -9
  262. data/sig/openai/models/responses/response_input_text_content.rbs +6 -6
  263. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +4 -4
  264. data/sig/openai/models/responses/responses_client_event.rbs +17 -0
  265. data/sig/openai/models/responses/tool.rbs +4 -4
  266. data/sig/openai/models/video_edit_params.rbs +11 -2
  267. data/sig/openai/models/video_extend_params.rbs +11 -2
  268. data/sig/openai/net_http_client.rbs +3 -0
  269. data/sig/openai/resources/admin/organization/external_keys.rbs +70 -0
  270. data/sig/openai/resources/admin/organization/external_storage.rbs +23 -1
  271. data/sig/openai/resources/admin/organization.rbs +2 -0
  272. data/sig/openai/resources/audio/speech.rbs +2 -1
  273. data/sig/openai/resources/audio/transcriptions.rbs +14 -2
  274. data/sig/openai/resources/audio/voices.rbs +14 -1
  275. data/sig/openai/resources/beta/agents/sessions.rbs +4 -0
  276. data/sig/openai/resources/beta/agents.rbs +4 -0
  277. data/sig/openai/resources/beta/responses/input_tokens.rbs +2 -1
  278. data/sig/openai/resources/beta/responses.rbs +4 -2
  279. data/sig/openai/resources/decisions.rbs +7 -1
  280. data/sig/openai/resources/images.rbs +2 -0
  281. data/sig/openai/resources/responses/input_tokens.rbs +2 -1
  282. data/sig/openai/resources/responses.rbs +5 -2
  283. data/sig/openai/resources/videos.rbs +2 -2
  284. metadata +25 -1
@@ -35,6 +35,7 @@ module OpenAI
35
35
  ?service_tier: OpenAI::Models::Responses::Response::service_tier?,
36
36
  ?status: OpenAI::Models::Responses::response_status,
37
37
  ?text: OpenAI::Responses::ResponseTextConfig,
38
+ ?tool_usage: OpenAI::Responses::Response::ToolUsage,
38
39
  ?top_logprobs: Integer?,
39
40
  ?truncation: OpenAI::Models::Responses::Response::truncation?,
40
41
  ?usage: OpenAI::Responses::ResponseUsage,
@@ -278,6 +279,36 @@ module OpenAI
278
279
  OpenAI::Responses::ResponseTextConfig
279
280
  ) -> OpenAI::Responses::ResponseTextConfig
280
281
 
282
+ # Usage reported by hosted tools, separate from base model `usage`. The field can
283
+ # be omitted when tool usage is unavailable. When present, tool families with no
284
+ # recorded usage have zero counts.
285
+ #
286
+ # `image_gen` sums available token counts across image generation calls. Calls
287
+ # with missing or incomplete usage records may be skipped. Output token details
288
+ # and cached input counts can be omitted. An omitted cache count means cache usage
289
+ # is unknown.
290
+ #
291
+ # `web_search.num_requests` counts billable searches. Discounted searches and
292
+ # actions such as opening a page are excluded. Use billing records to reconcile
293
+ # final charges.
294
+ attr_reader tool_usage: OpenAI::Responses::Response::ToolUsage?
295
+
296
+ # Usage reported by hosted tools, separate from base model `usage`. The field can
297
+ # be omitted when tool usage is unavailable. When present, tool families with no
298
+ # recorded usage have zero counts.
299
+ #
300
+ # `image_gen` sums available token counts across image generation calls. Calls
301
+ # with missing or incomplete usage records may be skipped. Output token details
302
+ # and cached input counts can be omitted. An omitted cache count means cache usage
303
+ # is unknown.
304
+ #
305
+ # `web_search.num_requests` counts billable searches. Discounted searches and
306
+ # actions such as opening a page are excluded. Use billing records to reconcile
307
+ # final charges.
308
+ def tool_usage=: (
309
+ OpenAI::Responses::Response::ToolUsage
310
+ ) -> OpenAI::Responses::Response::ToolUsage
311
+
281
312
  # An integer between 0 and 20 specifying the maximum number of most likely tokens
282
313
  # to return at each token position, each with an associated log probability. In
283
314
  # some cases, the number of returned tokens may be fewer than requested.
@@ -491,6 +522,19 @@ module OpenAI
491
522
  #
492
523
  # - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
493
524
  # - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
525
+ # @param tool_usage
526
+ # Usage reported by hosted tools, separate from base model `usage`. The field can
527
+ # be omitted when tool usage is unavailable. When present, tool families with no
528
+ # recorded usage have zero counts.
529
+ #
530
+ # `image_gen` sums available token counts across image generation calls. Calls
531
+ # with missing or incomplete usage records may be skipped. Output token details
532
+ # and cached input counts can be omitted. An omitted cache count means cache usage
533
+ # is unknown.
534
+ #
535
+ # `web_search.num_requests` counts billable searches. Discounted searches and
536
+ # actions such as opening a page are excluded. Use billing records to reconcile
537
+ # final charges.
494
538
  # @param top_logprobs
495
539
  # An integer between 0 and 20 specifying the maximum number of most likely tokens
496
540
  # to return at each token position, each with an associated log probability. In
@@ -546,6 +590,7 @@ module OpenAI
546
590
  ?service_tier: OpenAI::Models::Responses::Response::service_tier?,
547
591
  ?status: OpenAI::Models::Responses::response_status,
548
592
  ?text: OpenAI::Responses::ResponseTextConfig,
593
+ ?tool_usage: OpenAI::Responses::Response::ToolUsage,
549
594
  ?top_logprobs: Integer?,
550
595
  ?truncation: OpenAI::Models::Responses::Response::truncation?,
551
596
  ?usage: OpenAI::Responses::ResponseUsage,
@@ -586,6 +631,7 @@ module OpenAI
586
631
  ?service_tier: OpenAI::Models::Responses::Response::service_tier?,
587
632
  ?status: OpenAI::Models::Responses::response_status,
588
633
  ?text: OpenAI::Responses::ResponseTextConfig,
634
+ ?tool_usage: OpenAI::Responses::Response::ToolUsage,
589
635
  ?top_logprobs: Integer?,
590
636
  ?truncation: OpenAI::Models::Responses::Response::truncation?,
591
637
  ?usage: OpenAI::Responses::ResponseUsage,
@@ -1175,6 +1221,183 @@ module OpenAI
1175
1221
  def self?.values: -> ::Array[OpenAI::Models::Responses::Response::service_tier]
1176
1222
  end
1177
1223
 
1224
+ type tool_usage =
1225
+ {
1226
+ image_gen: OpenAI::Responses::Response::ToolUsage::ImageGen,
1227
+ web_search: OpenAI::Responses::Response::ToolUsage::WebSearch
1228
+ }
1229
+
1230
+ class ToolUsage < OpenAI::Internal::Type::BaseModel
1231
+ # Aggregated usage statistics for image generation tool calls.
1232
+ attr_accessor image_gen: OpenAI::Responses::Response::ToolUsage::ImageGen
1233
+
1234
+ # Aggregated billable usage statistics for web search tool calls.
1235
+ attr_accessor web_search: OpenAI::Responses::Response::ToolUsage::WebSearch
1236
+
1237
+ # @param image_gen
1238
+ # Aggregated usage statistics for image generation tool calls.
1239
+ # @param web_search
1240
+ # Aggregated billable usage statistics for web search tool calls.
1241
+ def initialize: (
1242
+ image_gen: OpenAI::Responses::Response::ToolUsage::ImageGen,
1243
+ web_search: OpenAI::Responses::Response::ToolUsage::WebSearch
1244
+ ) -> void
1245
+
1246
+ def to_hash: -> {
1247
+ image_gen: OpenAI::Responses::Response::ToolUsage::ImageGen,
1248
+ web_search: OpenAI::Responses::Response::ToolUsage::WebSearch
1249
+ }
1250
+
1251
+ type image_gen =
1252
+ {
1253
+ input_tokens: Integer,
1254
+ input_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::InputTokensDetails,
1255
+ output_tokens: Integer,
1256
+ total_tokens: Integer,
1257
+ ?cached_tokens: Integer,
1258
+ ?cached_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails,
1259
+ ?output_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails
1260
+ }
1261
+
1262
+ class ImageGen < OpenAI::Internal::Type::BaseModel
1263
+ # The number of tokens (images and text) in the input prompt.
1264
+ attr_accessor input_tokens: Integer
1265
+
1266
+ # The input tokens detailed information for the image generation.
1267
+ attr_accessor input_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::InputTokensDetails
1268
+
1269
+ # The number of output tokens generated by the model.
1270
+ attr_accessor output_tokens: Integer
1271
+
1272
+ # The total number of tokens (images and text) used for the image generation.
1273
+ attr_accessor total_tokens: Integer
1274
+
1275
+ attr_reader cached_tokens: Integer?
1276
+
1277
+ def cached_tokens=: (Integer) -> Integer
1278
+
1279
+ attr_reader cached_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails?
1280
+
1281
+ def cached_tokens_details=: (
1282
+ OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails
1283
+ ) -> OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails
1284
+
1285
+ # The output token details for the image generation.
1286
+ attr_reader output_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails?
1287
+
1288
+ # The output token details for the image generation.
1289
+ def output_tokens_details=: (
1290
+ OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails
1291
+ ) -> OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails
1292
+
1293
+ # @param input_tokens
1294
+ # The number of tokens (images and text) in the input prompt.
1295
+ # @param input_tokens_details
1296
+ # The input tokens detailed information for the image generation.
1297
+ # @param output_tokens
1298
+ # The number of output tokens generated by the model.
1299
+ # @param total_tokens
1300
+ # The total number of tokens (images and text) used for the image generation.
1301
+ # @param output_tokens_details
1302
+ # The output token details for the image generation.
1303
+ def initialize: (
1304
+ input_tokens: Integer,
1305
+ input_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::InputTokensDetails,
1306
+ output_tokens: Integer,
1307
+ total_tokens: Integer,
1308
+ ?cached_tokens: Integer,
1309
+ ?cached_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails,
1310
+ ?output_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails
1311
+ ) -> void
1312
+
1313
+ def to_hash: -> {
1314
+ input_tokens: Integer,
1315
+ input_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::InputTokensDetails,
1316
+ output_tokens: Integer,
1317
+ total_tokens: Integer,
1318
+ ?cached_tokens: Integer,
1319
+ ?cached_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails,
1320
+ ?output_tokens_details: OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails
1321
+ }
1322
+
1323
+ type input_tokens_details =
1324
+ { image_tokens: Integer, text_tokens: Integer }
1325
+
1326
+ class InputTokensDetails < OpenAI::Internal::Type::BaseModel
1327
+ # The number of image tokens in the input prompt.
1328
+ attr_accessor image_tokens: Integer
1329
+
1330
+ # The number of text tokens in the input prompt.
1331
+ attr_accessor text_tokens: Integer
1332
+
1333
+ # @param image_tokens
1334
+ # The number of image tokens in the input prompt.
1335
+ # @param text_tokens
1336
+ # The number of text tokens in the input prompt.
1337
+ def initialize: (
1338
+ image_tokens: Integer,
1339
+ text_tokens: Integer
1340
+ ) -> void
1341
+
1342
+ def to_hash: -> { image_tokens: Integer, text_tokens: Integer }
1343
+ end
1344
+
1345
+ type cached_tokens_details =
1346
+ { cached_image_tokens: Integer, cached_text_tokens: Integer }
1347
+
1348
+ class CachedTokensDetails < OpenAI::Internal::Type::BaseModel
1349
+ attr_accessor cached_image_tokens: Integer
1350
+
1351
+ attr_accessor cached_text_tokens: Integer
1352
+
1353
+ def initialize: (
1354
+ cached_image_tokens: Integer,
1355
+ cached_text_tokens: Integer
1356
+ ) -> void
1357
+
1358
+ def to_hash: -> {
1359
+ cached_image_tokens: Integer,
1360
+ cached_text_tokens: Integer
1361
+ }
1362
+ end
1363
+
1364
+ type output_tokens_details =
1365
+ { image_tokens: Integer, text_tokens: Integer }
1366
+
1367
+ class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
1368
+ # The number of image output tokens generated by the model.
1369
+ attr_accessor image_tokens: Integer
1370
+
1371
+ # The number of text output tokens generated by the model.
1372
+ attr_accessor text_tokens: Integer
1373
+
1374
+ # @param image_tokens
1375
+ # The number of image output tokens generated by the model.
1376
+ # @param text_tokens
1377
+ # The number of text output tokens generated by the model.
1378
+ def initialize: (
1379
+ image_tokens: Integer,
1380
+ text_tokens: Integer
1381
+ ) -> void
1382
+
1383
+ def to_hash: -> { image_tokens: Integer, text_tokens: Integer }
1384
+ end
1385
+ end
1386
+
1387
+ type web_search = { num_requests: Integer }
1388
+
1389
+ class WebSearch < OpenAI::Internal::Type::BaseModel
1390
+ # The number of billable web search requests issued.
1391
+ attr_accessor num_requests: Integer
1392
+
1393
+ # @param num_requests
1394
+ # The number of billable web search requests issued.
1395
+ def initialize: (num_requests: Integer) -> void
1396
+
1397
+ def to_hash: -> { num_requests: Integer }
1398
+ end
1399
+ end
1400
+
1178
1401
  type truncation = :auto | :disabled
1179
1402
 
1180
1403
  module Truncation
@@ -5,7 +5,8 @@ module OpenAI
5
5
  {
6
6
  id: String,
7
7
  ?type: :configuration_update,
8
- ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning
8
+ ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning,
9
+ ?text: OpenAI::Responses::ResponseConfigurationUpdateItem::Text
9
10
  }
10
11
 
11
12
  class ResponseConfigurationUpdateItem < OpenAI::Internal::Type::BaseModel
@@ -23,22 +24,34 @@ module OpenAI
23
24
  OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning
24
25
  ) -> OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning
25
26
 
27
+ # The text output configuration for subsequent responses.
28
+ attr_reader text: OpenAI::Responses::ResponseConfigurationUpdateItem::Text?
29
+
30
+ # The text output configuration for subsequent responses.
31
+ def text=: (
32
+ OpenAI::Responses::ResponseConfigurationUpdateItem::Text
33
+ ) -> OpenAI::Responses::ResponseConfigurationUpdateItem::Text
34
+
26
35
  # @param id
27
36
  # The unique ID of the configuration update item.
28
37
  # @param reasoning
29
38
  # The reasoning configuration applied by this update.
39
+ # @param text
40
+ # The text output configuration for subsequent responses.
30
41
  # @param type
31
42
  # The item type. Always `configuration_update`.
32
43
  def initialize: (
33
44
  id: String,
34
45
  ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning,
46
+ ?text: OpenAI::Responses::ResponseConfigurationUpdateItem::Text,
35
47
  ?type: :configuration_update
36
48
  ) -> void
37
49
 
38
50
  def to_hash: -> {
39
51
  id: String,
40
52
  ?type: :configuration_update,
41
- ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning
53
+ ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning,
54
+ ?text: OpenAI::Responses::ResponseConfigurationUpdateItem::Text
42
55
  }
43
56
 
44
57
  type reasoning = { ?effort: OpenAI::Models::reasoning_effort? }
@@ -55,6 +68,36 @@ module OpenAI
55
68
 
56
69
  def to_hash: -> { ?effort: OpenAI::Models::reasoning_effort? }
57
70
  end
71
+
72
+ type text =
73
+ {
74
+ format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text::format_
75
+ }
76
+
77
+ class Text < OpenAI::Internal::Type::BaseModel
78
+ # Use a JSON schema for structured output or text to return to plain text.
79
+ attr_accessor format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text::format_
80
+
81
+ # @param format_
82
+ # Use a JSON schema for structured output or text to return to plain text.
83
+ def initialize: (
84
+ format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text::format_
85
+ ) -> void
86
+
87
+ def to_hash: -> {
88
+ format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text::format_
89
+ }
90
+
91
+ type format_ =
92
+ OpenAI::ResponseFormatText
93
+ | OpenAI::Responses::ResponseFormatTextJSONSchemaConfig
94
+
95
+ module Format
96
+ extend OpenAI::Internal::Type::Union
97
+
98
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text::format_]
99
+ end
100
+ end
58
101
  end
59
102
  end
60
103
  end
@@ -5,7 +5,8 @@ module OpenAI
5
5
  {
6
6
  ?type: :configuration_update,
7
7
  ?id: String?,
8
- ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning
8
+ ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning,
9
+ ?text: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text
9
10
  }
10
11
 
11
12
  class ResponseConfigurationUpdateItemParam < OpenAI::Internal::Type::BaseModel
@@ -23,22 +24,34 @@ module OpenAI
23
24
  OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning
24
25
  ) -> OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning
25
26
 
27
+ # The text output configuration for subsequent responses.
28
+ attr_reader text: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text?
29
+
30
+ # The text output configuration for subsequent responses.
31
+ def text=: (
32
+ OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text
33
+ ) -> OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text
34
+
26
35
  # @param id
27
36
  # The unique ID of the configuration update item.
28
37
  # @param reasoning
29
38
  # Updates to reasoning configuration. Only effort is supported.
39
+ # @param text
40
+ # The text output configuration for subsequent responses.
30
41
  # @param type
31
42
  # The item type. Always `configuration_update`.
32
43
  def initialize: (
33
44
  ?id: String?,
34
45
  ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning,
46
+ ?text: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text,
35
47
  ?type: :configuration_update
36
48
  ) -> void
37
49
 
38
50
  def to_hash: -> {
39
51
  ?type: :configuration_update,
40
52
  ?id: String?,
41
- ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning
53
+ ?reasoning: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning,
54
+ ?text: OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text
42
55
  }
43
56
 
44
57
  type reasoning = { ?effort: OpenAI::Models::reasoning_effort? }
@@ -55,6 +68,36 @@ module OpenAI
55
68
 
56
69
  def to_hash: -> { ?effort: OpenAI::Models::reasoning_effort? }
57
70
  end
71
+
72
+ type text =
73
+ {
74
+ format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text::format_
75
+ }
76
+
77
+ class Text < OpenAI::Internal::Type::BaseModel
78
+ # Use a JSON schema for structured output or text to return to plain text.
79
+ attr_accessor format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text::format_
80
+
81
+ # @param format_
82
+ # Use a JSON schema for structured output or text to return to plain text.
83
+ def initialize: (
84
+ format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text::format_
85
+ ) -> void
86
+
87
+ def to_hash: -> {
88
+ format_: OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text::format_
89
+ }
90
+
91
+ type format_ =
92
+ OpenAI::ResponseFormatText
93
+ | OpenAI::Responses::ResponseFormatTextJSONSchemaConfig
94
+
95
+ module Format
96
+ extend OpenAI::Internal::Type::Union
97
+
98
+ def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text::format_]
99
+ end
100
+ end
58
101
  end
59
102
  end
60
103
  end
@@ -293,7 +293,9 @@ module OpenAI
293
293
  # can call.
294
294
  def tool_choice=: (
295
295
  OpenAI::Models::Responses::ResponseCreateParams::tool_choice
296
- ) -> OpenAI::Models::Responses::ResponseCreateParams::tool_choice
296
+ | { type: :programmatic_tool_calling }
297
+ ) -> (OpenAI::Models::Responses::ResponseCreateParams::tool_choice
298
+ | { type: :programmatic_tool_calling })
297
299
 
298
300
  # An array of tools the model may call while generating a response. You can
299
301
  # specify which tool to use by setting the `tool_choice` parameter.
@@ -619,7 +621,8 @@ module OpenAI
619
621
  ?stream_options: OpenAI::Responses::ResponseCreateParams::StreamOptions?,
620
622
  ?temperature: Float?,
621
623
  ?text: OpenAI::Responses::ResponseTextConfig,
622
- ?tool_choice: OpenAI::Models::Responses::ResponseCreateParams::tool_choice,
624
+ ?tool_choice: OpenAI::Models::Responses::ResponseCreateParams::tool_choice
625
+ | { type: :programmatic_tool_calling },
623
626
  ?tools: ::Array[OpenAI::Models::Responses::tool],
624
627
  ?top_logprobs: Integer?,
625
628
  ?top_p: Float?,
@@ -53,14 +53,14 @@ module OpenAI
53
53
  # The name of the file to be sent to the model.
54
54
  def filename=: (String) -> String
55
55
 
56
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
57
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
58
- # token block.
56
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
57
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
58
+ # not rounded to a token block.
59
59
  attr_reader prompt_cache_breakpoint: OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint?
60
60
 
61
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
62
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
63
- # token block.
61
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
62
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
63
+ # not rounded to a token block.
64
64
  def prompt_cache_breakpoint=: (
65
65
  OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint
66
66
  ) -> OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint
@@ -80,9 +80,9 @@ module OpenAI
80
80
  # @param filename
81
81
  # The name of the file to be sent to the model.
82
82
  # @param prompt_cache_breakpoint
83
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
84
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
85
- # token block.
83
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
84
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
85
+ # not rounded to a token block.
86
86
  # @param type
87
87
  # The type of the input item. Always `input_file`.
88
88
  def initialize: (
@@ -44,9 +44,9 @@ module OpenAI
44
44
  # The name of the file to be sent to the model.
45
45
  attr_accessor filename: String?
46
46
 
47
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
48
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
49
- # token block.
47
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
48
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
49
+ # not rounded to a token block.
50
50
  attr_accessor prompt_cache_breakpoint: OpenAI::Responses::ResponseInputFileContent::PromptCacheBreakpoint?
51
51
 
52
52
  # @param detail
@@ -64,9 +64,9 @@ module OpenAI
64
64
  # @param filename
65
65
  # The name of the file to be sent to the model.
66
66
  # @param prompt_cache_breakpoint
67
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
68
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
69
- # token block.
67
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
68
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
69
+ # not rounded to a token block.
70
70
  # @param type
71
71
  # The type of the input item. Always `input_file`.
72
72
  def initialize: (
@@ -25,14 +25,14 @@ module OpenAI
25
25
  # encoded image in a data URL.
26
26
  attr_accessor image_url: String?
27
27
 
28
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
29
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
30
- # token block.
28
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
29
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
30
+ # not rounded to a token block.
31
31
  attr_reader prompt_cache_breakpoint: OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint?
32
32
 
33
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
34
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
35
- # token block.
33
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
34
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
35
+ # not rounded to a token block.
36
36
  def prompt_cache_breakpoint=: (
37
37
  OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint
38
38
  ) -> OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint
@@ -46,9 +46,9 @@ module OpenAI
46
46
  # The URL of the image to be sent to the model. A fully qualified URL or base64
47
47
  # encoded image in a data URL.
48
48
  # @param prompt_cache_breakpoint
49
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
50
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
51
- # token block.
49
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
50
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
51
+ # not rounded to a token block.
52
52
  # @param type
53
53
  # The type of the input item. Always `input_image`.
54
54
  def initialize: (
@@ -25,9 +25,9 @@ module OpenAI
25
25
  # encoded image in a data URL.
26
26
  attr_accessor image_url: String?
27
27
 
28
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
29
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
30
- # token block.
28
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
29
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
30
+ # not rounded to a token block.
31
31
  attr_accessor prompt_cache_breakpoint: OpenAI::Responses::ResponseInputImageContent::PromptCacheBreakpoint?
32
32
 
33
33
  # @param detail
@@ -39,9 +39,9 @@ module OpenAI
39
39
  # The URL of the image to be sent to the model. A fully qualified URL or base64
40
40
  # encoded image in a data URL.
41
41
  # @param prompt_cache_breakpoint
42
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
43
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
44
- # token block.
42
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
43
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
44
+ # not rounded to a token block.
45
45
  # @param type
46
46
  # The type of the input item. Always `input_image`.
47
47
  def initialize: (
@@ -15,14 +15,14 @@ module OpenAI
15
15
  # The type of the input item. Always `input_text`.
16
16
  attr_accessor type: :input_text
17
17
 
18
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
19
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
20
- # token block.
18
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
19
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
20
+ # not rounded to a token block.
21
21
  attr_reader prompt_cache_breakpoint: OpenAI::Responses::ResponseInputText::PromptCacheBreakpoint?
22
22
 
23
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
24
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
25
- # token block.
23
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
24
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
25
+ # not rounded to a token block.
26
26
  def prompt_cache_breakpoint=: (
27
27
  OpenAI::Responses::ResponseInputText::PromptCacheBreakpoint
28
28
  ) -> OpenAI::Responses::ResponseInputText::PromptCacheBreakpoint
@@ -30,9 +30,9 @@ module OpenAI
30
30
  # @param text
31
31
  # The text input to the model.
32
32
  # @param prompt_cache_breakpoint
33
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
34
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
35
- # token block.
33
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
34
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
35
+ # not rounded to a token block.
36
36
  # @param type
37
37
  # The type of the input item. Always `input_text`.
38
38
  def initialize: (
@@ -15,17 +15,17 @@ module OpenAI
15
15
  # The type of the input item. Always `input_text`.
16
16
  attr_accessor type: :input_text
17
17
 
18
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
19
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
20
- # token block.
18
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
19
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
20
+ # not rounded to a token block.
21
21
  attr_accessor prompt_cache_breakpoint: OpenAI::Responses::ResponseInputTextContent::PromptCacheBreakpoint?
22
22
 
23
23
  # @param text
24
24
  # The text input to the model.
25
25
  # @param prompt_cache_breakpoint
26
- # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
27
- # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
28
- # token block.
26
+ # Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
27
+ # breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
28
+ # not rounded to a token block.
29
29
  # @param type
30
30
  # The type of the input item. Always `input_text`.
31
31
  def initialize: (
@@ -710,8 +710,8 @@ module OpenAI
710
710
 
711
711
  # Control how much effort the model will exert to match the style and features,
712
712
  # especially facial features, of input images. Supports `high` and `low` on
713
- # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
714
- # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
713
+ # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
714
+ # this parameter. Defaults to `low` on supported models.
715
715
  attr_accessor input_fidelity: OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::input_fidelity?
716
716
 
717
717
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
@@ -833,8 +833,8 @@ module OpenAI
833
833
  # @param input_fidelity
834
834
  # Control how much effort the model will exert to match the style and features,
835
835
  # especially facial features, of input images. Supports `high` and `low` on
836
- # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
837
- # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
836
+ # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
837
+ # this parameter. Defaults to `low` on supported models.
838
838
  # @param input_image_mask
839
839
  # Optional mask for inpainting. Contains `image_url` (string, optional) and
840
840
  # `file_id` (string, optional).