openai 0.118.0 → 0.120.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +1 -1
  5. data/lib/openai/helpers/data_residency.rb +4 -1
  6. data/lib/openai/models/all_models.rb +2 -0
  7. data/lib/openai/models/beta/beta_compacted_response.rb +34 -1
  8. data/lib/openai/models/beta/beta_response.rb +37 -1
  9. data/lib/openai/models/beta/beta_response_input_item.rb +45 -1
  10. data/lib/openai/models/beta/beta_response_item.rb +45 -1
  11. data/lib/openai/models/beta/beta_response_output_item.rb +45 -1
  12. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +186 -13
  13. data/lib/openai/models/beta/beta_responses_client_event.rb +51 -1
  14. data/lib/openai/models/beta/beta_tool.rb +164 -13
  15. data/lib/openai/models/beta/response_compact_params.rb +47 -1
  16. data/lib/openai/models/beta/response_create_params.rb +47 -1
  17. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  18. data/lib/openai/models/conversations/conversation_item.rb +45 -1
  19. data/lib/openai/models/image_edit_params.rb +72 -16
  20. data/lib/openai/models/image_generate_params.rb +160 -8
  21. data/lib/openai/models/image_model.rb +2 -0
  22. data/lib/openai/models/images_response.rb +55 -4
  23. data/lib/openai/models/realtime/realtime_audio_config_input.rb +14 -1
  24. data/lib/openai/models/realtime/realtime_session_create_response.rb +14 -1
  25. data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +14 -1
  26. data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +14 -1
  27. data/lib/openai/models/realtime/realtime_translation_session.rb +14 -1
  28. data/lib/openai/models/realtime/realtime_translation_session_create_request.rb +14 -1
  29. data/lib/openai/models/realtime/realtime_translation_session_update_request.rb +14 -1
  30. data/lib/openai/models/responses/compacted_response.rb +37 -1
  31. data/lib/openai/models/responses/response.rb +34 -1
  32. data/lib/openai/models/responses/response_compact_params.rb +53 -1
  33. data/lib/openai/models/responses/response_create_params.rb +47 -1
  34. data/lib/openai/models/responses/response_input_item.rb +45 -1
  35. data/lib/openai/models/responses/response_item.rb +45 -1
  36. data/lib/openai/models/responses/response_output_item.rb +45 -1
  37. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +186 -13
  38. data/lib/openai/models/responses/responses_client_event.rb +48 -1
  39. data/lib/openai/models/responses/tool.rb +164 -13
  40. data/lib/openai/models/responses_model.rb +2 -0
  41. data/lib/openai/resources/admin/organization/projects.rb +6 -6
  42. data/lib/openai/resources/admin/organization.rb +6 -6
  43. data/lib/openai/resources/beta/responses.rb +12 -3
  44. data/lib/openai/resources/images.rb +102 -18
  45. data/lib/openai/resources/responses.rb +12 -3
  46. data/lib/openai/version.rb +1 -1
  47. data/rbi/openai/models/all_models.rbi +2 -0
  48. data/rbi/openai/models/beta/beta_compacted_response.rbi +67 -1
  49. data/rbi/openai/models/beta/beta_response.rbi +63 -0
  50. data/rbi/openai/models/beta/beta_response_input_item.rbi +82 -1
  51. data/rbi/openai/models/beta/beta_response_item.rbi +82 -1
  52. data/rbi/openai/models/beta/beta_response_output_item.rbi +82 -1
  53. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +338 -13
  54. data/rbi/openai/models/beta/beta_responses_client_event.rbi +109 -0
  55. data/rbi/openai/models/beta/beta_tool.rbi +245 -13
  56. data/rbi/openai/models/beta/response_compact_params.rbi +82 -0
  57. data/rbi/openai/models/beta/response_create_params.rbi +82 -0
  58. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  59. data/rbi/openai/models/conversations/conversation_item.rbi +84 -1
  60. data/rbi/openai/models/image_edit_params.rbi +76 -14
  61. data/rbi/openai/models/image_generate_params.rbi +218 -6
  62. data/rbi/openai/models/image_model.rbi +2 -0
  63. data/rbi/openai/models/images_response.rbi +90 -3
  64. data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +17 -1
  65. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +17 -1
  66. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +17 -1
  67. data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +17 -1
  68. data/rbi/openai/models/realtime/realtime_translation_session.rbi +19 -3
  69. data/rbi/openai/models/realtime/realtime_translation_session_create_request.rbi +19 -3
  70. data/rbi/openai/models/realtime/realtime_translation_session_update_request.rbi +19 -3
  71. data/rbi/openai/models/responses/compacted_response.rbi +67 -1
  72. data/rbi/openai/models/responses/response.rbi +62 -0
  73. data/rbi/openai/models/responses/response_compact_params.rbi +89 -0
  74. data/rbi/openai/models/responses/response_create_params.rbi +87 -0
  75. data/rbi/openai/models/responses/response_input_item.rbi +82 -1
  76. data/rbi/openai/models/responses/response_item.rbi +82 -1
  77. data/rbi/openai/models/responses/response_output_item.rbi +82 -1
  78. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +340 -13
  79. data/rbi/openai/models/responses/responses_client_event.rbi +105 -0
  80. data/rbi/openai/models/responses/tool.rbi +248 -13
  81. data/rbi/openai/models/responses_model.rbi +2 -0
  82. data/rbi/openai/resources/admin/organization/projects.rbi +3 -3
  83. data/rbi/openai/resources/admin/organization.rbi +3 -3
  84. data/rbi/openai/resources/beta/responses.rbi +9 -0
  85. data/rbi/openai/resources/images.rbi +98 -14
  86. data/rbi/openai/resources/responses.rbi +11 -0
  87. data/sig/openai/models/all_models.rbs +4 -0
  88. data/sig/openai/models/beta/beta_compacted_response.rbs +42 -2
  89. data/sig/openai/models/beta/beta_response.rbs +42 -0
  90. data/sig/openai/models/beta/beta_response_input_item.rbs +51 -3
  91. data/sig/openai/models/beta/beta_response_item.rbs +51 -3
  92. data/sig/openai/models/beta/beta_response_output_item.rbs +51 -3
  93. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +188 -15
  94. data/sig/openai/models/beta/beta_responses_client_event.rbs +58 -0
  95. data/sig/openai/models/beta/beta_tool.rbs +188 -15
  96. data/sig/openai/models/beta/response_compact_params.rbs +58 -0
  97. data/sig/openai/models/beta/response_create_params.rbs +58 -0
  98. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  99. data/sig/openai/models/conversations/conversation_item.rbs +51 -3
  100. data/sig/openai/models/image_edit_params.rbs +63 -12
  101. data/sig/openai/models/image_generate_params.rbs +150 -5
  102. data/sig/openai/models/image_model.rbs +4 -0
  103. data/sig/openai/models/images_response.rbs +59 -4
  104. data/sig/openai/models/realtime/realtime_audio_config_input.rbs +20 -1
  105. data/sig/openai/models/realtime/realtime_session_create_response.rbs +20 -1
  106. data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +20 -1
  107. data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +20 -1
  108. data/sig/openai/models/realtime/realtime_translation_session.rbs +22 -3
  109. data/sig/openai/models/realtime/realtime_translation_session_create_request.rbs +22 -3
  110. data/sig/openai/models/realtime/realtime_translation_session_update_request.rbs +22 -3
  111. data/sig/openai/models/responses/compacted_response.rbs +42 -2
  112. data/sig/openai/models/responses/response.rbs +40 -0
  113. data/sig/openai/models/responses/response_compact_params.rbs +60 -0
  114. data/sig/openai/models/responses/response_create_params.rbs +56 -0
  115. data/sig/openai/models/responses/response_input_item.rbs +51 -3
  116. data/sig/openai/models/responses/response_item.rbs +51 -3
  117. data/sig/openai/models/responses/response_output_item.rbs +51 -3
  118. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +188 -15
  119. data/sig/openai/models/responses/responses_client_event.rbs +56 -0
  120. data/sig/openai/models/responses/tool.rbs +188 -15
  121. data/sig/openai/models/responses_model.rbs +4 -0
  122. data/sig/openai/resources/admin/organization/projects.rbs +2 -2
  123. data/sig/openai/resources/admin/organization.rbs +2 -2
  124. data/sig/openai/resources/beta/responses.rbs +3 -0
  125. data/sig/openai/resources/images.rbs +14 -0
  126. data/sig/openai/resources/responses.rbs +4 -0
  127. metadata +1 -1
