openai 0.97.0 → 0.99.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 (244) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +76 -1
  4. data/lib/openai/helpers/agents/session_stream.rb +60 -3
  5. data/lib/openai/helpers/beta/agents/artifacts.rb +72 -0
  6. data/lib/openai/helpers/beta/agents/creation_stream.rb +69 -0
  7. data/lib/openai/helpers/beta/agents/files.rb +236 -0
  8. data/lib/openai/helpers/beta/agents/function_tool.rb +65 -0
  9. data/lib/openai/helpers/beta/agents/model_adapter.rb +27 -0
  10. data/lib/openai/helpers/beta/agents/result.rb +170 -0
  11. data/lib/openai/helpers/beta/agents/typed_output.rb +191 -0
  12. data/lib/openai/helpers/live/websocket.rb +7 -1
  13. data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +1 -1
  14. data/lib/openai/helpers/responses_websocket/connection.rb +7 -1
  15. data/lib/openai/helpers/responses_websocket/session.rb +5 -1
  16. data/lib/openai/helpers/responses_websocket/transports/async_websocket.rb +12 -2
  17. data/lib/openai/internal/transport/base_client.rb +18 -0
  18. data/lib/openai/internal/type/array_of.rb +1 -1
  19. data/lib/openai/internal/type/base_model.rb +6 -3
  20. data/lib/openai/internal/type/converter.rb +50 -3
  21. data/lib/openai/internal/type/hash_of.rb +1 -1
  22. data/lib/openai/internal/type/union.rb +6 -6
  23. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
  24. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
  25. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
  26. data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
  27. data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
  28. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
  29. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
  30. data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
  31. data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
  32. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
  33. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
  34. data/lib/openai/models/all_models.rb +42 -0
  35. data/lib/openai/models/audio/speech_create_params.rb +6 -0
  36. data/lib/openai/models/audio/voice.rb +75 -0
  37. data/lib/openai/models/audio/voice_create_params.rb +217 -0
  38. data/lib/openai/models/beta/agent_create_params.rb +0 -3
  39. data/lib/openai/models/beta/agent_update_params.rb +0 -3
  40. data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
  41. data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
  42. data/lib/openai/models/beta/agents/sessions/session_trace.rb +64 -0
  43. data/lib/openai/models/beta/agents/sessions/trace_list_params.rb +68 -0
  44. data/lib/openai/models/beta/agents/vaults/credential.rb +8 -4
  45. data/lib/openai/models/beta/beta_response.rb +220 -0
  46. data/lib/openai/models/beta/beta_response_output_text.rb +2 -2
  47. data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +2 -2
  48. data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
  49. data/lib/openai/models/beta/beta_tool.rb +3 -9
  50. data/lib/openai/models/beta/environment.rb +33 -1
  51. data/lib/openai/models/beta/environment_param.rb +24 -1
  52. data/lib/openai/models/beta/response_compact_params.rb +220 -0
  53. data/lib/openai/models/beta/response_create_params.rb +220 -0
  54. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  55. data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
  56. data/lib/openai/models/chat/chat_completion_content_part_image.rb +1 -0
  57. data/lib/openai/models/chat_model.rb +178 -0
  58. data/lib/openai/models/image.rb +14 -14
  59. data/lib/openai/models/image_create_variation_params.rb +7 -7
  60. data/lib/openai/models/image_edit_params.rb +76 -87
  61. data/lib/openai/models/image_generate_params.rb +51 -62
  62. data/lib/openai/models/image_model.rb +5 -3
  63. data/lib/openai/models/live/fork_server_event.rb +14 -3
  64. data/lib/openai/models/live/server_event.rb +14 -3
  65. data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
  66. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
  67. data/lib/openai/models/realtime/translations/client_secret_create_params.rb +28 -0
  68. data/lib/openai/models/responses/response_compact_params.rb +220 -0
  69. data/lib/openai/models/responses/response_output_text.rb +2 -2
  70. data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +2 -2
  71. data/lib/openai/models/responses/tool.rb +3 -9
  72. data/lib/openai/models/responses_model.rb +42 -0
  73. data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
  74. data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
  75. data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
  76. data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
  77. data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
  78. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
  79. data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
  80. data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
  81. data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
  82. data/lib/openai/resources/audio/speech.rb +2 -0
  83. data/lib/openai/resources/audio/voices.rb +53 -0
  84. data/lib/openai/resources/audio.rb +5 -0
  85. data/lib/openai/resources/beta/agents/environments/files.rb +31 -0
  86. data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -0
  87. data/lib/openai/resources/beta/agents/sessions/events.rb +6 -5
  88. data/lib/openai/resources/beta/agents/sessions/traces.rb +58 -0
  89. data/lib/openai/resources/beta/agents/sessions.rb +18 -5
  90. data/lib/openai/resources/evals/runs.rb +1 -1
  91. data/lib/openai/resources/images.rb +71 -103
  92. data/lib/openai/resources/realtime/translations/client_secrets.rb +58 -0
  93. data/lib/openai/resources/realtime/translations.rb +20 -0
  94. data/lib/openai/resources/realtime.rb +4 -0
  95. data/lib/openai/resources/webhooks.rb +1 -1
  96. data/lib/openai/version.rb +1 -1
  97. data/lib/openai.rb +17 -1
  98. data/rbi/openai/helpers/agents.rbi +20 -1
  99. data/rbi/openai/helpers/beta/agents/artifacts.rbi +29 -0
  100. data/rbi/openai/helpers/beta/agents/files.rbi +65 -0
  101. data/rbi/openai/helpers/beta/agents/function_tool.rbi +40 -0
  102. data/rbi/openai/helpers/beta/agents/model_adapter.rbi +22 -0
  103. data/rbi/openai/helpers/beta/agents.rbi +146 -0
  104. data/rbi/openai/internal/transport/base_client.rbi +12 -0
  105. data/rbi/openai/internal/type/base_model.rbi +2 -2
  106. data/rbi/openai/internal/type/converter.rbi +21 -3
  107. data/rbi/openai/internal/type/union.rbi +6 -2
  108. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
  109. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
  110. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
  111. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
  112. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
  113. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
  114. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
  115. data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
  116. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
  117. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
  118. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
  119. data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
  120. data/rbi/openai/models/audio/voice.rbi +111 -0
  121. data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
  122. data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
  123. data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
  124. data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
  125. data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
  126. data/rbi/openai/models/beta/agents/sessions/session_trace.rbi +97 -0
  127. data/rbi/openai/models/beta/agents/sessions/trace_list_params.rbi +121 -0
  128. data/rbi/openai/models/beta/agents/vaults/credential.rbi +5 -5
  129. data/rbi/openai/models/beta/beta_response_output_text.rbi +2 -2
  130. data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +2 -2
  131. data/rbi/openai/models/beta/beta_tool.rbi +3 -9
  132. data/rbi/openai/models/beta/environment.rbi +29 -0
  133. data/rbi/openai/models/beta/environment_param.rbi +31 -0
  134. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  135. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
  136. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +1 -0
  137. data/rbi/openai/models/image.rbi +14 -14
  138. data/rbi/openai/models/image_create_variation_params.rbi +6 -6
  139. data/rbi/openai/models/image_edit_params.rbi +61 -82
  140. data/rbi/openai/models/image_generate_params.rbi +30 -61
  141. data/rbi/openai/models/image_model.rbi +3 -3
  142. data/rbi/openai/models/live/fork_server_event.rbi +14 -2
  143. data/rbi/openai/models/live/server_event.rbi +14 -2
  144. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
  145. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
  146. data/rbi/openai/models/realtime/translations/client_secret_create_params.rbi +68 -0
  147. data/rbi/openai/models/responses/response_output_text.rbi +2 -2
  148. data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +2 -2
  149. data/rbi/openai/models/responses/tool.rbi +3 -9
  150. data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
  151. data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
  152. data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
  153. data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
  154. data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
  155. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
  156. data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
  157. data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
  158. data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
  159. data/rbi/openai/resources/audio/speech.rbi +2 -0
  160. data/rbi/openai/resources/audio/voices.rbi +49 -0
  161. data/rbi/openai/resources/audio.rbi +4 -0
  162. data/rbi/openai/resources/beta/agents/environments/files.rbi +31 -0
  163. data/rbi/openai/resources/beta/agents/sessions/artifacts.rbi +8 -0
  164. data/rbi/openai/resources/beta/agents/sessions/events.rbi +6 -5
  165. data/rbi/openai/resources/beta/agents/sessions/traces.rbi +54 -0
  166. data/rbi/openai/resources/beta/agents/sessions.rbi +6 -1
  167. data/rbi/openai/resources/images.rbi +69 -103
  168. data/rbi/openai/resources/realtime/translations/client_secrets.rbi +54 -0
  169. data/rbi/openai/resources/realtime/translations.rbi +22 -0
  170. data/rbi/openai/resources/realtime.rbi +3 -0
  171. data/rbi/openai/resources/webhooks.rbi +5 -0
  172. data/sig/openai/helpers/agents.rbs +7 -0
  173. data/sig/openai/helpers/beta/agents/artifacts.rbs +20 -0
  174. data/sig/openai/helpers/beta/agents/files.rbs +41 -0
  175. data/sig/openai/helpers/beta/agents/function_tool.rbs +24 -0
  176. data/sig/openai/helpers/beta/agents/model_adapter.rbs +16 -0
  177. data/sig/openai/helpers/beta/agents.rbs +71 -0
  178. data/sig/openai/helpers/structured_output.rbs +12 -0
  179. data/sig/openai/internal/transport/base_client.rbs +8 -0
  180. data/sig/openai/internal/type/base_model.rbs +3 -1
  181. data/sig/openai/internal/type/converter.rbs +16 -2
  182. data/sig/openai/internal/type/union.rbs +2 -1
  183. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
  184. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
  185. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
  186. data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
  187. data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
  188. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
  189. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
  190. data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
  191. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
  192. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
  193. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
  194. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  195. data/sig/openai/models/audio/voice.rbs +70 -0
  196. data/sig/openai/models/audio/voice_create_params.rbs +203 -0
  197. data/sig/openai/models/beta/agent_create_params.rbs +1 -5
  198. data/sig/openai/models/beta/agent_update_params.rbs +1 -5
  199. data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
  200. data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
  201. data/sig/openai/models/beta/agents/sessions/session_trace.rbs +65 -0
  202. data/sig/openai/models/beta/agents/sessions/trace_list_params.rbs +81 -0
  203. data/sig/openai/models/beta/agents/vaults/credential.rbs +5 -5
  204. data/sig/openai/models/beta/beta_response_output_text.rbs +2 -2
  205. data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +2 -2
  206. data/sig/openai/models/beta/beta_tool.rbs +3 -9
  207. data/sig/openai/models/beta/environment.rbs +22 -0
  208. data/sig/openai/models/beta/environment_param.rbs +25 -0
  209. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  210. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
  211. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +2 -1
  212. data/sig/openai/models/image.rbs +21 -21
  213. data/sig/openai/models/image_create_variation_params.rbs +4 -4
  214. data/sig/openai/models/image_edit_params.rbs +46 -60
  215. data/sig/openai/models/image_generate_params.rbs +23 -45
  216. data/sig/openai/models/image_model.rbs +6 -6
  217. data/sig/openai/models/live/fork_server_event.rbs +17 -2
  218. data/sig/openai/models/live/server_event.rbs +17 -2
  219. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
  220. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
  221. data/sig/openai/models/realtime/translations/client_secret_create_params.rbs +39 -0
  222. data/sig/openai/models/responses/response_output_text.rbs +2 -2
  223. data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +2 -2
  224. data/sig/openai/models/responses/tool.rbs +3 -9
  225. data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
  226. data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
  227. data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
  228. data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
  229. data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
  230. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
  231. data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
  232. data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
  233. data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
  234. data/sig/openai/resources/audio/voices.rbs +14 -0
  235. data/sig/openai/resources/audio.rbs +2 -0
  236. data/sig/openai/resources/beta/agents/environments/files.rbs +17 -0
  237. data/sig/openai/resources/beta/agents/sessions/artifacts.rbs +4 -0
  238. data/sig/openai/resources/beta/agents/sessions/traces.rbs +21 -0
  239. data/sig/openai/resources/beta/agents/sessions.rbs +4 -1
  240. data/sig/openai/resources/realtime/translations/client_secrets.rbs +17 -0
  241. data/sig/openai/resources/realtime/translations.rbs +11 -0
  242. data/sig/openai/resources/realtime.rbs +2 -0
  243. data/sig/openai/resources/webhooks.rbs +6 -1
  244. metadata +61 -1
