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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
- data/lib/openai/models/all_models.rb +42 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/audio/voice.rb +75 -0
- data/lib/openai/models/audio/voice_create_params.rb +217 -0
- data/lib/openai/models/beta/agent_create_params.rb +0 -3
- data/lib/openai/models/beta/agent_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_tool.rb +3 -9
- data/lib/openai/models/beta/response_compact_params.rb +220 -0
- data/lib/openai/models/beta/response_create_params.rb +220 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/image.rb +14 -14
- data/lib/openai/models/image_create_variation_params.rb +7 -7
- data/lib/openai/models/image_edit_params.rb +76 -87
- data/lib/openai/models/image_generate_params.rb +51 -62
- data/lib/openai/models/image_model.rb +5 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/tool.rb +3 -9
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
- data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
- data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
- data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
- data/lib/openai/resources/audio/speech.rb +2 -0
- data/lib/openai/resources/audio/voices.rb +53 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/resources/images.rb +71 -103
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
- data/rbi/openai/models/audio/voice.rbi +111 -0
- data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
- data/rbi/openai/models/beta/beta_tool.rbi +3 -9
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/image.rbi +14 -14
- data/rbi/openai/models/image_create_variation_params.rbi +6 -6
- data/rbi/openai/models/image_edit_params.rbi +61 -82
- data/rbi/openai/models/image_generate_params.rbi +30 -61
- data/rbi/openai/models/image_model.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
- data/rbi/openai/models/responses/tool.rbi +3 -9
- data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
- data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
- data/rbi/openai/resources/audio/speech.rbi +2 -0
- data/rbi/openai/resources/audio/voices.rbi +49 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/rbi/openai/resources/images.rbi +69 -103
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/audio/voice.rbs +70 -0
- data/sig/openai/models/audio/voice_create_params.rbs +203 -0
- data/sig/openai/models/beta/agent_create_params.rbs +1 -5
- data/sig/openai/models/beta/agent_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
- data/sig/openai/models/beta/beta_tool.rbs +3 -9
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/image.rbs +21 -21
- data/sig/openai/models/image_create_variation_params.rbs +4 -4
- data/sig/openai/models/image_edit_params.rbs +46 -60
- data/sig/openai/models/image_generate_params.rbs +23 -45
- data/sig/openai/models/image_model.rbs +6 -6
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
- data/sig/openai/models/responses/tool.rbs +3 -9
- data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
- data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
- data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
- data/sig/openai/resources/audio/voices.rbs +14 -0
- data/sig/openai/resources/audio.rbs +2 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- 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
|
-
#
|
|
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
|
|
31
|
-
#
|
|
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
|
|
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
|
|
93
|
-
# characters for
|
|
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
|
|
119
|
-
#
|
|
120
|
-
# `gpt-image-2-
|
|
121
|
-
# `gpt-image-2.5-
|
|
122
|
-
# `
|
|
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
|
-
#
|
|
148
|
-
#
|
|
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.
|
|
153
|
-
# `gpt-image-2
|
|
154
|
-
# `gpt-image-2.5-
|
|
155
|
-
# resolutions are supported as
|
|
156
|
-
# Width and height must both be
|
|
157
|
-
# must be between 1:3 and 3:1.
|
|
158
|
-
#
|
|
159
|
-
#
|
|
160
|
-
#
|
|
161
|
-
# `
|
|
162
|
-
#
|
|
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
|
|
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
|
|
219
|
-
# characters for
|
|
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
|
|
245
|
-
#
|
|
246
|
-
# `gpt-image-2-
|
|
247
|
-
# `gpt-image-2.5-
|
|
248
|
-
# `
|
|
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
|
-
#
|
|
274
|
-
#
|
|
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.
|
|
279
|
-
# `gpt-image-2
|
|
280
|
-
# `gpt-image-2.5-
|
|
281
|
-
# resolutions are supported as
|
|
282
|
-
# Width and height must both be
|
|
283
|
-
# must be between 1:3 and 3:1.
|
|
284
|
-
#
|
|
285
|
-
#
|
|
286
|
-
#
|
|
287
|
-
# `
|
|
288
|
-
#
|
|
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
|
|
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.
|
|
342
|
-
#
|
|
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
|
|
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.
|
|
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
|
-
#
|
|
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.
|
|
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
|
-
#
|
|
398
|
-
#
|
|
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
|
|
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.
|
|
453
|
-
#
|
|
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
|
|
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.
|
|
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
|
-
#
|
|
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.
|
|
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
|
-
#
|
|
509
|
-
#
|
|
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,
|