@@ -30,12 +30,39 @@ module OpenAI
30
30
  # @return [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil]
31
31
  optional :background, enum: -> { OpenAI::ImageGenerateParams::Background }, nil?: true
32
32
 
33
+ # @!attribute complexity
34
+ # Computation spent planning the image, independently of rendering quality. Uses
35
+ # the image model's configured default when omitted. For SVG output, controls the
36
+ # reference image, independently of the SVG author's reasoning.
37
+ #
38
+ # @return [Symbol, OpenAI::Models::ImageGenerateParams::Complexity, nil]
39
+ optional :complexity, enum: -> { OpenAI::ImageGenerateParams::Complexity }, nil?: true
40
+
41
+ # @!attribute frame_count
42
+ # Number of frames for GIF output. Accepts integers from 2 through 16. Defaults to
43
+ # 9 when omitted. Only supported with output_format=gif. The requested size must
44
+ # satisfy the selected model's GIF size limits. GIF output does not support
45
+ # streaming, partial images, masks, or custom output compression. Requires access
46
+ # to the GIF preview for the selected model.
47
+ #
48
+ # @return [Integer, nil]
49
+ optional :frame_count, Integer, nil?: true
50
+
51
+ # @!attribute frame_duration_ms
52
+ # Requested delay per GIF frame, in milliseconds. Defaults to 200 when omitted.
53
+ # GIF output rounds to the nearest 10 ms and caps the encoded delay at 655,350 ms
54
+ # per frame. Only supported with output_format=gif.
55
+ #
56
+ # @return [Integer, nil]
57
+ optional :frame_duration_ms, Integer, nil?: true
58
+
33
59
  # @!attribute model
