openai 0.98.0 → 0.100.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 (245) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/bedrock.md +17 -1
  5. data/lib/openai/client.rb +9 -0
  6. data/lib/openai/helpers/agents/session_stream.rb +11 -36
  7. data/lib/openai/helpers/agents/tools.rb +34 -4
  8. data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
  9. data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
  10. data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
  11. data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
  12. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +140 -5
  13. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +140 -5
  14. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +140 -5
  15. data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
  16. data/lib/openai/models/admin/organization/usage_completions_response.rb +140 -5
  17. data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
  18. data/lib/openai/models/admin/organization/usage_costs_response.rb +140 -5
  19. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +140 -5
  20. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +140 -5
  21. data/lib/openai/models/admin/organization/usage_images_response.rb +140 -5
  22. data/lib/openai/models/admin/organization/usage_moderations_response.rb +140 -5
  23. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +140 -5
  24. data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
  25. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +140 -5
  26. data/lib/openai/models/all_models.rb +42 -0
  27. data/lib/openai/models/audio/speech_create_params.rb +6 -0
  28. data/lib/openai/models/audio/voice.rb +75 -0
  29. data/lib/openai/models/audio/voice_create_params.rb +217 -0
  30. data/lib/openai/models/beta/agent_create_params.rb +0 -3
  31. data/lib/openai/models/beta/agent_update_params.rb +0 -3
  32. data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
  33. data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
  34. data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
  35. data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
  36. data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
  37. data/lib/openai/models/beta/beta_response.rb +220 -0
  38. data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
  39. data/lib/openai/models/beta/beta_response_error.rb +12 -1
  40. data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
  41. data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
  42. data/lib/openai/models/beta/beta_tool.rb +15 -18
  43. data/lib/openai/models/beta/environment_param.rb +6 -6
  44. data/lib/openai/models/beta/response_compact_params.rb +220 -0
  45. data/lib/openai/models/beta/response_create_params.rb +220 -0
  46. data/lib/openai/models/beta/session_turn_error.rb +9 -0
  47. data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
  48. data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
  49. data/lib/openai/models/chat_model.rb +178 -0
  50. data/lib/openai/models/error_object.rb +12 -1
  51. data/lib/openai/models/eval_create_params.rb +1 -1
  52. data/lib/openai/models/eval_create_response.rb +1 -1
  53. data/lib/openai/models/eval_list_response.rb +1 -1
  54. data/lib/openai/models/eval_retrieve_response.rb +1 -1
  55. data/lib/openai/models/eval_update_response.rb +1 -1
  56. data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
  57. data/lib/openai/models/graders/score_model_grader.rb +2 -2
  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 +88 -96
  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/realtime/realtime_audio_config_output.rb +9 -6
  64. data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
  65. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
  66. data/lib/openai/models/realtime/session_update_event.rb +16 -0
  67. data/lib/openai/models/responses/response_compact_params.rb +220 -0
  68. data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
  69. data/lib/openai/models/responses/response_error.rb +12 -1
  70. data/lib/openai/models/responses/responses_server_event.rb +12 -1
  71. data/lib/openai/models/responses/tool.rb +15 -18
  72. data/lib/openai/models/responses_model.rb +42 -0
  73. data/lib/openai/models/video_create_error.rb +12 -1
  74. data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
  75. data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
  76. data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
  77. data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
  78. data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
  79. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
  80. data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
  81. data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
  82. data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
  83. data/lib/openai/providers/bedrock.rb +20 -1
  84. data/lib/openai/resources/admin/organization/usage.rb +15 -6
  85. data/lib/openai/resources/audio/speech.rb +2 -0
  86. data/lib/openai/resources/audio/voices.rb +53 -0
  87. data/lib/openai/resources/audio.rb +5 -0
  88. data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
  89. data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
  90. data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
  91. data/lib/openai/resources/beta/agents/sessions.rb +22 -2
  92. data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
  93. data/lib/openai/resources/images.rb +79 -109
  94. data/lib/openai/resources/webhooks.rb +1 -1
  95. data/lib/openai/version.rb +1 -1
  96. data/lib/openai.rb +10 -0
  97. data/rbi/openai/helpers/agents.rbi +2 -0
  98. data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
  99. data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
  100. data/rbi/openai/helpers/beta/agents.rbi +12 -0
  101. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +213 -3
  102. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +213 -3
  103. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +213 -3
  104. data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
  105. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +213 -3
  106. data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
  107. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +213 -3
  108. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +213 -3
  109. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +213 -3
  110. data/rbi/openai/models/admin/organization/usage_images_response.rbi +213 -3
  111. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +213 -3
  112. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +213 -3
  113. data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
  114. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +213 -3
  115. data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
  116. data/rbi/openai/models/audio/voice.rbi +111 -0
  117. data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
  118. data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
  119. data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
  120. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
  121. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
  122. data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
  123. data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
  124. data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
  125. data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
  126. data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
  127. data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
  128. data/rbi/openai/models/beta/beta_tool.rbi +15 -18
  129. data/rbi/openai/models/beta/environment_param.rbi +6 -6
  130. data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
  131. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
  132. data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
  133. data/rbi/openai/models/error_object.rbi +12 -0
  134. data/rbi/openai/models/eval_create_params.rbi +1 -1
  135. data/rbi/openai/models/eval_create_response.rbi +1 -1
  136. data/rbi/openai/models/eval_list_response.rbi +1 -1
  137. data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
  138. data/rbi/openai/models/eval_update_response.rbi +1 -1
  139. data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
  140. data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
  141. data/rbi/openai/models/image.rbi +14 -14
  142. data/rbi/openai/models/image_create_variation_params.rbi +6 -6
  143. data/rbi/openai/models/image_edit_params.rbi +73 -91
  144. data/rbi/openai/models/image_generate_params.rbi +30 -61
  145. data/rbi/openai/models/image_model.rbi +3 -3
  146. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
  147. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
  148. data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
  149. data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
  150. data/rbi/openai/models/responses/response_error.rbi +12 -0
  151. data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
  152. data/rbi/openai/models/responses/tool.rbi +15 -18
  153. data/rbi/openai/models/video_create_error.rbi +12 -0
  154. data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
  155. data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
  156. data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
  157. data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
  158. data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
  159. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
  160. data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
  161. data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
  162. data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
  163. data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
  164. data/rbi/openai/resources/audio/speech.rbi +2 -0
  165. data/rbi/openai/resources/audio/voices.rbi +49 -0
  166. data/rbi/openai/resources/audio.rbi +4 -0
  167. data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
  168. data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
  169. data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
  170. data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
  171. data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
  172. data/rbi/openai/resources/images.rbi +77 -109
  173. data/rbi/openai/resources/webhooks.rbi +5 -0
  174. data/sig/openai/helpers/agents.rbs +3 -0
  175. data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
  176. data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
  177. data/sig/openai/helpers/beta/agents.rbs +5 -0
  178. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +107 -5
  179. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +107 -5
  180. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +107 -5
  181. data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
  182. data/sig/openai/models/admin/organization/usage_completions_response.rbs +107 -5
  183. data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
  184. data/sig/openai/models/admin/organization/usage_costs_response.rbs +107 -5
  185. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +107 -5
  186. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +107 -5
  187. data/sig/openai/models/admin/organization/usage_images_response.rbs +107 -5
  188. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +107 -5
  189. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +107 -5
  190. data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
  191. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +107 -5
  192. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  193. data/sig/openai/models/audio/voice.rbs +70 -0
  194. data/sig/openai/models/audio/voice_create_params.rbs +203 -0
  195. data/sig/openai/models/beta/agent_create_params.rbs +1 -5
  196. data/sig/openai/models/beta/agent_update_params.rbs +1 -5
  197. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
  198. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
  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/turns/item_list_params.rbs +91 -0
  202. data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
  203. data/sig/openai/models/beta/beta_response_error.rbs +10 -0
  204. data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
  205. data/sig/openai/models/beta/beta_tool.rbs +11 -15
  206. data/sig/openai/models/beta/environment_param.rbs +4 -4
  207. data/sig/openai/models/beta/session_turn_error.rbs +12 -0
  208. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
  209. data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
  210. data/sig/openai/models/error_object.rbs +10 -0
  211. data/sig/openai/models/eval_create_params.rbs +1 -1
  212. data/sig/openai/models/eval_create_response.rbs +1 -1
  213. data/sig/openai/models/eval_list_response.rbs +1 -1
  214. data/sig/openai/models/eval_retrieve_response.rbs +1 -1
  215. data/sig/openai/models/eval_update_response.rbs +1 -1
  216. data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
  217. data/sig/openai/models/graders/score_model_grader.rbs +3 -3
  218. data/sig/openai/models/image.rbs +21 -21
  219. data/sig/openai/models/image_create_variation_params.rbs +4 -4
  220. data/sig/openai/models/image_edit_params.rbs +54 -66
  221. data/sig/openai/models/image_generate_params.rbs +23 -45
  222. data/sig/openai/models/image_model.rbs +6 -6
  223. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
  224. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
  225. data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
  226. data/sig/openai/models/responses/response_error.rbs +10 -0
  227. data/sig/openai/models/responses/responses_server_event.rbs +10 -0
  228. data/sig/openai/models/responses/tool.rbs +11 -15
  229. data/sig/openai/models/video_create_error.rbs +10 -0
  230. data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
  231. data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
  232. data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
  233. data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
  234. data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
  235. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
  236. data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
  237. data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
  238. data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
  239. data/sig/openai/resources/audio/voices.rbs +14 -0
  240. data/sig/openai/resources/audio.rbs +2 -0
  241. data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
  242. data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
  243. data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
  244. data/sig/openai/resources/webhooks.rbs +6 -1
  245. metadata +35 -1