@@ -16,8 +16,7 @@ module OpenAI
16
16
  end
17
17
 
18
18
  # A text description of the desired image(s). The maximum length is 32000
19
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
20
- # characters for `dall-e-3`.
19
+ # characters.
21
20
  sig { returns(String) }
22
21
  attr_accessor :prompt
23
22
 
@@ -33,12 +32,11 @@ module OpenAI
33
32
  sig { returns(T.nilable(OpenAI::ImageGenerateParams::Background::OrSymbol)) }
34
33
  attr_accessor :background
35
34
 
36
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
37
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
38
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
35
+ # The GPT image model to use for image generation. Specify a model explicitly.
36
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
37
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
39
38
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
40
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
41
- # specific to the GPT image models is used.
39
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
42
40
  sig { returns(T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol))) }
43
41
  attr_accessor :model
44
42
 
@@ -48,8 +46,7 @@ module OpenAI
48
46
  sig { returns(T.nilable(OpenAI::ImageGenerateParams::Moderation::OrSymbol)) }
49
47
  attr_accessor :moderation
50
48
 
51
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
52
- # `n=1` is supported.
49
+ # The number of images to generate. Must be between 1 and 10.
53
50
  sig { returns(T.nilable(Integer)) }
54
51
  attr_accessor :n