34
60
  # The GPT image model to use for image generation. Specify a model explicitly.
35
61
  # Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
36
62
  # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
37
63
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
38
- # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
64
+ # `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
65
+ # `gpt-image-2.6-flare`, and `chatgpt-image-latest`.
39
66
  #
40
67
  # `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
41
68
  # `gpt-image-2.5-flare` instead.
@@ -67,7 +94,7 @@ module OpenAI
67
94
 
68
95
  # @!attribute output_format
69
96
  # The format in which the generated images are returned. This parameter is only
70
- # supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
97
+ # supported for the GPT image models.
71
98
  #
72
99
  # @return [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil]
73
100
  optional :output_format, enum: -> { OpenAI::ImageGenerateParams::OutputFormat }, nil?: true
@@ -139,6 +166,17 @@ module OpenAI
139
166
  # @return [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil]
140
167
  optional :style, enum: -> { OpenAI::ImageGenerateParams::Style }, nil?: true
141
168
 
169
+ # @!attribute svg
170
+ # Selects the model and reasoning effort used to author SVG output. Requires
171
+ # output_format=svg and access to SVG model selection. When model selection is
172
+ # enabled, supply svg.model. When model selection is disabled, omit this object.
173
+ # The top-level model selects the image model that creates the reference image.
174
+ # SVG generation requires n=1 and does not support streaming, partial images,
175
+ # prompt_rewriter, or output_compression. SVG edits are not supported.
176
+ #
177
+ # @return [OpenAI::Models::ImageGenerateParams::Svg, nil]
178
+ optional :svg, -> { OpenAI::ImageGenerateParams::Svg }, nil?: true
179
+
142
180
  # @!attribute user
143
181
  # @deprecated
144
182
  #
@@ -150,7 +188,7 @@ module OpenAI
150
188
  # @return [String, nil]
151
189
  optional :user, String
152
190
 
153
- # @!method initialize(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, safety_identifier: nil, size: nil, style: nil, user: nil, request_options: {})
191
+ # @!method initialize(prompt:, background: nil, complexity: nil, frame_count: nil, frame_duration_ms: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, safety_identifier: nil, size: nil, style: nil, svg: nil, user: nil, request_options: {})
154
192
  # @param prompt [String]
155
193
  # A text description of the desired image(s). The maximum length is 32000
156
194
  # characters.
@@ -166,12 +204,30 @@ module OpenAI
166
204
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
167
205
  # set the output format to `png` or `webp`.
168
206
  #
207
+ # @param complexity [Symbol, OpenAI::Models::ImageGenerateParams::Complexity, nil]
208
+ # Computation spent planning the image, independently of rendering quality. Uses
209
+ # the image model's configured default when omitted. For SVG output, controls the
210
+ # reference image, independently of the SVG author's reasoning.
211
+ #
212
+ # @param frame_count [Integer, nil]
213
+ # Number of frames for GIF output. Accepts integers from 2 through 16. Defaults to
214
+ # 9 when omitted. Only supported with output_format=gif. The requested size must
215
+ # satisfy the selected model's GIF size limits. GIF output does not support
216
+ # streaming, partial images, masks, or custom output compression. Requires access
217
+ # to the GIF preview for the selected model.
218
+ #
219
+ # @param frame_duration_ms [Integer, nil]
220
+ # Requested delay per GIF frame, in milliseconds. Defaults to 200 when omitted.
221
+ # GIF output rounds to the nearest 10 ms and caps the encoded delay at 655,350 ms
222
+ # per frame. Only supported with output_format=gif.
223
+ #
169
224
  # @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
170
225
  # The GPT image model to use for image generation. Specify a model explicitly.
