openai 0.117.0 → 0.119.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 (154) 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/admin/organization/projects/project_optional_service_tier.rb +24 -0
  7. data/lib/openai/models/admin/organization/projects/project_service_tier_settings.rb +88 -0
  8. data/lib/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rb +29 -0
  9. data/lib/openai/models/admin/organization/projects/service_tier_setting_update_params.rb +92 -0
  10. data/lib/openai/models/all_models.rb +1 -0
  11. data/lib/openai/models/beta/beta_compacted_response.rb +34 -1
  12. data/lib/openai/models/beta/beta_response.rb +35 -1
  13. data/lib/openai/models/beta/beta_response_input_item.rb +45 -1
  14. data/lib/openai/models/beta/beta_response_item.rb +45 -1
  15. data/lib/openai/models/beta/beta_response_output_item.rb +45 -1
  16. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +186 -13
  17. data/lib/openai/models/beta/beta_response_usage.rb +33 -1
  18. data/lib/openai/models/beta/beta_responses_client_event.rb +58 -10
  19. data/lib/openai/models/beta/beta_tool.rb +164 -13
  20. data/lib/openai/models/beta/response_compact_params.rb +47 -4
  21. data/lib/openai/models/beta/response_create_params.rb +54 -10
  22. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  23. data/lib/openai/models/chat/completion_create_params.rb +3 -3
  24. data/lib/openai/models/conversations/conversation_item.rb +45 -1
  25. data/lib/openai/models/image_edit_params.rb +72 -16
  26. data/lib/openai/models/image_generate_params.rb +160 -8
  27. data/lib/openai/models/image_model.rb +2 -0
  28. data/lib/openai/models/images_response.rb +55 -4
  29. data/lib/openai/models/realtime/realtime_audio_config_input.rb +14 -1
  30. data/lib/openai/models/realtime/realtime_session_create_response.rb +14 -1
  31. data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +14 -1
  32. data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +14 -1
  33. data/lib/openai/models/realtime/realtime_translation_session.rb +14 -1
  34. data/lib/openai/models/realtime/realtime_translation_session_create_request.rb +14 -1
  35. data/lib/openai/models/realtime/realtime_translation_session_update_request.rb +14 -1
  36. data/lib/openai/models/responses/compacted_response.rb +37 -1
  37. data/lib/openai/models/responses/response.rb +35 -1
  38. data/lib/openai/models/responses/response_compact_params.rb +53 -4
  39. data/lib/openai/models/responses/response_create_params.rb +57 -10
  40. data/lib/openai/models/responses/response_input_item.rb +45 -1
  41. data/lib/openai/models/responses/response_item.rb +45 -1
  42. data/lib/openai/models/responses/response_output_item.rb +45 -1
  43. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +186 -13
  44. data/lib/openai/models/responses/response_usage.rb +33 -1
  45. data/lib/openai/models/responses/responses_client_event.rb +58 -10
  46. data/lib/openai/models/responses/tool.rb +164 -13
  47. data/lib/openai/models/responses_model.rb +1 -0
  48. data/lib/openai/resources/admin/organization/projects/service_tier_settings.rb +77 -0
  49. data/lib/openai/resources/admin/organization/projects.rb +6 -0
  50. data/lib/openai/resources/admin/organization.rb +6 -6
  51. data/lib/openai/resources/beta/responses.rb +18 -9
  52. data/lib/openai/resources/chat/completions.rb +2 -2
  53. data/lib/openai/resources/images.rb +102 -18
  54. data/lib/openai/resources/responses.rb +15 -6
  55. data/lib/openai/version.rb +1 -1
  56. data/lib/openai.rb +5 -0
  57. data/rbi/openai/models/admin/organization/projects/project_optional_service_tier.rbi +45 -0
  58. data/rbi/openai/models/admin/organization/projects/project_service_tier_settings.rbi +143 -0
  59. data/rbi/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbi +63 -0
  60. data/rbi/openai/models/admin/organization/projects/service_tier_setting_update_params.rbi +183 -0
  61. data/rbi/openai/models/all_models.rbi +1 -0
  62. data/rbi/openai/models/beta/beta_compacted_response.rbi +67 -1
  63. data/rbi/openai/models/beta/beta_response.rbi +63 -0
  64. data/rbi/openai/models/beta/beta_response_input_item.rbi +82 -1
  65. data/rbi/openai/models/beta/beta_response_item.rbi +82 -1
  66. data/rbi/openai/models/beta/beta_response_output_item.rbi +82 -1
  67. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +338 -13
  68. data/rbi/openai/models/beta/beta_response_usage.rbi +66 -3
  69. data/rbi/openai/models/beta/beta_responses_client_event.rbi +118 -9
  70. data/rbi/openai/models/beta/beta_tool.rbi +245 -13
  71. data/rbi/openai/models/beta/response_compact_params.rbi +84 -3
  72. data/rbi/openai/models/beta/response_create_params.rbi +91 -9
  73. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  74. data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
  75. data/rbi/openai/models/conversations/conversation_item.rbi +84 -1
  76. data/rbi/openai/models/image_edit_params.rbi +76 -14
  77. data/rbi/openai/models/image_generate_params.rbi +218 -6
  78. data/rbi/openai/models/image_model.rbi +2 -0
  79. data/rbi/openai/models/images_response.rbi +90 -3
  80. data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +17 -1
  81. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +17 -1
  82. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +17 -1
  83. data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +17 -1
  84. data/rbi/openai/models/realtime/realtime_translation_session.rbi +19 -3
  85. data/rbi/openai/models/realtime/realtime_translation_session_create_request.rbi +19 -3
  86. data/rbi/openai/models/realtime/realtime_translation_session_update_request.rbi +19 -3
  87. data/rbi/openai/models/responses/compacted_response.rbi +67 -1
  88. data/rbi/openai/models/responses/response.rbi +63 -0
  89. data/rbi/openai/models/responses/response_compact_params.rbi +91 -3
  90. data/rbi/openai/models/responses/response_create_params.rbi +97 -9
  91. data/rbi/openai/models/responses/response_input_item.rbi +82 -1
  92. data/rbi/openai/models/responses/response_item.rbi +82 -1
  93. data/rbi/openai/models/responses/response_output_item.rbi +82 -1
  94. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +340 -13
  95. data/rbi/openai/models/responses/response_usage.rbi +66 -3
  96. data/rbi/openai/models/responses/responses_client_event.rbi +118 -9
  97. data/rbi/openai/models/responses/tool.rbi +248 -13
  98. data/rbi/openai/models/responses_model.rbi +1 -0
  99. data/rbi/openai/resources/admin/organization/projects/service_tier_settings.rbi +67 -0
  100. data/rbi/openai/resources/admin/organization/projects.rbi +3 -0
  101. data/rbi/openai/resources/admin/organization.rbi +3 -3
  102. data/rbi/openai/resources/beta/responses.rbi +15 -6
  103. data/rbi/openai/resources/chat/completions.rbi +2 -2
  104. data/rbi/openai/resources/images.rbi +98 -14
  105. data/rbi/openai/resources/responses.rbi +14 -3
  106. data/sig/openai/models/admin/organization/projects/project_optional_service_tier.rbs +23 -0
  107. data/sig/openai/models/admin/organization/projects/project_service_tier_settings.rbs +72 -0
  108. data/sig/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbs +32 -0
  109. data/sig/openai/models/admin/organization/projects/service_tier_setting_update_params.rbs +91 -0
  110. data/sig/openai/models/all_models.rbs +2 -0
  111. data/sig/openai/models/beta/beta_compacted_response.rbs +42 -2
  112. data/sig/openai/models/beta/beta_response.rbs +42 -1
  113. data/sig/openai/models/beta/beta_response_input_item.rbs +51 -3
  114. data/sig/openai/models/beta/beta_response_item.rbs +51 -3
  115. data/sig/openai/models/beta/beta_response_output_item.rbs +51 -3
  116. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +188 -15
  117. data/sig/openai/models/beta/beta_response_usage.rbs +40 -3
  118. data/sig/openai/models/beta/beta_responses_client_event.rbs +67 -10
  119. data/sig/openai/models/beta/beta_tool.rbs +188 -15
  120. data/sig/openai/models/beta/response_compact_params.rbs +58 -2
  121. data/sig/openai/models/beta/response_create_params.rbs +67 -10
  122. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  123. data/sig/openai/models/chat/completion_create_params.rbs +3 -3
  124. data/sig/openai/models/conversations/conversation_item.rbs +51 -3
  125. data/sig/openai/models/image_edit_params.rbs +63 -12
  126. data/sig/openai/models/image_generate_params.rbs +150 -5
  127. data/sig/openai/models/image_model.rbs +4 -0
  128. data/sig/openai/models/images_response.rbs +59 -4
  129. data/sig/openai/models/realtime/realtime_audio_config_input.rbs +20 -1
  130. data/sig/openai/models/realtime/realtime_session_create_response.rbs +20 -1
  131. data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +20 -1
  132. data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +20 -1
  133. data/sig/openai/models/realtime/realtime_translation_session.rbs +22 -3
  134. data/sig/openai/models/realtime/realtime_translation_session_create_request.rbs +22 -3
  135. data/sig/openai/models/realtime/realtime_translation_session_update_request.rbs +22 -3
  136. data/sig/openai/models/responses/compacted_response.rbs +42 -2
  137. data/sig/openai/models/responses/response.rbs +42 -1
  138. data/sig/openai/models/responses/response_compact_params.rbs +60 -2
  139. data/sig/openai/models/responses/response_create_params.rbs +67 -10
  140. data/sig/openai/models/responses/response_input_item.rbs +51 -3
  141. data/sig/openai/models/responses/response_item.rbs +51 -3
  142. data/sig/openai/models/responses/response_output_item.rbs +51 -3
  143. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +188 -15
  144. data/sig/openai/models/responses/response_usage.rbs +40 -3
  145. data/sig/openai/models/responses/responses_client_event.rbs +67 -10
  146. data/sig/openai/models/responses/tool.rbs +188 -15
  147. data/sig/openai/models/responses_model.rbs +2 -0
  148. data/sig/openai/resources/admin/organization/projects/service_tier_settings.rbs +25 -0
  149. data/sig/openai/resources/admin/organization/projects.rbs +2 -0
  150. data/sig/openai/resources/admin/organization.rbs +2 -2
  151. data/sig/openai/resources/beta/responses.rbs +3 -0
  152. data/sig/openai/resources/images.rbs +14 -0
  153. data/sig/openai/resources/responses.rbs +4 -0
  154. metadata +16 -1