55
52
 
@@ -80,14 +77,10 @@ module OpenAI
80
77
  # - `high`, `medium` and `low` are supported for the GPT image models.
81
78
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
82
79
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
83
- # - `hd` and `standard` are supported for `dall-e-3`.
84
- # - `standard` is the only option for `dall-e-2`.
85
80
  sig { returns(T.nilable(OpenAI::ImageGenerateParams::Quality::OrSymbol)) }
86
81
  attr_accessor :quality
87
82
 
88
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
89
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
90
- # after the image has been generated. This parameter isn't supported for the GPT
83
+ # Legacy response format parameter for retired image models. Unsupported for GPT
91
84
  # image models, which always return base64-encoded images.
92
85
  sig { returns(T.nilable(OpenAI::ImageGenerateParams::ResponseFormat::OrSymbol)) }
93
86
  attr_accessor :response_format
@@ -101,16 +94,12 @@ module OpenAI
101
94
  # the maximum supported resolution is `3840x2160`. The requested size must also
102
95
  # satisfy the model's current pixel and edge limits. The standard sizes
103
96
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
104
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
105
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
106
- # `1024x1024`, `1792x1024`, or `1024x1792`.
97
+ # `auto` is supported for models that allow automatic sizing.
107
98
  sig { returns(T.nilable(T.any(String, OpenAI::ImageGenerateParams::Size::OrSymbol))) }