171
226
  # Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
172
227
  # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
173
228
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
174
- # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
229
+ # `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
230
+ # `gpt-image-2.6-flare`, and `chatgpt-image-latest`.
175
231
  #
176
232
  # `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
177
233
  # `gpt-image-2.5-flare` instead.
@@ -191,7 +247,7 @@ module OpenAI
191
247
  #
192
248
  # @param output_format [Symbol, OpenAI::Models::ImageGenerateParams::OutputFormat, nil]
193
249
  # The format in which the generated images are returned. This parameter is only
194
- # supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
250
+ # supported for the GPT image models.
195
251
  #
196
252
  # @param partial_images [Integer, nil]
197
253
  # The number of partial images to generate. This parameter is used for streaming
@@ -238,6 +294,14 @@ module OpenAI
238
294
  # Legacy style parameter for retired image models. Unsupported for GPT image
239
295
  # models; describe the desired style in the prompt instead.
240
296
  #
297
+ # @param svg [OpenAI::Models::ImageGenerateParams::Svg, nil]
298
+ # Selects the model and reasoning effort used to author SVG output. Requires
299
+ # output_format=svg and access to SVG model selection. When model selection is
300
+ # enabled, supply svg.model. When model selection is disabled, omit this object.
301
+ # The top-level model selects the image model that creates the reference image.
302
+ # SVG generation requires n=1 and does not support streaming, partial images,
303
+ # prompt_rewriter, or output_compression. SVG edits are not supported.
304
+ #
241
305
  # @param user [String]
242
306
  # Deprecated: use `safety_identifier` instead. This parameter remains accepted for
243
307
  # backward compatibility and is used when `safety_identifier` is omitted, null, or
@@ -266,11 +330,26 @@ module OpenAI
266
330
  # @return [Array<Symbol>]
267
331
  end
268
332
 
333
+ # Computation spent planning the image, independently of rendering quality. Uses
334
+ # the image model's configured default when omitted. For SVG output, controls the
335
+ # reference image, independently of the SVG author's reasoning.
336
+ module Complexity
337
+ extend OpenAI::Internal::Type::Enum
338
+
339
+ LOW = :low
340
+ MEDIUM = :medium
341
+ HIGH = :high
342
+
343
+ # @!method self.values
344
+ # @return [Array<Symbol>]
345
+ end
346
+
269
347
  # The GPT image model to use for image generation. Specify a model explicitly.
270
348
  # Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
271
349
  # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
272
350
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
273
- # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
351
+ # `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
352
+ # `gpt-image-2.6-flare`, and `chatgpt-image-latest`.
274
353
  #
275
354
  # `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
276
355
  # `gpt-image-2.5-flare` instead.
@@ -283,7 +362,8 @@ module OpenAI
283
362
  # Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
284
363
  # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
285
364
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
286
- # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
365
+ # `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`, `gpt-image-2.6-flare`,
366
+ # and `chatgpt-image-latest`.
287
367
  #
288
368
  # `gpt-image-1` was shut down on October 23, 2026. Use
289
369
  # `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` instead.
@@ -307,13 +387,15 @@ module OpenAI
307
387
  end
308
388
 
309
389
  # The format in which the generated images are returned. This parameter is only
310
- # supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.
390
+ # supported for the GPT image models.
311
391
  module OutputFormat
312
392
  extend OpenAI::Internal::Type::Enum
313
393
 
314
394
  PNG = :png
315
395
  JPEG = :jpeg
316
396
  WEBP = :webp
397
+ GIF = :gif
398
+ SVG = :svg
317
399
 
318
400
  # @!method self.values
319
401
  # @return [Array<Symbol>]
@@ -433,6 +515,76 @@ module OpenAI
433
515
  # @!method self.values
434
516
  # @return [Array<Symbol>]
435
517
  end