@@ -47,6 +47,32 @@ module OpenAI
47
47
  # @return [Symbol, OpenAI::Models::ImageEditParams::Background, nil]
48
48
  optional :background, enum: -> { OpenAI::ImageEditParams::Background }, nil?: true
49
49
 
50
+ # @!attribute complexity
51
+ # Computation spent planning the image, independently of rendering quality. Uses
52
+ # the image model's configured default when omitted. For SVG output, controls the
53
+ # reference image, independently of the SVG author's reasoning.
54
+ #
55
+ # @return [Symbol, OpenAI::Models::ImageEditParams::Complexity, nil]
56
+ optional :complexity, enum: -> { OpenAI::ImageEditParams::Complexity }, nil?: true
57
+
58
+ # @!attribute frame_count
59
+ # Number of frames for GIF output. Accepts integers from 2 through 16. Defaults to
60
+ # 9 when omitted. Only supported with output_format=gif. The requested size must
61
+ # satisfy the selected model's GIF size limits. GIF output does not support
62
+ # streaming, partial images, masks, or custom output compression. Requires access
63
+ # to the GIF preview for the selected model.
64
+ #
65
+ # @return [Integer, nil]
66
+ optional :frame_count, Integer, nil?: true
67
+
68
+ # @!attribute frame_duration_ms
69
+ # Requested delay per GIF frame, in milliseconds. Defaults to 200 when omitted.
70
+ # GIF output rounds to the nearest 10 ms and caps the encoded delay at 655,350 ms
71
+ # per frame. Only supported with output_format=gif.
72
+ #
73
+ # @return [Integer, nil]
74
+ optional :frame_duration_ms, Integer, nil?: true
75
+
50
76
  # @!attribute input_fidelity
