openai 0.98.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 (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
  5. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
  6. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
  7. data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
  8. data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
  9. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
  10. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
  11. data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
  12. data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
  13. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
  14. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
  15. data/lib/openai/models/all_models.rb +42 -0
  16. data/lib/openai/models/audio/speech_create_params.rb +6 -0
  17. data/lib/openai/models/audio/voice.rb +75 -0
  18. data/lib/openai/models/audio/voice_create_params.rb +217 -0
  19. data/lib/openai/models/beta/agent_create_params.rb +0 -3
  20. data/lib/openai/models/beta/agent_update_params.rb +0 -3
  21. data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
  22. data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
  23. data/lib/openai/models/beta/beta_response.rb +220 -0
  24. data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
  25. data/lib/openai/models/beta/beta_tool.rb +3 -9
  26. data/lib/openai/models/beta/response_compact_params.rb +220 -0
  27. data/lib/openai/models/beta/response_create_params.rb +220 -0
  28. data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
  29. data/lib/openai/models/chat_model.rb +178 -0
  30. data/lib/openai/models/image.rb +14 -14
  31. data/lib/openai/models/image_create_variation_params.rb +7 -7
  32. data/lib/openai/models/image_edit_params.rb +76 -87
  33. data/lib/openai/models/image_generate_params.rb +51 -62
  34. data/lib/openai/models/image_model.rb +5 -3
  35. data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
  36. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
  37. data/lib/openai/models/responses/response_compact_params.rb +220 -0
  38. data/lib/openai/models/responses/tool.rb +3 -9
  39. data/lib/openai/models/responses_model.rb +42 -0
  40. data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
  41. data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
  42. data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
  43. data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
  44. data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
  45. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
  46. data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
  47. data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
  48. data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
  49. data/lib/openai/resources/audio/speech.rb +2 -0
  50. data/lib/openai/resources/audio/voices.rb +53 -0
  51. data/lib/openai/resources/audio.rb +5 -0
  52. data/lib/openai/resources/images.rb +71 -103
  53. data/lib/openai/resources/webhooks.rb +1 -1
  54. data/lib/openai/version.rb +1 -1
  55. data/lib/openai.rb +8 -0
  56. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
  57. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
  58. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
  59. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
  60. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
  61. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
  62. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
  63. data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
  64. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
  65. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
  66. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
  67. data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
  68. data/rbi/openai/models/audio/voice.rbi +111 -0
  69. data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
  70. data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
  71. data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
  72. data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
  73. data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
  74. data/rbi/openai/models/beta/beta_tool.rbi +3 -9
  75. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
  76. data/rbi/openai/models/image.rbi +14 -14
  77. data/rbi/openai/models/image_create_variation_params.rbi +6 -6
  78. data/rbi/openai/models/image_edit_params.rbi +61 -82
  79. data/rbi/openai/models/image_generate_params.rbi +30 -61
  80. data/rbi/openai/models/image_model.rbi +3 -3
  81. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
  82. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
  83. data/rbi/openai/models/responses/tool.rbi +3 -9
  84. data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
  85. data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
  86. data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
  87. data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
  88. data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
  89. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
  90. data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
  91. data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
  92. data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
  93. data/rbi/openai/resources/audio/speech.rbi +2 -0
  94. data/rbi/openai/resources/audio/voices.rbi +49 -0
  95. data/rbi/openai/resources/audio.rbi +4 -0
  96. data/rbi/openai/resources/images.rbi +69 -103
  97. data/rbi/openai/resources/webhooks.rbi +5 -0
  98. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
  99. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
  100. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
  101. data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
  102. data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
  103. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
  104. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
  105. data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
  106. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
  107. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
  108. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
  109. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  110. data/sig/openai/models/audio/voice.rbs +70 -0
  111. data/sig/openai/models/audio/voice_create_params.rbs +203 -0
  112. data/sig/openai/models/beta/agent_create_params.rbs +1 -5
  113. data/sig/openai/models/beta/agent_update_params.rbs +1 -5
  114. data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
  115. data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
  116. data/sig/openai/models/beta/beta_tool.rbs +3 -9
  117. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
  118. data/sig/openai/models/image.rbs +21 -21
  119. data/sig/openai/models/image_create_variation_params.rbs +4 -4
  120. data/sig/openai/models/image_edit_params.rbs +46 -60
  121. data/sig/openai/models/image_generate_params.rbs +23 -45
  122. data/sig/openai/models/image_model.rbs +6 -6
  123. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
  124. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
  125. data/sig/openai/models/responses/tool.rbs +3 -9
  126. data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
  127. data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
  128. data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
  129. data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
  130. data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
  131. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
  132. data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
  133. data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
  134. data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
  135. data/sig/openai/resources/audio/voices.rbs +14 -0
  136. data/sig/openai/resources/audio.rbs +2 -0
  137. data/sig/openai/resources/webhooks.rbs +6 -1
  138. metadata +25 -1
@@ -6,7 +6,9 @@ module OpenAI
6
6
  # Given a prompt and/or an input image, the model will generate a new image.
7
7
  class Images
8
8
 
9
- # Creates a variation of a given image. This endpoint only supports `dall-e-2`.
9
+ # This endpoint is retired and no longer available. Use the image edits endpoint
10
+ # with a GPT Image model and a prompt to create a variation of an image. The
11
+ # request and response schemas below describe the legacy contract.
10
12
  sig {
11
13
  params(
12
14
  image: OpenAI::Internal::FileInput,
@@ -27,8 +29,8 @@ module OpenAI
27
29
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
28
30
  # content type.
29
31
  image:,
30
- # The model to use for image generation. Only `dall-e-2` is supported at this
31
- # time.
32
+ # The legacy model used by the retired image variations endpoint. This endpoint no
33
+ # longer accepts requests.
32
34
  model: nil,
33
35
  # The number of images to generate. Must be between 1 and 10.
34
36
  n: nil,
@@ -50,7 +52,7 @@ module OpenAI
50
52
  # See {OpenAI::Resources::Images#edit_stream_raw} for streaming counterpart.
51
53
  #
52
54
  # Creates an edited or extended image given one or more source images and a
53
- # prompt. This endpoint supports GPT Image models and `dall-e-2`.
55
+ # prompt. This endpoint supports GPT Image models.
54
56
  sig {
55
57
  params(
56
58
  image: OpenAI::ImageEditParams::Image::Variants,
@@ -82,15 +84,12 @@ module OpenAI
82
84
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
83
85
  # images.
84
86
  #
85
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
86
- # file less than 4MB.
87
- #
88
87
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
89
88
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
90
89
  # content type.
91
90
  image:,
92
- # A text description of the desired image(s). The maximum length is 1000
93
- # characters for `dall-e-2`, and 32000 characters for the GPT image models.
91
+ # A text description of the desired image(s). The maximum length is 32000
92
+ # characters for the GPT image models.
94
93
  prompt:,
95
94
  # Allows to set transparency for the background of the generated image(s). Must be
96
95
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
@@ -115,12 +114,11 @@ module OpenAI
115
114
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
116
115
  # content type.
117
116
  mask: nil,
118
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
119
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
120
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
121
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
122
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
123
- # `gpt-image-1.5`.
117
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
118
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
119
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
120
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
121
+ # `chatgpt-image-latest`).
124
122
  model: nil,
125
123
  # The number of images to generate. Must be between 1 and 10.
126
124
  n: nil,
@@ -144,23 +142,20 @@ module OpenAI
144
142
  # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support
145
143
  # `xhigh` and `max`. Defaults to `auto`.
146
144
  quality: nil,
147
- # The format in which the generated images are returned. Must be one of `url` or
148
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
149
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
150
- # `dall-e-2`), as GPT image models always return base64-encoded images.
145
+ # Legacy response format parameter for retired image models. Unsupported for GPT
146
+ # image models, which always return base64-encoded images.
151
147
  response_format: nil,
152
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
153
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
154
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
155
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
156
- # Width and height must both be divisible by 16 and the requested aspect ratio
157
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
158
- # the maximum supported resolution is `3840x2160`. The requested size must also
159
- # satisfy the model's current pixel and edge limits. The standard sizes
160
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
161
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
162
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
163
- # `1024x1024`, `1792x1024`, or `1024x1792`.
148
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
149
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
150
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
151
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
152
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
153
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
154
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
155
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
156
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
157
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
158
+ # models that allow automatic sizing.
164
159
  size: nil,
165
160
  # A unique identifier representing your end-user, which can help OpenAI to monitor
166
161
  # and detect abuse.
@@ -176,7 +171,7 @@ module OpenAI
176
171
  # See {OpenAI::Resources::Images#edit} for non-streaming counterpart.
177
172
  #
178
173
  # Creates an edited or extended image given one or more source images and a
179
- # prompt. This endpoint supports GPT Image models and `dall-e-2`.
174
+ # prompt. This endpoint supports GPT Image models.
180
175
  sig {
181
176
  params(
182
177
  image: OpenAI::ImageEditParams::Image::Variants,
@@ -208,15 +203,12 @@ module OpenAI
208
203
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
209
204
  # images.
210
205
  #
211
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
212
- # file less than 4MB.
213
- #
214
206
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
215
207
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
216
208
  # content type.
217
209
  image:,
218
- # A text description of the desired image(s). The maximum length is 1000
219
- # characters for `dall-e-2`, and 32000 characters for the GPT image models.
210
+ # A text description of the desired image(s). The maximum length is 32000
211
+ # characters for the GPT image models.
220
212
  prompt:,
221
213
  # Allows to set transparency for the background of the generated image(s). Must be
222
214
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
@@ -241,12 +233,11 @@ module OpenAI
241
233
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
242
234
  # content type.
243
235
  mask: nil,
244
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
245
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
246
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
247
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
248
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
249
- # `gpt-image-1.5`.
236
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
237
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
238
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
239
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
240
+ # `chatgpt-image-latest`).
250
241
  model: nil,
251
242
  # The number of images to generate. Must be between 1 and 10.
252
243
  n: nil,
@@ -270,23 +261,20 @@ module OpenAI
270
261
  # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support
271
262
  # `xhigh` and `max`. Defaults to `auto`.
272
263
  quality: nil,
273
- # The format in which the generated images are returned. Must be one of `url` or
274
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
275
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
276
- # `dall-e-2`), as GPT image models always return base64-encoded images.
264
+ # Legacy response format parameter for retired image models. Unsupported for GPT
265
+ # image models, which always return base64-encoded images.
277
266
  response_format: nil,
278
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
279
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
280
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
281
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
282
- # Width and height must both be divisible by 16 and the requested aspect ratio
283
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
284
- # the maximum supported resolution is `3840x2160`. The requested size must also
285
- # satisfy the model's current pixel and edge limits. The standard sizes
286
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
287
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
288
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
289
- # `1024x1024`, `1792x1024`, or `1024x1792`.
267
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
268
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
269
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
270
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
271
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
272
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
273
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
274
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
275
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
276
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
277
+ # models that allow automatic sizing.
290
278
  size: nil,
291
279
  # A unique identifier representing your end-user, which can help OpenAI to monitor
292
280
  # and detect abuse.
@@ -301,7 +289,7 @@ module OpenAI
301
289
 
302
290
  # See {OpenAI::Resources::Images#generate_stream_raw} for streaming counterpart.
303
291
  #
304
- # Creates an image given a prompt.
292
+ # Creates an image given a prompt using a GPT Image model.
305
293
  # [Learn more](https://developers.openai.com/api/docs/guides/images-vision).
306
294
  sig {
307
295
  params(
@@ -325,8 +313,7 @@ module OpenAI
325
313
  }
326
314
  def generate(
327
315
  # A text description of the desired image(s). The maximum length is 32000
328
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
329
- # characters for `dall-e-3`.
316
+ # characters.
330
317
  prompt:,
331
318
  # Allows to set transparency for the background of the generated image(s). Must be
332
319
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
@@ -338,19 +325,17 @@ module OpenAI
338
325
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
339
326
  # set the output format to `png` or `webp`.
340
327
  background: nil,
341
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
342
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
343
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
328
+ # The GPT image model to use for image generation. Specify a model explicitly.
329
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
330
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
344
331
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
345
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
346
- # specific to the GPT image models is used.
332
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
347
333
  model: nil,
348
334
  # Control the content-moderation level for images generated by the GPT image
349
335
  # models. Must be either `low` for less restrictive filtering or `auto` (default
350
336
  # value).
351
337
  moderation: nil,
352
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
353
- # `n=1` is supported.
338
+ # The number of images to generate. Must be between 1 and 10.
354
339
  n: nil,
355
340
  # The compression level (0-100%) for the generated images. This parameter is only
356
341
  # supported for the GPT image models with the `webp` or `jpeg` output formats, and
@@ -373,12 +358,8 @@ module OpenAI
373
358
  # - `high`, `medium` and `low` are supported for the GPT image models.
374
359
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
375
360
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
376
- # - `hd` and `standard` are supported for `dall-e-3`.
377
- # - `standard` is the only option for `dall-e-2`.
378
361
  quality: nil,
379
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
380
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
381
- # after the image has been generated. This parameter isn't supported for the GPT
362
+ # Legacy response format parameter for retired image models. Unsupported for GPT
382
363
  # image models, which always return base64-encoded images.
383
364
  response_format: nil,
384
365
  # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
@@ -390,14 +371,10 @@ module OpenAI
390
371
  # the maximum supported resolution is `3840x2160`. The requested size must also
391
372
  # satisfy the model's current pixel and edge limits. The standard sizes
392
373
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
393
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
394
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
395
- # `1024x1024`, `1792x1024`, or `1024x1792`.
374
+ # `auto` is supported for models that allow automatic sizing.
396
375
  size: nil,
397
- # The style of the generated images. This parameter is only supported for
398
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
399
- # towards generating hyper-real and dramatic images. Natural causes the model to
400
- # produce more natural, less hyper-real looking images.
376
+ # Legacy style parameter for retired image models. Unsupported for GPT image
377
+ # models; describe the desired style in the prompt instead.
401
378
  style: nil,
402
379
  # A unique identifier representing your end-user, which can help OpenAI to monitor
403
380
  # and detect abuse.
@@ -412,7 +389,7 @@ module OpenAI
412
389
 
413
390
  # See {OpenAI::Resources::Images#generate} for non-streaming counterpart.
414
391
  #
415
- # Creates an image given a prompt.
392
+ # Creates an image given a prompt using a GPT Image model.
416
393
  # [Learn more](https://developers.openai.com/api/docs/guides/images-vision).
417
394
  sig {
418
395
  params(
@@ -436,8 +413,7 @@ module OpenAI
436
413
  }
437
414
  def generate_stream_raw(
438
415
  # A text description of the desired image(s). The maximum length is 32000
439
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
440
- # characters for `dall-e-3`.
416
+ # characters.
441
417
  prompt:,
442
418
  # Allows to set transparency for the background of the generated image(s). Must be
443
419
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
@@ -449,19 +425,17 @@ module OpenAI
449
425
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
450
426
  # set the output format to `png` or `webp`.
451
427
  background: nil,
452
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
453
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
454
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
428
+ # The GPT image model to use for image generation. Specify a model explicitly.
429
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
430
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
455
431
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
456
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
457
- # specific to the GPT image models is used.
432
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
458
433
  model: nil,
459
434
  # Control the content-moderation level for images generated by the GPT image
460
435
  # models. Must be either `low` for less restrictive filtering or `auto` (default
461
436
  # value).
462
437
  moderation: nil,
463
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
464
- # `n=1` is supported.
438
+ # The number of images to generate. Must be between 1 and 10.
465
439
  n: nil,
466
440
  # The compression level (0-100%) for the generated images. This parameter is only
467
441
  # supported for the GPT image models with the `webp` or `jpeg` output formats, and
@@ -484,12 +458,8 @@ module OpenAI
484
458
  # - `high`, `medium` and `low` are supported for the GPT image models.
485
459
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
486
460
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
487
- # - `hd` and `standard` are supported for `dall-e-3`.
488
- # - `standard` is the only option for `dall-e-2`.
489
461
  quality: nil,
490
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
491
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
492
- # after the image has been generated. This parameter isn't supported for the GPT
462
+ # Legacy response format parameter for retired image models. Unsupported for GPT
493
463
  # image models, which always return base64-encoded images.
494
464
  response_format: nil,
495
465
  # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
@@ -501,14 +471,10 @@ module OpenAI
501
471
  # the maximum supported resolution is `3840x2160`. The requested size must also
502
472
  # satisfy the model's current pixel and edge limits. The standard sizes
503
473
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
504
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
505
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
506
- # `1024x1024`, `1792x1024`, or `1024x1792`.
474
+ # `auto` is supported for models that allow automatic sizing.
507
475
  size: nil,
508
- # The style of the generated images. This parameter is only supported for
509
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
510
- # towards generating hyper-real and dramatic images. Natural causes the model to
511
- # produce more natural, less hyper-real looking images.
476
+ # Legacy style parameter for retired image models. Unsupported for GPT image
477
+ # models; describe the desired style in the prompt instead.
512
478
  style: nil,
513
479
  # A unique identifier representing your end-user, which can help OpenAI to monitor
514
480
  # and detect abuse.
@@ -140,6 +140,11 @@ module OpenAI
140
140
  )
141
141
  .returns(
142
142
  T.any(
143
+ OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent,
144
+ OpenAI::Webhooks::AgentSessionCreatedWebhookEvent,
145
+ OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
146
+ OpenAI::Webhooks::AgentSessionIdleWebhookEvent,
147
+ OpenAI::Webhooks::AgentSessionInProgressWebhookEvent,
143
148
  OpenAI::Webhooks::BatchCancelledWebhookEvent,
144
149
  OpenAI::Webhooks::BatchCompletedWebhookEvent,
145
150
  OpenAI::Webhooks::BatchExpiredWebhookEvent,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,