518
+
519
+ class Svg < OpenAI::Internal::Type::BaseModel
520
+ # @!attribute model
521
+ # Model used to author the SVG. Required when SVG model selection is enabled.
522
+ #
523
+ # @return [String]
524
+ required :model, String
525
+
526
+ # @!attribute reasoning
527
+ # Reasoning settings for the SVG author, independent of image complexity. Omitted
528
+ # or null effort uses the author model's default. Supported efforts depend on the
529
+ # selected author model.
530
+ #
531
+ # @return [OpenAI::Models::ImageGenerateParams::Svg::Reasoning, nil]
532
+ optional :reasoning, -> { OpenAI::ImageGenerateParams::Svg::Reasoning }, nil?: true
533
+
534
+ # @!method initialize(model:, reasoning: nil)
535
+ # Selects the model and reasoning effort used to author SVG output. Requires
536
+ # output_format=svg and access to SVG model selection. When model selection is
537
+ # enabled, supply svg.model. When model selection is disabled, omit this object.
538
+ # The top-level model selects the image model that creates the reference image.
539
+ # SVG generation requires n=1 and does not support streaming, partial images,
540
+ # prompt_rewriter, or output_compression. SVG edits are not supported.
541
+ #
542
+ # @param model [String]
543
+ # Model used to author the SVG. Required when SVG model selection is enabled.
544
+ #
545
+ # @param reasoning [OpenAI::Models::ImageGenerateParams::Svg::Reasoning, nil]
546
+ # Reasoning settings for the SVG author, independent of image complexity. Omitted
547
+ # or null effort uses the author model's default. Supported efforts depend on the
548
+ # selected author model.
549
+
550
+ # @see OpenAI::Models::ImageGenerateParams::Svg#reasoning
551
+ class Reasoning < OpenAI::Internal::Type::BaseModel
552
+ # @!attribute effort
553
+ # Controls how much effort the SVG author spends on reasoning. Uses the author
554
+ # model's default when omitted or null.
555
+ #
556
+ # @return [Symbol, OpenAI::Models::ImageGenerateParams::Svg::Reasoning::Effort, nil]
557
+ optional :effort, enum: -> { OpenAI::ImageGenerateParams::Svg::Reasoning::Effort }, nil?: true
558
+
559
+ # @!method initialize(effort: nil)
560
+ # Reasoning settings for the SVG author, independent of image complexity. Omitted
561
+ # or null effort uses the author model's default. Supported efforts depend on the
562
+ # selected author model.
563
+ #
564
+ # @param effort [Symbol, OpenAI::Models::ImageGenerateParams::Svg::Reasoning::Effort, nil]
565
+ # Controls how much effort the SVG author spends on reasoning. Uses the author
566
+ # model's default when omitted or null.
567
+
568
+ # Controls how much effort the SVG author spends on reasoning. Uses the author
569
+ # model's default when omitted or null.
570
+ #
571
+ # @see OpenAI::Models::ImageGenerateParams::Svg::Reasoning#effort
572
+ module Effort
573
+ extend OpenAI::Internal::Type::Enum
574
+
575
+ NONE = :none
576
+ MINIMAL = :minimal
577
+ LOW = :low
578
+ MEDIUM = :medium
579
+ HIGH = :high
580
+ XHIGH = :xhigh
581
+ MAX = :max
582
+
583
+ # @!method self.values
584
+ # @return [Array<Symbol>]
585
+ end
586
+ end
587
+ end
436
588
  end
437
589
  end
438
590
  end
@@ -12,6 +12,8 @@ module OpenAI
12
12
  GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08"
13
13
  GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare"
14
14
  GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08"
15
+ GPT_IMAGE_2_6_SUNBURST = :"gpt-image-2.6-sunburst"
16
+ GPT_IMAGE_2_6_FLARE = :"gpt-image-2.6-flare"
15
17
  # @deprecated GPT Image 1 was shut down on October 23, 2026. Use gpt-image-2.5-sunburst or
16
18
  # gpt-image-2.5-flare instead.
17
19
  GPT_IMAGE_1 = :"gpt-image-1"
@@ -24,7 +24,7 @@ module OpenAI
24
24
  optional :data, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Image] }
25
25
 
26
26
  # @!attribute output_format
27
- # The output format of the image generation. Either `png`, `webp`, or `jpeg`.
27
+ # The output format of the generated image.
28
28
  #
29
29
  # @return [Symbol, OpenAI::Models::ImagesResponse::OutputFormat, nil]
30
30
  optional :output_format, enum: -> { OpenAI::ImagesResponse::OutputFormat }
@@ -50,13 +50,20 @@ module OpenAI
50
50
  # @return [String, Symbol, OpenAI::Models::ImagesResponse::Size, nil]
51
51
  optional :size, union: -> { OpenAI::ImagesResponse::Size }
52
52
 
53
+ # @!attribute svg_usage
54
+ # Token usage for the model that authored the SVG, separate from image rendering
55
+ # usage.
56
+ #
57
+ # @return [OpenAI::Models::ImagesResponse::SvgUsage, nil]
58
+ optional :svg_usage, -> { OpenAI::ImagesResponse::SvgUsage }
59
+
53
60
  # @!attribute usage
54
61
  # For `gpt-image-1` only, the token usage information for the image generation.
55
62
  #
56
63
  # @return [OpenAI::Models::ImagesResponse::Usage, nil]
57
64
  optional :usage, -> { OpenAI::ImagesResponse::Usage }
58
65
 