51
77
  # Control how much effort the model will exert to match the style and features,
52
78
  # especially facial features, of input images. Supports `high` and `low` on
@@ -59,7 +85,7 @@ module OpenAI
59
85
  # @!attribute markup
60
86
  # A transparent PNG overlaid on the first image to guide the edit. Must match that
61
87
  # image's dimensions after orientation and contain transparent pixels. Supports
62
- # GPT Image 2.5 and 2.6. Cannot be combined with mask.
88
+ # GPT Image 2.5. Cannot be combined with mask.
63
89
  #
64
90
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
65
91
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
@@ -85,8 +111,8 @@ module OpenAI
85
111
  # The GPT image model to use for image editing (`gpt-image-1-mini`,
86
112
  # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
87
113
  # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
88
- # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
89
- # `chatgpt-image-latest`).
114
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`,
115
+ # `gpt-image-2.6-sunburst`, `gpt-image-2.6-flare`, or `chatgpt-image-latest`).
90
116
  #
91
117
  # `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
92
118
  # `gpt-image-2.5-flare` instead.
@@ -110,8 +136,7 @@ module OpenAI
110
136
 
111
137
  # @!attribute output_format
112
138
  # The format in which the generated images are returned. This parameter is only
113
- # supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The
114
- # default value is `png`.
139
+ # supported for the GPT image models. The default value is `png`.
115
140
  #