@@ -24,17 +24,14 @@ module OpenAI
24
24
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
25
25
  # images.
26
26
  #
27
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
28
- # file less than 4MB.
29
- #
30
27
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
31
28
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
32
29
  # content type.
33
30
  sig { returns(OpenAI::ImageEditParams::Image::Variants) }
34
31
  attr_accessor :image
35
32
 
36
- # A text description of the desired image(s). The maximum length is 1000
37
- # characters for `dall-e-2`, and 32000 characters for the GPT image models.
33
+ # A text description of the desired image(s). The maximum length is 32000
34
+ # characters for the GPT image models.
38
35
  sig { returns(String) }
39
36
  attr_accessor :prompt
40
37
 
@@ -50,9 +47,10 @@ module OpenAI
50
47
  sig { returns(T.nilable(OpenAI::ImageEditParams::Background::OrSymbol)) }
51
48
  attr_accessor :background
52
49
 
53
- # Controls fidelity to the original input image(s). This parameter is supported
54
- # for GPT image models that support input fidelity. `gpt-image-2` and
55
- # `gpt-image-2-2026-04-21` ignore this parameter.
50
+ # Control how much effort the model will exert to match the style and features,
51
+ # especially facial features, of input images. Supports `high` and `low` on
52
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
53
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
56
54
  sig { returns(T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol)) }