59
- # @!method initialize(created:, background: nil, data: nil, output_format: nil, quality: nil, safety_identifier: nil, size: nil, usage: nil)
66
+ # @!method initialize(created:, background: nil, data: nil, output_format: nil, quality: nil, safety_identifier: nil, size: nil, svg_usage: nil, usage: nil)
60
67
  # The response from the image generation endpoint.
61
68
  #
62
69
  # @param created [Integer]
@@ -70,7 +77,7 @@ module OpenAI
70
77
  # The list of generated images.
71
78
  #
72
79
  # @param output_format [Symbol, OpenAI::Models::ImagesResponse::OutputFormat]
73
- # The output format of the image generation. Either `png`, `webp`, or `jpeg`.
80
+ # The output format of the generated image.
74
81
  #
75
82
  # @param quality [Symbol, OpenAI::Models::ImagesResponse::Quality]
76
83
  # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or
@@ -84,6 +91,10 @@ module OpenAI
84
91
  # @param size [String, Symbol, OpenAI::Models::ImagesResponse::Size]
85
92
  # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
86
93
  #
94
+ # @param svg_usage [OpenAI::Models::ImagesResponse::SvgUsage]
95
+ # Token usage for the model that authored the SVG, separate from image rendering
96
+ # usage.
97
+ #
87
98
  # @param usage [OpenAI::Models::ImagesResponse::Usage]
88
99
  # For `gpt-image-1` only, the token usage information for the image generation.
89
100
 
@@ -101,7 +112,7 @@ module OpenAI
101
112
  # @return [Array<Symbol>]
102
113
  end
103
114
 
104
- # The output format of the image generation. Either `png`, `webp`, or `jpeg`.
115
+ # The output format of the generated image.
105
116
  #
106
117
  # @see OpenAI::Models::ImagesResponse#output_format
107
118
  module OutputFormat
@@ -110,6 +121,8 @@ module OpenAI
110
121
  PNG = :png
111
122
  WEBP = :webp
112
123
  JPEG = :jpeg
124
+ GIF = :gif
125
+ SVG = :svg
113
126
 
114
127
  # @!method self.values
115
128
  # @return [Array<Symbol>]
@@ -167,6 +180,44 @@ module OpenAI
167
180
  def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024]
168
181
  end
169
182
 
183
+ # @see OpenAI::Models::ImagesResponse#svg_usage
184
+ class SvgUsage < OpenAI::Internal::Type::BaseModel
185
+ # @!attribute input_tokens
186
+ #
187
+ # @return [Integer]
188
+ required :input_tokens, Integer
189
+
190
+ # @!attribute model
191
+ #
192
+ # @return [String]
193
+ required :model, String
194
+
195
+ # @!attribute output_tokens
196
+ #
197
+ # @return [Integer]
198
+ required :output_tokens, Integer
199
+
200
+ # @!attribute reasoning_tokens
201
+ #
202
+ # @return [Integer]
203
+ required :reasoning_tokens, Integer
204
+
205
+ # @!attribute total_tokens
206
+ #
207
+ # @return [Integer]
208
+ required :total_tokens, Integer
209
+
210
+ # @!method initialize(input_tokens:, model:, output_tokens:, reasoning_tokens:, total_tokens:)
211
+ # Token usage for the model that authored the SVG, separate from image rendering
212
+ # usage.
213
+ #
214
+ # @param input_tokens [Integer]
215
+ # @param model [String]
216
+ # @param output_tokens [Integer]
217
+ # @param reasoning_tokens [Integer]
218
+ # @param total_tokens [Integer]
219
+ end
220
+
170
221
  # @see OpenAI::Models::ImagesResponse#usage
171
222
  class Usage < OpenAI::Internal::Type::BaseModel
172
223
  # @!attribute input_tokens
@@ -95,6 +95,14 @@ module OpenAI
95
95
 
96
96
  # @see OpenAI::Models::Realtime::RealtimeAudioConfigInput#noise_reduction
97
97
  class NoiseReduction < OpenAI::Internal::Type::BaseModel
98
+ # @!attribute strength
99
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
100
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
101
+ # update preserves the current strength.
102
+ #
103
+ # @return [Float, nil]
104
+ optional :strength, Float
105
+
98
106
  # @!attribute type
99
107
  # Type of noise reduction. `near_field` is for close-talking microphones such as
100
108
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -103,13 +111,18 @@ module OpenAI
103
111
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
104
112
  optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
105
113
 
106
- # @!method initialize(type: nil)
114
+ # @!method initialize(strength: nil, type: nil)
107
115
  # Configuration for input audio noise reduction. This can be set to `null` to turn