108
99
  attr_accessor :size
109
100
 
110
- # The style of the generated images. This parameter is only supported for
111
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
112
- # towards generating hyper-real and dramatic images. Natural causes the model to
113
- # produce more natural, less hyper-real looking images.
101
+ # Legacy style parameter for retired image models. Unsupported for GPT image
102
+ # models; describe the desired style in the prompt instead.
114
103
  sig { returns(T.nilable(OpenAI::ImageGenerateParams::Style::OrSymbol)) }
115
104
  attr_accessor :style
116
105
 
@@ -159,8 +148,7 @@ module OpenAI
159
148
  def self.new(
160
149
 
161
150
  # A text description of the desired image(s). The maximum length is 32000
162
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
163
- # characters for `dall-e-3`.
151
+ # characters.
164
152
  prompt:,
165
153
 
166
154
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -174,12 +162,11 @@ module OpenAI
174
162
  # set the output format to `png` or `webp`.
175
163
  background: nil,
176
164
 
177
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
178
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
179
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
165
+ # The GPT image model to use for image generation. Specify a model explicitly.
166
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
167
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
180
168
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
181
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
182
- # specific to the GPT image models is used.
169
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
183
170
  model: nil,
184
171
 
185
172
  # Control the content-moderation level for images generated by the GPT image
@@ -187,8 +174,7 @@ module OpenAI
187
174
  # value).
188
175
  moderation: nil,
189
176
 
190
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
191
- # `n=1` is supported.
177
+ # The number of images to generate. Must be between 1 and 10.
192
178
  n: nil,
193
179
 
194
180
  # The compression level (0-100%) for the generated images. This parameter is only
@@ -215,13 +201,9 @@ module OpenAI
215
201
  # - `high`, `medium` and `low` are supported for the GPT image models.
216
202
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
217
203
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
218
- # - `hd` and `standard` are supported for `dall-e-3`.
219
- # - `standard` is the only option for `dall-e-2`.
220
204
  quality: nil,
221
205
 
222
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
223
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
224
- # after the image has been generated. This parameter isn't supported for the GPT
206
+ # Legacy response format parameter for retired image models. Unsupported for GPT
225
207
  # image models, which always return base64-encoded images.
226
208
  response_format: nil,
227
209
 
@@ -234,15 +216,11 @@ module OpenAI
234
216
  # the maximum supported resolution is `3840x2160`. The requested size must also
235
217
  # satisfy the model's current pixel and edge limits. The standard sizes
236
218
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
237
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
238
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
239
- # `1024x1024`, `1792x1024`, or `1024x1792`.
219
+ # `auto` is supported for models that allow automatic sizing.
240
220
  size: nil,
241
221
 
242
- # The style of the generated images. This parameter is only supported for
243
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
244
- # towards generating hyper-real and dramatic images. Natural causes the model to
245
- # produce more natural, less hyper-real looking images.
222
+ # Legacy style parameter for retired image models. Unsupported for GPT image
223
+ # models; describe the desired style in the prompt instead.
246
224
  style: nil,
247
225
 
248
226
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -301,12 +279,11 @@ module OpenAI
301
279
  end
302
280
  end
303
281
 
304
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
305
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
306
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
282
+ # The GPT image model to use for image generation. Specify a model explicitly.
283
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
284
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
307
285
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
308
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
309
- # specific to the GPT image models is used.
286
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
310
287
  module Model
311
288
  extend OpenAI::Internal::Type::Union
312
289
 
@@ -359,31 +336,27 @@ module OpenAI
359
336
  # - `high`, `medium` and `low` are supported for the GPT image models.
360
337
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
361
338
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
362
- # - `hd` and `standard` are supported for `dall-e-3`.
363
- # - `standard` is the only option for `dall-e-2`.
364
339
  module Quality
365
340
  extend OpenAI::Internal::Type::Enum
366
341
 
367
342
  TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageGenerateParams::Quality) }