57
55
  attr_accessor :input_fidelity
58
56
 
@@ -70,12 +68,11 @@ module OpenAI
70
68
  sig { params(mask: OpenAI::Internal::FileInput).void }
71
69
  attr_writer :mask
72
70
 
73
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
74
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
75
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
76
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
77
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
78
- # `gpt-image-1.5`.
71
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
72
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
73
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
74
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
75
+ # `chatgpt-image-latest`).
79
76
  sig { returns(T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol))) }
80
77
  attr_accessor :model
81
78
 
@@ -111,25 +108,22 @@ module OpenAI
111
108
  sig { returns(T.nilable(OpenAI::ImageEditParams::Quality::OrSymbol)) }
112
109
  attr_accessor :quality
113
110
 
114
- # The format in which the generated images are returned. Must be one of `url` or
115
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
116
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
117
- # `dall-e-2`), as GPT image models always return base64-encoded images.
111
+ # Legacy response format parameter for retired image models. Unsupported for GPT
112
+ # image models, which always return base64-encoded images.
118
113
  sig { returns(T.nilable(OpenAI::ImageEditParams::ResponseFormat::OrSymbol)) }
119
114
  attr_accessor :response_format
120
115
 
121
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
122
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
123
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
124
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
125
- # Width and height must both be divisible by 16 and the requested aspect ratio
126
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
127
- # the maximum supported resolution is `3840x2160`. The requested size must also
128
- # satisfy the model's current pixel and edge limits. The standard sizes
129
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
130
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
131
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
132
- # `1024x1024`, `1792x1024`, or `1024x1792`.
116
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
117
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
118
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
119
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
120
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
121
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
122
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
123
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
124
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
125
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
126
+ # models that allow automatic sizing.
133
127
  sig { returns(T.nilable(T.any(String, OpenAI::ImageEditParams::Size::OrSymbol))) }