108
116
  # off. Noise reduction filters audio added to the input audio buffer before it is
109
117
  # sent to VAD and the model. Filtering the audio can improve VAD and turn
110
118
  # detection accuracy (reducing false positives) and model performance by improving
111
119
  # perception of the input audio.
112
120
  #
121
+ # @param strength [Float]
122
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
123
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
124
+ # update preserves the current strength.
125
+ #
113
126
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
114
127
  # Type of noise reduction. `near_field` is for close-talking microphones such as
115
128
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -353,6 +353,14 @@ module OpenAI
353
353
 
354
354
  # @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#noise_reduction
355
355
  class NoiseReduction < OpenAI::Internal::Type::BaseModel
356
+ # @!attribute strength
357
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
358
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
359
+ # update preserves the current strength.
360
+ #
361
+ # @return [Float, nil]
362
+ optional :strength, Float
363
+
356
364
  # @!attribute type
357
365
  # Type of noise reduction. `near_field` is for close-talking microphones such as
358
366
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -361,13 +369,18 @@ module OpenAI
361
369
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
362
370
  optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
363
371
 
364
- # @!method initialize(type: nil)
372
+ # @!method initialize(strength: nil, type: nil)
365
373
  # Configuration for input audio noise reduction. This can be set to `null` to turn
366
374
  # off. Noise reduction filters audio added to the input audio buffer before it is
367
375
  # sent to VAD and the model. Filtering the audio can improve VAD and turn
368
376
  # detection accuracy (reducing false positives) and model performance by improving
369
377
  # perception of the input audio.
370
378
  #
379
+ # @param strength [Float]
380
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
381
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
382
+ # update preserves the current strength.
383
+ #
371
384
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
372
385
  # Type of noise reduction. `near_field` is for close-talking microphones such as
373
386
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -99,6 +99,14 @@ module OpenAI
99
99
 
100
100
  # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionAudioInput#noise_reduction
101
101
  class NoiseReduction < OpenAI::Internal::Type::BaseModel
102
+ # @!attribute strength
103
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
104
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
105
+ # update preserves the current strength.
106
+ #
107
+ # @return [Float, nil]
108
+ optional :strength, Float
109
+
102
110
  # @!attribute type
103
111
  # Type of noise reduction. `near_field` is for close-talking microphones such as
104
112
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -107,13 +115,18 @@ module OpenAI
107
115
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
108
116
  optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
109
117
 
110
- # @!method initialize(type: nil)
118
+ # @!method initialize(strength: nil, type: nil)
111
119
  # Configuration for input audio noise reduction. This can be set to `null` to turn
112
120
  # off. Noise reduction filters audio added to the input audio buffer before it is
113
121
  # sent to VAD and the model. Filtering the audio can improve VAD and turn
114
122
  # detection accuracy (reducing false positives) and model performance by improving
115
123
  # perception of the input audio.
116
124
  #
125
+ # @param strength [Float]
126
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
127
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
128
+ # update preserves the current strength.
129
+ #
117
130
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
118
131
  # Type of noise reduction. `near_field` is for close-talking microphones such as
119
132
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -138,6 +138,14 @@ module OpenAI
138
138
 
139
139
  # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input#noise_reduction
140
140
  class NoiseReduction < OpenAI::Internal::Type::BaseModel
141
+ # @!attribute strength
142
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
143
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
144
+ # update preserves the current strength.
145
+ #
146
+ # @return [Float, nil]
147
+ optional :strength, Float
148
+
141
149
  # @!attribute type
142
150
  # Type of noise reduction. `near_field` is for close-talking microphones such as
143
151
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -146,9 +154,14 @@ module OpenAI
146
154
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
147
155
  optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
148
156
 
149
- # @!method initialize(type: nil)
157
+ # @!method initialize(strength: nil, type: nil)
150
158
  # Configuration for input audio noise reduction.
151
159
  #
160
+ # @param strength [Float]
161
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
162
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
163
+ # update preserves the current strength.
164
+ #
152
165
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
153
166
  # Type of noise reduction. `near_field` is for close-talking microphones such as
154
167
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -116,13 +116,26 @@ module OpenAI
116
116
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
117
117
  required :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
118
118
 
119
- # @!method initialize(type:)
119
+ # @!attribute strength
120
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
121
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
122
+ # update preserves the current strength.
123
+ #
124
+ # @return [Float, nil]
125
+ optional :strength, Float
126
+
127
+ # @!method initialize(type:, strength: nil)
120
128
  # Optional input noise reduction.
121
129
  #
122
130
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
123
131
  # Type of noise reduction. `near_field` is for close-talking microphones such as