116
141
  # @return [Symbol, OpenAI::Models::ImageEditParams::OutputFormat, nil]
117
142
  optional :output_format, enum: -> { OpenAI::ImageEditParams::OutputFormat }, nil?: true
@@ -183,7 +208,7 @@ module OpenAI
183
208
  # @return [String, nil]
184
209
  optional :user, String
185
210
 
186
- # @!method initialize(image:, prompt:, background: nil, input_fidelity: nil, markup: nil, mask: nil, model: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, safety_identifier: nil, size: nil, user: nil, request_options: {})
211
+ # @!method initialize(image:, prompt:, background: nil, complexity: nil, frame_count: nil, frame_duration_ms: nil, input_fidelity: nil, markup: nil, mask: nil, model: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, safety_identifier: nil, size: nil, user: nil, request_options: {})
187
212
  # @param image [Pathname, StringIO, IO, String, OpenAI::FilePart, Array<Pathname, StringIO, IO, String, OpenAI::FilePart>]
188
213
  # The image(s) to edit. Must be a supported image file or an array of images.
189
214
  #
@@ -213,6 +238,23 @@ module OpenAI
213
238
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
214
239
  # set the output format to `png` or `webp`.
215
240
  #
241
+ # @param complexity [Symbol, OpenAI::Models::ImageEditParams::Complexity, nil]
242
+ # Computation spent planning the image, independently of rendering quality. Uses
243
+ # the image model's configured default when omitted. For SVG output, controls the
244
+ # reference image, independently of the SVG author's reasoning.
245
+ #
246
+ # @param frame_count [Integer, nil]
247
+ # Number of frames for GIF output. Accepts integers from 2 through 16. Defaults to
248
+ # 9 when omitted. Only supported with output_format=gif. The requested size must
249
+ # satisfy the selected model's GIF size limits. GIF output does not support
250
+ # streaming, partial images, masks, or custom output compression. Requires access
251
+ # to the GIF preview for the selected model.
252
+ #
253
+ # @param frame_duration_ms [Integer, nil]
254
+ # Requested delay per GIF frame, in milliseconds. Defaults to 200 when omitted.
255
+ # GIF output rounds to the nearest 10 ms and caps the encoded delay at 655,350 ms
256
+ # per frame. Only supported with output_format=gif.
257
+ #
216
258
  # @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