368
343
  OrSymbol = T.type_alias { T.any(Symbol, String) }
369
344
 
370
- STANDARD = T.let(:standard, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
371
- HD = T.let(:hd, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
372
345
  LOW = T.let(:low, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
373
346
  MEDIUM = T.let(:medium, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
374
347
  HIGH = T.let(:high, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
375
348
  XHIGH = T.let(:xhigh, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
376
349
  MAX = T.let(:max, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
377
350
  AUTO = T.let(:auto, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
351
+ STANDARD = T.let(:standard, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
352
+ HD = T.let(:hd, OpenAI::ImageGenerateParams::Quality::TaggedSymbol)
378
353
 
379
354
  sig { override.returns(T::Array[OpenAI::ImageGenerateParams::Quality::TaggedSymbol]) }
380
355
  def self.values
381
356
  end
382
357
  end
383
358
 
384
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
385
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
386
- # after the image has been generated. This parameter isn't supported for the GPT
359
+ # Legacy response format parameter for retired image models. Unsupported for GPT
387
360
  # image models, which always return base64-encoded images.
388
361
  module ResponseFormat
389
362
  extend OpenAI::Internal::Type::Enum
@@ -408,9 +381,7 @@ module OpenAI
408
381
  # the maximum supported resolution is `3840x2160`. The requested size must also
409
382
  # satisfy the model's current pixel and edge limits. The standard sizes
410
383
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
411
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
412
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
413
- # `1024x1024`, `1792x1024`, or `1024x1792`.
384
+ # `auto` is supported for models that allow automatic sizing.
414
385
  module Size
415
386
  extend OpenAI::Internal::Type::Union
416
387
 
@@ -437,10 +408,8 @@ module OpenAI
437
408
 
438
409
  end
439
410
 
440
- # The style of the generated images. This parameter is only supported for
441
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
442
- # towards generating hyper-real and dramatic images. Natural causes the model to
443
- # produce more natural, less hyper-real looking images.
411
+ # Legacy style parameter for retired image models. Unsupported for GPT image
412
+ # models; describe the desired style in the prompt instead.
444
413
  module Style
445
414
  extend OpenAI::Internal::Type::Enum
446
415
 
@@ -9,15 +9,15 @@ module OpenAI
9
9
  TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageModel) }
10
10
  OrSymbol = T.type_alias { T.any(Symbol, String) }
11
11
 
12
- GPT_IMAGE_1 = T.let(:"gpt-image-1", OpenAI::ImageModel::TaggedSymbol)
13
- GPT_IMAGE_1_MINI = T.let(:"gpt-image-1-mini", OpenAI::ImageModel::TaggedSymbol)
12
+ GPT_IMAGE_1_5 = T.let(:"gpt-image-1.5", OpenAI::ImageModel::TaggedSymbol)
14
13
  GPT_IMAGE_2 = T.let(:"gpt-image-2", OpenAI::ImageModel::TaggedSymbol)
15
14
  GPT_IMAGE_2_2026_04_21 = T.let(:"gpt-image-2-2026-04-21", OpenAI::ImageModel::TaggedSymbol)
16
15
  GPT_IMAGE_2_5_SUNBURST = T.let(:"gpt-image-2.5-sunburst", OpenAI::ImageModel::TaggedSymbol)
17
16
  GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let(:"gpt-image-2.5-sunburst-2026-09-08", OpenAI::ImageModel::TaggedSymbol)
18
17
  GPT_IMAGE_2_5_FLARE = T.let(:"gpt-image-2.5-flare", OpenAI::ImageModel::TaggedSymbol)
19
18
  GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let(:"gpt-image-2.5-flare-2026-09-08", OpenAI::ImageModel::TaggedSymbol)
20
- GPT_IMAGE_1_5 = T.let(:"gpt-image-1.5", OpenAI::ImageModel::TaggedSymbol)
19
+ GPT_IMAGE_1 = T.let(:"gpt-image-1", OpenAI::ImageModel::TaggedSymbol)
20
+ GPT_IMAGE_1_MINI = T.let(:"gpt-image-1-mini", OpenAI::ImageModel::TaggedSymbol)
21
21
  CHATGPT_IMAGE_LATEST = T.let(:"chatgpt-image-latest", OpenAI::ImageModel::TaggedSymbol)
22
22
  DALL_E_2 = T.let(:"dall-e-2", OpenAI::ImageModel::TaggedSymbol)
23
23
  DALL_E_3 = T.let(:"dall-e-3", OpenAI::ImageModel::TaggedSymbol)
@@ -159,7 +159,14 @@ module OpenAI
159
159
  sig { returns(Symbol) }
160
160
  attr_accessor :type
161
161
 
162
- # A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to
162
+ # The event_id of the client command, when supplied.
163
+ sig { returns(T.nilable(String)) }
164
+ attr_reader :client_event_id
165
+
166
+ sig { params(client_event_id: String).void }
167
+ attr_writer :client_event_id
168
+
169
+ # A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
163
170
  # sideband observers; this is not a client command.
164
171
  sig do
165
172
  params(
@@ -168,6 +175,8 @@ module OpenAI
168
175
 
169
176
  event_id: String,
170
177
 
178
+ client_event_id: String,
179
+
171
180
  type: Symbol
172
181
  )
173
182
  .returns(T.attached_class)
@@ -178,13 +187,16 @@ module OpenAI
178
187
 
179
188
  event_id:,
180
189
 
190
+ # The event_id of the client command, when supplied.
191
+ client_event_id: nil,
192
+
181
193
  type: :"transport.dtmf.send"
182
194
  )
183
195
  end
184
196
 
185
197
  sig do
186
198
  override.returns(
187
- {event: String, event_id: String, type: Symbol}
199
+ {event: String, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
188
200
  )
189
201
  end
190
202
  def to_hash
@@ -159,7 +159,14 @@ module OpenAI
159
159
  sig { returns(Symbol) }
160
160
  attr_accessor :type
161
161
 
162
- # A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to
162
+ # The event_id of the client command, when supplied.
163
+ sig { returns(T.nilable(String)) }
164
+ attr_reader :client_event_id
165
+
166
+ sig { params(client_event_id: String).void }
167
+ attr_writer :client_event_id
168
+
169
+ # A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
163
170
  # sideband observers; this is not a client command.
164
171
  sig do
165
172
  params(
@@ -168,6 +175,8 @@ module OpenAI
168
175
 
169
176
  event_id: String,
170
177
 
178
+ client_event_id: String,
179
+
171
180
  type: Symbol
172
181
  )
173
182
  .returns(T.attached_class)
@@ -178,13 +187,16 @@ module OpenAI
178
187
 
179
188
  event_id:,
180
189
 
190
+ # The event_id of the client command, when supplied.
191
+ client_event_id: nil,
192
+
181
193
  type: :"transport.dtmf.send"
182
194
  )
183
195
  end
184
196
 
185
197
  sig do
186
198
  override.returns(
187
- {event: String, event_id: String, type: Symbol}
199
+ {event: String, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
188
200
  )
189
201
  end
190
202
  def to_hash
@@ -57,8 +57,9 @@ module OpenAI
57
57
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
58
58
  # `cedar`. You may also provide a custom voice object with an `id`, for example
59
59
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
60
- # model has responded with audio at least once. We recommend `marin` and `cedar`
61
- # for best quality.
60
+ # model has responded with audio at least once. Custom voices must be created from
61
+ # audio samples. Voices created from text prompts are supported only in Live. We
62
+ # recommend `marin` and `cedar` for best quality.
62
63
  sig {
63
64
  returns(
64
65
  T.nilable(
@@ -121,8 +122,9 @@ module OpenAI
121
122
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
122
123
  # `cedar`. You may also provide a custom voice object with an `id`, for example
123
124
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
124
- # model has responded with audio at least once. We recommend `marin` and `cedar`
125
- # for best quality.
125
+ # model has responded with audio at least once. Custom voices must be created from
126
+ # audio samples. Voices created from text prompts are supported only in Live. We
127
+ # recommend `marin` and `cedar` for best quality.
126
128
 
127
129
  voice: nil
128
130
  )
@@ -152,8 +154,9 @@ module OpenAI
152
154
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
153
155
  # `cedar`. You may also provide a custom voice object with an `id`, for example
154
156
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
155
- # model has responded with audio at least once. We recommend `marin` and `cedar`
156
- # for best quality.
157
+ # model has responded with audio at least once. Custom voices must be created from
158
+ # audio samples. Voices created from text prompts are supported only in Live. We
159
+ # recommend `marin` and `cedar` for best quality.
157
160
  module Voice
158
161
  extend OpenAI::Internal::Type::Union
159
162
 
@@ -80,8 +80,9 @@ module OpenAI
80
80
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
81
81
  # `cedar`. You may also provide a custom voice object with an `id`, for example
82
82
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
83
- # model has responded with audio at least once. We recommend `marin` and `cedar`
84
- # for best quality.
83
+ # model has responded with audio at least once. Custom voices must be created from
84
+ # audio samples. Voices created from text prompts are supported only in Live. We
85
+ # recommend `marin` and `cedar` for best quality.
85
86
  sig {
86
87
  returns(
87
88
  T.nilable(
@@ -133,8 +134,9 @@ module OpenAI
133
134
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
134
135
  # `cedar`. You may also provide a custom voice object with an `id`, for example
135
136
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
136
- # model has responded with audio at least once. We recommend `marin` and `cedar`
137
- # for best quality.
137
+ # model has responded with audio at least once. Custom voices must be created from
138
+ # audio samples. Voices created from text prompts are supported only in Live. We
139
+ # recommend `marin` and `cedar` for best quality.
138
140
 
139
141
  voice: nil
140
142
  )
@@ -163,8 +165,9 @@ module OpenAI
163
165
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
164
166
  # `cedar`. You may also provide a custom voice object with an `id`, for example
165
167
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
166
- # model has responded with audio at least once. We recommend `marin` and `cedar`
167
- # for best quality.
168
+ # model has responded with audio at least once. Custom voices must be created from
169
+ # audio samples. Voices created from text prompts are supported only in Live. We
170
+ # recommend `marin` and `cedar` for best quality.
168
171
  module Voice
169
172
  extend OpenAI::Internal::Type::Union
170
173
 
@@ -0,0 +1,68 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Realtime
7
+
8
+ module Translations
9
+
10
+ class ClientSecretCreateParams < OpenAI::Models::Realtime::RealtimeTranslationClientSecretCreateRequest
11
+
12
+ extend OpenAI::Internal::Type::RequestParameters::Converter
13
+ include OpenAI::Internal::Type::RequestParameters
14
+
15
+ OrHash = T.type_alias do
16
+ T.any(
17
+ OpenAI::Realtime::Translations::ClientSecretCreateParams,
18
+ OpenAI::Internal::AnyHash
19
+ )
20
+ end
21
+
22
+ sig do
23
+ params(
24
+
25
+ session: OpenAI::Realtime::RealtimeTranslationSessionCreateRequest::OrHash,
26
+
27
+ expires_after: OpenAI::Realtime::RealtimeTranslationClientSecretCreateRequest::ExpiresAfter::OrHash,
28
+
29
+ request_options: OpenAI::RequestOptions::OrHash
30
+ )
31
+ .returns(T.attached_class)
32
+ end
33
+ def self.new(
34
+
35
+ # Realtime translation session configuration. Translation sessions stream source
36
+ # audio in and translated audio plus transcript deltas out continuously.
37
+ session:,
38
+
39
+ # Configuration for the client secret expiration. Expiration refers to the time
40
+ # after which a client secret will no longer be valid for creating sessions. The
41
+ # session itself may continue after that time once started. A secret can be used
42
+ # to create multiple sessions until it expires.
43
+ expires_after: nil,
44
+
45
+ request_options: {}
46
+ )
47
+ end
48
+
49
+ sig do
50
+ override.returns(
51
+ {
52
+ session: OpenAI::Realtime::RealtimeTranslationSessionCreateRequest,
53
+ expires_after: OpenAI::Realtime::RealtimeTranslationClientSecretCreateRequest::ExpiresAfter,
54
+ request_options: OpenAI::RequestOptions
55
+ }
56
+ )
57
+ end
58
+ def to_hash
59
+ end
60
+
61
+ end
62
+
63
+ end
64
+
65
+ end
66
+
67
+ end
68
+ end
@@ -133,7 +133,7 @@ module OpenAI
133
133
  sig { returns(String) }
134
134
  attr_accessor :filename
135
135
 
136
- # The index of the file in the list of files.
136
+ # The index in the output text at which to insert the file citation.
137
137
  sig { returns(Integer) }
138
138
  attr_accessor :index
139
139
 
@@ -163,7 +163,7 @@ module OpenAI
163
163
  # The filename of the file cited.
164
164
  filename:,
165
165
 
166
- # The index of the file in the list of files.
166
+ # The index in the output text at which to insert the file citation.
167
167
  index:,
168
168
 
169
169
  # The type of the file citation. Always `file_citation`.
@@ -140,7 +140,7 @@ module OpenAI
140
140
  sig { returns(String) }
141
141
  attr_accessor :filename
142
142
 
143
- # The index of the file in the list of files.
143
+ # The index in the output text at which to insert the file citation.
144
144
  sig { returns(Integer) }
145
145
  attr_accessor :index
146
146
 
@@ -170,7 +170,7 @@ module OpenAI
170
170
  # The filename of the file cited.
171
171
  filename:,
172
172
 
173
- # The index of the file in the list of files.
173
+ # The index in the output text at which to insert the file citation.
174
174
  index:,
175
175
 
176
176
  # The type of the file citation. Always `file_citation`.
@@ -1051,9 +1051,7 @@ module OpenAI
1051
1051
  # the maximum supported resolution is `3840x2160`. The requested size must also
1052
1052
  # satisfy the model's current pixel and edge limits. The standard sizes
1053
1053
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1054
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
1055
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
1056
- # `1024x1024`, `1792x1024`, or `1024x1792`.
1054
+ # `auto` is supported for models that allow automatic sizing.
1057
1055
  sig { returns(T.nilable(T.any(String, OpenAI::Responses::Tool::ImageGeneration::Size::OrSymbol))) }
1058
1056
  attr_reader :size
1059
1057
 
@@ -1151,9 +1149,7 @@ module OpenAI
1151
1149
  # the maximum supported resolution is `3840x2160`. The requested size must also
1152
1150
  # satisfy the model's current pixel and edge limits. The standard sizes
1153
1151
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1154
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
1155
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
1156
- # `1024x1024`, `1792x1024`, or `1024x1792`.
1152
+ # `auto` is supported for models that allow automatic sizing.
1157
1153
  size: nil,
1158
1154
 
1159
1155
  # The type of the image generation tool. Always `image_generation`.
@@ -1408,9 +1404,7 @@ module OpenAI
1408
1404
  # the maximum supported resolution is `3840x2160`. The requested size must also
1409
1405
  # satisfy the model's current pixel and edge limits. The standard sizes
1410
1406
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1411
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
1412
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
1413
- # `1024x1024`, `1792x1024`, or `1024x1792`.
1407
+ # `auto` is supported for models that allow automatic sizing.
1414
1408
  module Size
1415
1409
  extend OpenAI::Internal::Type::Union
1416
1410