124
132
  # headphones, `far_field` is for far-field microphones such as laptop or
125
133
  # conference room microphones.
134
+ #
135
+ # @param strength [Float]
136
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
137
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
138
+ # update preserves the current strength.
126
139
  end
127
140
 
128
141
  # @see OpenAI::Models::Realtime::RealtimeTranslationSession::Audio::Input#transcription
@@ -91,13 +91,26 @@ module OpenAI
91
91
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
92
92
  required :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
93
93
 
94
- # @!method initialize(type:)
94
+ # @!attribute strength
95
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
96
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
97
+ # update preserves the current strength.
98
+ #
99
+ # @return [Float, nil]
100
+ optional :strength, Float
101
+
102
+ # @!method initialize(type:, strength: nil)
95
103
  # Optional input noise reduction. Set to `null` to disable it.
96
104
  #
97
105
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
98
106
  # Type of noise reduction. `near_field` is for close-talking microphones such as
99
107
  # headphones, `far_field` is for far-field microphones such as laptop or
100
108
  # conference room microphones.
109
+ #
110
+ # @param strength [Float]
111
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
112
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
113
+ # update preserves the current strength.
101
114
  end
102
115
 
103
116
  # @see OpenAI::Models::Realtime::RealtimeTranslationSessionCreateRequest::Audio::Input#transcription
@@ -81,13 +81,26 @@ module OpenAI
81
81
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
82
82
  required :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
83
83
 
84
- # @!method initialize(type:)
84
+ # @!attribute strength
85
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
86
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
87
+ # update preserves the current strength.
88
+ #
89
+ # @return [Float, nil]
90
+ optional :strength, Float
91
+
92
+ # @!method initialize(type:, strength: nil)
85
93
  # Optional input noise reduction. Set to `null` to disable it.
86
94
  #
87
95
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
88
96
  # Type of noise reduction. `near_field` is for close-talking microphones such as
89
97
  # headphones, `far_field` is for far-field microphones such as laptop or
90
98
  # conference room microphones.
99
+ #
100
+ # @param strength [Float]
101
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
102
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
103
+ # update preserves the current strength.
91
104
  end
92
105
 
93
106
  # @see OpenAI::Models::Realtime::RealtimeTranslationSessionUpdateRequest::Audio::Input#transcription
@@ -37,7 +37,12 @@ module OpenAI
37
37
  # @return [OpenAI::Models::Responses::ResponseUsage]
38
38
  required :usage, -> { OpenAI::Responses::ResponseUsage }
39
39
 
40
- # @!method initialize(id:, created_at:, output:, usage:, object: :"response.compaction")
40
+ # @!attribute image
41
+ #
42
+ # @return [OpenAI::Models::Responses::CompactedResponse::Image, nil]
43
+ optional :image, -> { OpenAI::Responses::CompactedResponse::Image }
44
+
45
+ # @!method initialize(id:, created_at:, output:, usage:, image: nil, object: :"response.compaction")
41
46
  # @param id [String]
42
47
  # The unique identifier for the compacted response.
43
48
  #
@@ -52,8 +57,39 @@ module OpenAI
52
57
  # Token accounting for the compaction pass, including cached, reasoning, and total
53
58
  # tokens.
54
59
  #
60
+ # @param image [OpenAI::Models::Responses::CompactedResponse::Image]
61
+ #
55
62
  # @param object [Symbol, :"response.compaction"]
56
63
  # The object type. Always `response.compaction`.
64
+
65
+ # @see OpenAI::Models::Responses::CompactedResponse#image
66
+ class Image < OpenAI::Internal::Type::BaseModel
67
+ # @!attribute context_compression
68
+ # Effective image context optimization policy.
69
+ #
70
+ # @return [Symbol, OpenAI::Models::Responses::CompactedResponse::Image::ContextCompression]
71
+ required(
72
+ :context_compression,
73
+ enum: -> { OpenAI::Responses::CompactedResponse::Image::ContextCompression }
74
+ )
75
+
76
+ # @!method initialize(context_compression:)
77
+ # @param context_compression [Symbol, OpenAI::Models::Responses::CompactedResponse::Image::ContextCompression]
78
+ # Effective image context optimization policy.
79
+
80
+ # Effective image context optimization policy.
81
+ #
82
+ # @see OpenAI::Models::Responses::CompactedResponse::Image#context_compression
83
+ module ContextCompression
84
+ extend OpenAI::Internal::Type::Enum
85
+
86
+ ENABLED = :enabled
87
+ DISABLED = :disabled
88
+
89
+ # @!method self.values
90
+ # @return [Array<Symbol>]
91
+ end
92
+ end
57
93
  end
58
94
  end
59
95
  end