217
259
  # Control how much effort the model will exert to match the style and features,
218
260
  # especially facial features, of input images. Supports `high` and `low` on
@@ -222,7 +264,7 @@ module OpenAI
222
264
  # @param markup [Pathname, StringIO, IO, String, OpenAI::FilePart]
223
265
  # A transparent PNG overlaid on the first image to guide the edit. Must match that
224
266
  # image's dimensions after orientation and contain transparent pixels. Supports
225
- # GPT Image 2.5 and 2.6. Cannot be combined with mask.
267
+ # GPT Image 2.5. Cannot be combined with mask.
226
268
  #
227
269
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
228
270
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
@@ -242,8 +284,8 @@ module OpenAI
242
284
  # The GPT image model to use for image editing (`gpt-image-1-mini`,
243
285
  # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
244
286
  # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
245
- # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
246
- # `chatgpt-image-latest`).
287
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`,
288
+ # `gpt-image-2.6-sunburst`, `gpt-image-2.6-flare`, or `chatgpt-image-latest`).
247
289
  #
248
290
  # `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
249
291
  # `gpt-image-2.5-flare` instead.
@@ -258,8 +300,7 @@ module OpenAI
258
300
  #
259
301
  # @param output_format [Symbol, OpenAI::Models::ImageEditParams::OutputFormat, nil]
260
302
  # The format in which the generated images are returned. This parameter is only
261
- # supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The
262
- # default value is `png`.
303
+ # supported for the GPT image models. The default value is `png`.
263
304
  #
264
305
  # @param partial_images [Integer, nil]
265
306
  # The number of partial images to generate. This parameter is used for streaming
@@ -350,6 +391,20 @@ module OpenAI
350
391
  # @return [Array<Symbol>]
351
392
  end
352
393
 
394
+ # Computation spent planning the image, independently of rendering quality. Uses
395
+ # the image model's configured default when omitted. For SVG output, controls the
396
+ # reference image, independently of the SVG author's reasoning.
397
+ module Complexity
398
+ extend OpenAI::Internal::Type::Enum
399
+
400
+ LOW = :low
401
+ MEDIUM = :medium
402
+ HIGH = :high
403
+
404
+ # @!method self.values
405
+ # @return [Array<Symbol>]
406
+ end
407
+
353
408
  # Control how much effort the model will exert to match the style and features,
354
409
  # especially facial features, of input images. Supports `high` and `low` on
355
410
  # `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
@@ -367,8 +422,8 @@ module OpenAI
367
422
  # The GPT image model to use for image editing (`gpt-image-1-mini`,
368
423
  # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
369
424
  # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
370
- # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
371
- # `chatgpt-image-latest`).
425
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`,
426
+ # `gpt-image-2.6-sunburst`, `gpt-image-2.6-flare`, or `chatgpt-image-latest`).
372
427
  #
373
428
  # `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
374
429
  # `gpt-image-2.5-flare` instead.
@@ -381,7 +436,8 @@ module OpenAI
381
436
  # (`gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
382
437
  # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
383
438
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
384
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`).
439
+ # `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`, `gpt-image-2.6-flare`,
440
+ # or `chatgpt-image-latest`).
385
441
  #
386
442
  # `gpt-image-1` was shut down on October 23, 2026. Use
387
443
  # `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` instead.
@@ -392,14 +448,14 @@ module OpenAI
392
448
  end
393
449
 
394
450
  # The format in which the generated images are returned. This parameter is only
395
- # supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The
396
- # default value is `png`.
451
+ # supported for the GPT image models. The default value is `png`.
397
452
  module OutputFormat
398
453
  extend OpenAI::Internal::Type::Enum
399
454
 
400
455
  PNG = :png
401
456
  JPEG = :jpeg
402
457
  WEBP = :webp
458
+ GIF = :gif
403
459
 
404
460
  # @!method self.values
405
461
  # @return [Array<Symbol>]
@@ -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