134
128
  attr_accessor :size
135
129
 
@@ -188,16 +182,13 @@ module OpenAI
188
182
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
189
183
  # images.
190
184
  #
191
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
192
- # file less than 4MB.
193
- #
194
185
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
195
186
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
196
187
  # content type.
197
188
  image:,
198
189
 
199
- # A text description of the desired image(s). The maximum length is 1000
200
- # characters for `dall-e-2`, and 32000 characters for the GPT image models.
190
+ # A text description of the desired image(s). The maximum length is 32000
191
+ # characters for the GPT image models.
201
192
  prompt:,
202
193
 
203
194
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -211,9 +202,10 @@ module OpenAI
211
202
  # set the output format to `png` or `webp`.
212
203
  background: nil,
213
204
 
214
- # Controls fidelity to the original input image(s). This parameter is supported
215
- # for GPT image models that support input fidelity. `gpt-image-2` and
216
- # `gpt-image-2-2026-04-21` ignore this parameter.
205
+ # Control how much effort the model will exert to match the style and features,
206
+ # especially facial features, of input images. Supports `high` and `low` on
207
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
208
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
217
209
  input_fidelity: nil,
218
210
 
219
211
  # An additional image whose fully transparent areas (e.g. where alpha is zero)
@@ -226,12 +218,11 @@ module OpenAI
226
218
  # content type.
227
219
  mask: nil,
228
220
 
229
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
230
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
231
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
232
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
233
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
234
- # `gpt-image-1.5`.
221
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
222
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
223
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
224
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
225
+ # `chatgpt-image-latest`).
235
226
  model: nil,
236
227
 
237
228
  # The number of images to generate. Must be between 1 and 10.
@@ -261,24 +252,21 @@ module OpenAI
261
252
  # `xhigh` and `max`. Defaults to `auto`.
262
253
  quality: nil,
263
254
 
264
- # The format in which the generated images are returned. Must be one of `url` or
265
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
266
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
267
- # `dall-e-2`), as GPT image models always return base64-encoded images.
255
+ # Legacy response format parameter for retired image models. Unsupported for GPT
256
+ # image models, which always return base64-encoded images.
268
257
  response_format: nil,
269
258
 
270
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
271
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
272
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
273
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
274
- # Width and height must both be divisible by 16 and the requested aspect ratio
275
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
276
- # the maximum supported resolution is `3840x2160`. The requested size must also
277
- # satisfy the model's current pixel and edge limits. The standard sizes
278
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
279
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
280
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
281
- # `1024x1024`, `1792x1024`, or `1024x1792`.
259
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
260
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
261
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
262
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
263
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
264
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
265
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
266
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
267
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
268
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
269
+ # models that allow automatic sizing.
282
270
  size: nil,
283
271
 
284
272
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -322,9 +310,6 @@ module OpenAI
322
310
  # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should
323
311
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
324
312
  # images.
325
- #
326
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
327
- # file less than 4MB.
328
313
  module Image
329
314
  extend OpenAI::Internal::Type::Union
330
315
 
@@ -365,9 +350,10 @@ module OpenAI
365
350
  end
366
351
  end
367
352
 
368
- # Controls fidelity to the original input image(s). This parameter is supported
369
- # for GPT image models that support input fidelity. `gpt-image-2` and
370
- # `gpt-image-2-2026-04-21` ignore this parameter.
353
+ # Control how much effort the model will exert to match the style and features,
354
+ # especially facial features, of input images. Supports `high` and `low` on
355
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
356
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
371
357
  module InputFidelity
372
358
  extend OpenAI::Internal::Type::Enum
373
359
 
@@ -382,12 +368,11 @@ module OpenAI
382
368
  end
383
369
  end
384
370
 
385
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
386
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
387
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
388
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
389
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
390
- # `gpt-image-1.5`.
371
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
372
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
373
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
374
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
375
+ # `chatgpt-image-latest`).
391
376
  module Model
392
377
  extend OpenAI::Internal::Type::Union
393
378
 
@@ -427,23 +412,21 @@ module OpenAI
427
412
  TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageEditParams::Quality) }
428
413
  OrSymbol = T.type_alias { T.any(Symbol, String) }
429
414
 
430
- STANDARD = T.let(:standard, OpenAI::ImageEditParams::Quality::TaggedSymbol)
431
415
  LOW = T.let(:low, OpenAI::ImageEditParams::Quality::TaggedSymbol)
432
416
  MEDIUM = T.let(:medium, OpenAI::ImageEditParams::Quality::TaggedSymbol)
433
417
  HIGH = T.let(:high, OpenAI::ImageEditParams::Quality::TaggedSymbol)
434
418
  XHIGH = T.let(:xhigh, OpenAI::ImageEditParams::Quality::TaggedSymbol)
435
419
  MAX = T.let(:max, OpenAI::ImageEditParams::Quality::TaggedSymbol)
436
420
  AUTO = T.let(:auto, OpenAI::ImageEditParams::Quality::TaggedSymbol)
421
+ STANDARD = T.let(:standard, OpenAI::ImageEditParams::Quality::TaggedSymbol)
437
422
 
438
423
  sig { override.returns(T::Array[OpenAI::ImageEditParams::Quality::TaggedSymbol]) }
439
424
  def self.values
440
425
  end
441
426
  end
442
427
 
443
- # The format in which the generated images are returned. Must be one of `url` or
444
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
445
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
446
- # `dall-e-2`), as GPT image models always return base64-encoded images.
428
+ # Legacy response format parameter for retired image models. Unsupported for GPT
429
+ # image models, which always return base64-encoded images.
447
430
  module ResponseFormat
448
431
  extend OpenAI::Internal::Type::Enum
449
432
 
@@ -458,18 +441,17 @@ module OpenAI
458
441
  end
459
442
  end
460
443
 
461
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
462
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
463
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
464
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
465
- # Width and height must both be divisible by 16 and the requested aspect ratio
466
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
467
- # the maximum supported resolution is `3840x2160`. The requested size must also
468
- # satisfy the model's current pixel and edge limits. The standard sizes
469
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
470
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
471
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
472
- # `1024x1024`, `1792x1024`, or `1024x1792`.
444
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
445
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
446
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
447
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
448
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
449
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
450
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
451
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
452
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
453
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
454
+ # models that allow automatic sizing.
473
455
  module Size
474
456
  extend OpenAI::Internal::Type::Union
475
457
 
@@ -485,12 +467,12 @@ module OpenAI
485
467
 
486
468
  OrSymbol = T.type_alias { T.any(Symbol, String) }
487
469
 
488
- SIZE_256X256 = T.let(:"256x256", OpenAI::ImageEditParams::Size::TaggedSymbol)
489
- SIZE_512X512 = T.let(:"512x512", OpenAI::ImageEditParams::Size::TaggedSymbol)
490
470
  SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::ImageEditParams::Size::TaggedSymbol)
491
471
  SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::ImageEditParams::Size::TaggedSymbol)
492
472
  SIZE_1024X1536 = T.let(:"1024x1536", OpenAI::ImageEditParams::Size::TaggedSymbol)
493
473
  AUTO = T.let(:auto, OpenAI::ImageEditParams::Size::TaggedSymbol)
474
+ SIZE_256X256 = T.let(:"256x256", OpenAI::ImageEditParams::Size::TaggedSymbol)
475
+ SIZE_512X512 = T.let(:"512x512", OpenAI::ImageEditParams::Size::TaggedSymbol)
494
476
 
495
477
  end
496
478
 
@@ -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)
@@ -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
 
@@ -49,6 +49,22 @@ module OpenAI
49
49
  # fields that are present in the `session.update` are updated. To clear a field
50
50
  # like `instructions`, pass an empty string. To clear a field like `tools`, pass
51
51
  # an empty array. To clear a field like `turn_detection`, pass `null`.
52
+ #
53
+ # To turn off input audio noise reduction, send this Realtime event:
54
+ #
55
+ # ```json
56
+ # {
57
+ # "type": "session.update",
58
+ # "session": {
59
+ # "type": "realtime",
60
+ # "audio": { "input": { "noise_reduction": null } }
61
+ # }
62
+ # }
63
+ # ```
64
+ #
65
+ # For a transcription session, use `"type":"transcription"` inside `session`.
66
+ # Omitting `audio.input.noise_reduction` from an update leaves its current setting
67
+ # unchanged.
52
68
  sig do
53
69
  params(
54
70