openai 0.61.0 → 0.62.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 (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +10 -1
  5. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +10 -1
  6. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +10 -1
  7. data/lib/openai/models/admin/organization/usage_completions_response.rb +10 -1
  8. data/lib/openai/models/admin/organization/usage_costs_response.rb +10 -1
  9. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +10 -1
  10. data/lib/openai/models/admin/organization/usage_images_response.rb +10 -1
  11. data/lib/openai/models/admin/organization/usage_moderations_response.rb +10 -1
  12. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +10 -1
  13. data/lib/openai/models/chat/chat_completion_token_logprob.rb +1 -2
  14. data/lib/openai/models/chat/completion_create_params.rb +4 -3
  15. data/lib/openai/models/image_edit_params.rb +85 -31
  16. data/lib/openai/models/image_generate_params.rb +78 -26
  17. data/lib/openai/models/image_model.rb +5 -2
  18. data/lib/openai/models/realtime/audio_transcription.rb +37 -5
  19. data/lib/openai/models/realtime/client_secret_create_response.rb +1 -2
  20. data/lib/openai/models/realtime/realtime_audio_config_input.rb +3 -0
  21. data/lib/openai/models/realtime/realtime_audio_input_turn_detection.rb +3 -0
  22. data/lib/openai/models/realtime/realtime_reasoning.rb +24 -0
  23. data/lib/openai/models/realtime/realtime_reasoning_effort.rb +22 -0
  24. data/lib/openai/models/realtime/realtime_response_create_params.rb +18 -1
  25. data/lib/openai/models/realtime/realtime_session.rb +6 -0
  26. data/lib/openai/models/realtime/realtime_session_create_request.rb +21 -1
  27. data/lib/openai/models/realtime/realtime_session_create_response.rb +41 -17
  28. data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +3 -0
  29. data/lib/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rb +3 -0
  30. data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +9 -5
  31. data/lib/openai/models/realtime/realtime_transcription_session_turn_detection.rb +2 -1
  32. data/lib/openai/models/realtime/realtime_translation_client_event.rb +45 -0
  33. data/lib/openai/models/realtime/realtime_translation_client_secret_create_request.rb +85 -0
  34. data/lib/openai/models/realtime/realtime_translation_client_secret_create_response.rb +42 -0
  35. data/lib/openai/models/realtime/realtime_translation_input_audio_buffer_append_event.rb +51 -0
  36. data/lib/openai/models/realtime/realtime_translation_input_transcript_delta_event.rb +55 -0
  37. data/lib/openai/models/realtime/realtime_translation_output_audio_delta_event.rb +89 -0
  38. data/lib/openai/models/realtime/realtime_translation_output_transcript_delta_event.rb +54 -0
  39. data/lib/openai/models/realtime/realtime_translation_server_event.rb +53 -0
  40. data/lib/openai/models/realtime/realtime_translation_session.rb +158 -0
  41. data/lib/openai/models/realtime/realtime_translation_session_close_event.rb +30 -0
  42. data/lib/openai/models/realtime/realtime_translation_session_closed_event.rb +28 -0
  43. data/lib/openai/models/realtime/realtime_translation_session_create_request.rb +138 -0
  44. data/lib/openai/models/realtime/realtime_translation_session_created_event.rb +38 -0
  45. data/lib/openai/models/realtime/realtime_translation_session_update_event.rb +43 -0
  46. data/lib/openai/models/realtime/realtime_translation_session_update_request.rb +129 -0
  47. data/lib/openai/models/realtime/realtime_translation_session_updated_event.rb +37 -0
  48. data/lib/openai/models/realtime/transcription_session_updated_event.rb +1 -2
  49. data/lib/openai/models/responses/response.rb +4 -3
  50. data/lib/openai/models/responses/response_create_params.rb +4 -3
  51. data/lib/openai/models/responses/response_includable.rb +2 -0
  52. data/lib/openai/models/responses/response_text_delta_event.rb +2 -2
  53. data/lib/openai/models/responses/response_text_done_event.rb +2 -2
  54. data/lib/openai/models/responses/responses_client_event.rb +4 -3
  55. data/lib/openai/models/responses/tool.rb +81 -16
  56. data/lib/openai/resources/chat/completions.rb +2 -2
  57. data/lib/openai/resources/images.rb +6 -6
  58. data/lib/openai/resources/realtime/calls.rb +5 -1
  59. data/lib/openai/resources/responses.rb +2 -2
  60. data/lib/openai/version.rb +1 -1
  61. data/lib/openai.rb +18 -1
  62. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +11 -1
  63. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +11 -1
  64. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +11 -1
  65. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +11 -1
  66. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +11 -1
  67. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +11 -1
  68. data/rbi/openai/models/admin/organization/usage_images_response.rbi +11 -1
  69. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +11 -1
  70. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +11 -1
  71. data/rbi/openai/models/chat/chat_completion_token_logprob.rbi +2 -4
  72. data/rbi/openai/models/chat/completion_create_params.rbi +6 -4
  73. data/rbi/openai/models/image_edit_params.rbi +102 -45
  74. data/rbi/openai/models/image_generate_params.rbi +93 -39
  75. data/rbi/openai/models/image_model.rbi +8 -3
  76. data/rbi/openai/models/realtime/audio_transcription.rbi +85 -6
  77. data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +6 -0
  78. data/rbi/openai/models/realtime/realtime_audio_input_turn_detection.rbi +3 -0
  79. data/rbi/openai/models/realtime/realtime_reasoning.rbi +54 -0
  80. data/rbi/openai/models/realtime/realtime_reasoning_effort.rbi +44 -0
  81. data/rbi/openai/models/realtime/realtime_response_create_params.rbi +26 -0
  82. data/rbi/openai/models/realtime/realtime_session.rbi +9 -0
  83. data/rbi/openai/models/realtime/realtime_session_create_request.rbi +31 -0
  84. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +53 -32
  85. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +6 -0
  86. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbi +3 -0
  87. data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +13 -7
  88. data/rbi/openai/models/realtime/realtime_transcription_session_turn_detection.rbi +2 -1
  89. data/rbi/openai/models/realtime/realtime_translation_client_event.rbi +29 -0
  90. data/rbi/openai/models/realtime/realtime_translation_client_secret_create_request.rbi +193 -0
  91. data/rbi/openai/models/realtime/realtime_translation_client_secret_create_response.rbi +69 -0
  92. data/rbi/openai/models/realtime/realtime_translation_input_audio_buffer_append_event.rbi +69 -0
  93. data/rbi/openai/models/realtime/realtime_translation_input_transcript_delta_event.rbi +77 -0
  94. data/rbi/openai/models/realtime/realtime_translation_output_audio_delta_event.rbi +148 -0
  95. data/rbi/openai/models/realtime/realtime_translation_output_transcript_delta_event.rbi +76 -0
  96. data/rbi/openai/models/realtime/realtime_translation_server_event.rbi +33 -0
  97. data/rbi/openai/models/realtime/realtime_translation_session.rbi +339 -0
  98. data/rbi/openai/models/realtime/realtime_translation_session_close_event.rbi +44 -0
  99. data/rbi/openai/models/realtime/realtime_translation_session_closed_event.rbi +39 -0
  100. data/rbi/openai/models/realtime/realtime_translation_session_create_request.rbi +322 -0
  101. data/rbi/openai/models/realtime/realtime_translation_session_created_event.rbi +68 -0
  102. data/rbi/openai/models/realtime/realtime_translation_session_update_event.rbi +78 -0
  103. data/rbi/openai/models/realtime/realtime_translation_session_update_request.rbi +313 -0
  104. data/rbi/openai/models/realtime/realtime_translation_session_updated_event.rbi +67 -0
  105. data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +0 -2
  106. data/rbi/openai/models/responses/response.rbi +6 -4
  107. data/rbi/openai/models/responses/response_create_params.rbi +6 -4
  108. data/rbi/openai/models/responses/response_includable.rbi +2 -0
  109. data/rbi/openai/models/responses/response_text_delta_event.rbi +2 -2
  110. data/rbi/openai/models/responses/response_text_done_event.rbi +2 -2
  111. data/rbi/openai/models/responses/responses_client_event.rbi +6 -4
  112. data/rbi/openai/models/responses/tool.rbi +122 -27
  113. data/rbi/openai/resources/chat/completions.rbi +6 -4
  114. data/rbi/openai/resources/images.rbi +110 -44
  115. data/rbi/openai/resources/realtime/calls.rbi +7 -0
  116. data/rbi/openai/resources/responses.rbi +6 -4
  117. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +7 -2
  118. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +7 -2
  119. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +7 -2
  120. data/sig/openai/models/admin/organization/usage_completions_response.rbs +7 -2
  121. data/sig/openai/models/admin/organization/usage_costs_response.rbs +7 -2
  122. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +7 -2
  123. data/sig/openai/models/admin/organization/usage_images_response.rbs +7 -2
  124. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +7 -2
  125. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +7 -2
  126. data/sig/openai/models/image_edit_params.rbs +5 -4
  127. data/sig/openai/models/image_generate_params.rbs +5 -4
  128. data/sig/openai/models/image_model.rbs +11 -5
  129. data/sig/openai/models/realtime/audio_transcription.rbs +25 -0
  130. data/sig/openai/models/realtime/realtime_reasoning.rbs +24 -0
  131. data/sig/openai/models/realtime/realtime_reasoning_effort.rbs +20 -0
  132. data/sig/openai/models/realtime/realtime_response_create_params.rbs +16 -0
  133. data/sig/openai/models/realtime/realtime_session_create_request.rbs +18 -0
  134. data/sig/openai/models/realtime/realtime_session_create_response.rbs +27 -4
  135. data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +4 -8
  136. data/sig/openai/models/realtime/realtime_translation_client_event.rbs +16 -0
  137. data/sig/openai/models/realtime/realtime_translation_client_secret_create_request.rbs +69 -0
  138. data/sig/openai/models/realtime/realtime_translation_client_secret_create_response.rbs +32 -0
  139. data/sig/openai/models/realtime/realtime_translation_input_audio_buffer_append_event.rbs +34 -0
  140. data/sig/openai/models/realtime/realtime_translation_input_transcript_delta_event.rbs +37 -0
  141. data/sig/openai/models/realtime/realtime_translation_output_audio_delta_event.rbs +70 -0
  142. data/sig/openai/models/realtime/realtime_translation_output_transcript_delta_event.rbs +37 -0
  143. data/sig/openai/models/realtime/realtime_translation_server_event.rbs +20 -0
  144. data/sig/openai/models/realtime/realtime_translation_session.rbs +131 -0
  145. data/sig/openai/models/realtime/realtime_translation_session_close_event.rbs +20 -0
  146. data/sig/openai/models/realtime/realtime_translation_session_closed_event.rbs +18 -0
  147. data/sig/openai/models/realtime/realtime_translation_session_create_request.rbs +120 -0
  148. data/sig/openai/models/realtime/realtime_translation_session_created_event.rbs +32 -0
  149. data/sig/openai/models/realtime/realtime_translation_session_update_event.rbs +34 -0
  150. data/sig/openai/models/realtime/realtime_translation_session_update_request.rbs +115 -0
  151. data/sig/openai/models/realtime/realtime_translation_session_updated_event.rbs +32 -0
  152. data/sig/openai/models/responses/tool.rbs +15 -5
  153. data/sig/openai/resources/realtime/calls.rbs +2 -0
  154. metadata +56 -5
  155. data/lib/openai/models/realtime/realtime_session_client_secret.rb +0 -36
  156. data/rbi/openai/models/realtime/realtime_session_client_secret.rbi +0 -49
  157. data/sig/openai/models/realtime/realtime_session_client_secret.rbs +0 -20
@@ -19,9 +19,14 @@ module OpenAI
19
19
 
20
20
  # @!attribute background
21
21
  # Allows to set transparency for the background of the generated image(s). This
22
- # parameter is only supported for the GPT image models. Must be one of
23
- # `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
24
- # model will automatically determine the best background for the image.
22
+ # parameter is only supported for GPT image models that support transparent
23
+ # backgrounds. Must be one of `transparent`, `opaque`, or `auto` (default value).
24
+ # When `auto` is used, the model will automatically determine the best background
25
+ # for the image.
26
+ #
27
+ # `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent
28
+ # backgrounds. Requests with `background` set to `transparent` will return an
29
+ # error for these models; use `opaque` or `auto` instead.
25
30
  #
26
31
  # If `transparent`, the output format needs to support transparency, so it should
27
32
  # be set to either `png` (default value) or `webp`.
@@ -31,8 +36,9 @@ module OpenAI
31
36
 
32
37
  # @!attribute model
33
38
  # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
34
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to
35
- # `dall-e-2` unless a parameter specific to the GPT image models is used.
39
+ # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
40
+ # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific
41
+ # to the GPT image models is used.
36
42
  #
37
43
  # @return [String, Symbol, OpenAI::Models::ImageModel, nil]
38
44
  optional :model, union: -> { OpenAI::ImageGenerateParams::Model }, nil?: true
@@ -100,13 +106,20 @@ module OpenAI
100
106
  optional :response_format, enum: -> { OpenAI::ImageGenerateParams::ResponseFormat }, nil?: true
101
107
 
102
108
  # @!attribute size
103
- # The size of the generated images. Must be one of `1024x1024`, `1536x1024`
104
- # (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image
105
- # models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of
106
- # `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
107
- #
108
- # @return [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
109
- optional :size, enum: -> { OpenAI::ImageGenerateParams::Size }, nil?: true
109
+ # The size of the generated images. For `gpt-image-2` and
110
+ # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
111
+ # strings, for example `1536x864`. Width and height must both be divisible by 16
112
+ # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
113
+ # `2560x1440` are experimental, and the maximum supported resolution is
114
+ # `3840x2160`. The requested size must also satisfy the model's current pixel and
115
+ # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
116
+ # supported by the GPT image models; `auto` is supported for models that allow
117
+ # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
118
+ # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
119
+ # `1024x1792`.
120
+ #
121
+ # @return [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
122
+ optional :size, union: -> { OpenAI::ImageGenerateParams::Size }, nil?: true
110
123
 
111
124
  # @!attribute style
112
125
  # The style of the generated images. This parameter is only supported for
@@ -149,7 +162,7 @@ module OpenAI
149
162
  #
150
163
  # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] The format in which generated images with `dall-e-2` and `dall-e-3` are returned
151
164
  #
152
- # @param size [Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. Must be one of `1024x1024`, `1536x1024` (lands
165
+ # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`
153
166
  #
154
167
  # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] The style of the generated images. This parameter is only supported for `dall-e-
155
168
  #
@@ -158,9 +171,14 @@ module OpenAI
158
171
  # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
159
172
 
160
173
  # Allows to set transparency for the background of the generated image(s). This
161
- # parameter is only supported for the GPT image models. Must be one of
162
- # `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
163
- # model will automatically determine the best background for the image.
174
+ # parameter is only supported for GPT image models that support transparent
175
+ # backgrounds. Must be one of `transparent`, `opaque`, or `auto` (default value).
176
+ # When `auto` is used, the model will automatically determine the best background
177
+ # for the image.
178
+ #
179
+ # `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent
180
+ # backgrounds. Requests with `background` set to `transparent` will return an
181
+ # error for these models; use `opaque` or `auto` instead.
164
182
  #
165
183
  # If `transparent`, the output format needs to support transparency, so it should
166
184
  # be set to either `png` (default value) or `webp`.
@@ -176,14 +194,15 @@ module OpenAI
176
194
  end
177
195
 
178
196
  # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
179
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to
180
- # `dall-e-2` unless a parameter specific to the GPT image models is used.
197
+ # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
198
+ # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific
199
+ # to the GPT image models is used.
181
200
  module Model
182
201
  extend OpenAI::Internal::Type::Union
183
202
 
184
203
  variant String
185
204
 
186
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
205
+ # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.
187
206
  variant enum: -> { OpenAI::ImageModel }
188
207
 
189
208
  # @!method self.variants
@@ -251,12 +270,46 @@ module OpenAI
251
270
  # @return [Array<Symbol>]
252
271
  end
253
272
 
254
- # The size of the generated images. Must be one of `1024x1024`, `1536x1024`
255
- # (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image
256
- # models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of
257
- # `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
273
+ # The size of the generated images. For `gpt-image-2` and
274
+ # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
275
+ # strings, for example `1536x864`. Width and height must both be divisible by 16
276
+ # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
277
+ # `2560x1440` are experimental, and the maximum supported resolution is
278
+ # `3840x2160`. The requested size must also satisfy the model's current pixel and
279
+ # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
280
+ # supported by the GPT image models; `auto` is supported for models that allow
281
+ # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
282
+ # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
283
+ # `1024x1792`.
258
284
  module Size
259
- extend OpenAI::Internal::Type::Enum
285
+ extend OpenAI::Internal::Type::Union
286
+
287
+ variant String
288
+
289
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::AUTO }
290
+
291
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_1024X1024 }
292
+
293
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_1536X1024 }
294
+
295
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_1024X1536 }
296
+
297
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_256X256 }
298
+
299
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_512X512 }
300
+
301
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_1792X1024 }
302
+
303
+ variant const: -> { OpenAI::Models::ImageGenerateParams::Size::SIZE_1024X1792 }
304
+
305
+ # @!method self.variants
306
+ # @return [Array(String, Symbol)]
307
+
308
+ define_sorbet_constant!(:Variants) do
309
+ T.type_alias { T.any(String, OpenAI::ImageGenerateParams::Size::TaggedSymbol) }
310
+ end
311
+
312
+ # @!group
260
313
 
261
314
  AUTO = :auto
262
315
  SIZE_1024X1024 = :"1024x1024"
@@ -267,8 +320,7 @@ module OpenAI
267
320
  SIZE_1792X1024 = :"1792x1024"
268
321
  SIZE_1024X1792 = :"1024x1792"
269
322
 
270
- # @!method self.values
271
- # @return [Array<Symbol>]
323
+ # @!endgroup
272
324
  end
273
325
 
274
326
  # The style of the generated images. This parameter is only supported for
@@ -5,11 +5,14 @@ module OpenAI
5
5
  module ImageModel
6
6
  extend OpenAI::Internal::Type::Enum
7
7
 
8
+ GPT_IMAGE_1 = :"gpt-image-1"
9
+ GPT_IMAGE_1_MINI = :"gpt-image-1-mini"
10
+ GPT_IMAGE_2 = :"gpt-image-2"
11
+ GPT_IMAGE_2_2026_04_21 = :"gpt-image-2-2026-04-21"
8
12
  GPT_IMAGE_1_5 = :"gpt-image-1.5"
13
+ CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest"
9
14
  DALL_E_2 = :"dall-e-2"
10
15
  DALL_E_3 = :"dall-e-3"
11
- GPT_IMAGE_1 = :"gpt-image-1"
12
- GPT_IMAGE_1_MINI = :"gpt-image-1-mini"
13
16
 
14
17
  # @!method self.values
15
18
  # @return [Array<Symbol>]
@@ -4,6 +4,14 @@ module OpenAI
4
4
  module Models
5
5
  module Realtime
6
6
  class AudioTranscription < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute delay
8
+ # Controls how long the model waits before emitting transcription text. Higher
9
+ # values can improve transcription accuracy at the cost of latency. Only supported
10
+ # with `gpt-realtime-whisper` in GA Realtime sessions.
11
+ #
12
+ # @return [Symbol, OpenAI::Models::Realtime::AudioTranscription::Delay, nil]
13
+ optional :delay, enum: -> { OpenAI::Realtime::AudioTranscription::Delay }
14
+
7
15
  # @!attribute language
8
16
  # The language of the input audio. Supplying the input language in
9
17
  # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
@@ -15,8 +23,8 @@ module OpenAI
15
23
  # @!attribute model
16
24
  # The model to use for transcription. Current options are `whisper-1`,
17
25
  # `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`,
18
- # `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use
19
- # `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
26
+ # `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`.
27
+ # Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
20
28
  #
21
29
  # @return [String, Symbol, OpenAI::Models::Realtime::AudioTranscription::Model, nil]
22
30
  optional :model, union: -> { OpenAI::Realtime::AudioTranscription::Model }
@@ -27,24 +35,45 @@ module OpenAI
27
35
  # [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
28
36
  # For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the
29
37
  # prompt is a free text string, for example "expect words related to technology".
38
+ # Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions.
30
39
  #
31
40
  # @return [String, nil]
32
41
  optional :prompt, String
33
42
 
34
- # @!method initialize(language: nil, model: nil, prompt: nil)
43
+ # @!method initialize(delay: nil, language: nil, model: nil, prompt: nil)
35
44
  # Some parameter documentations has been truncated, see
36
45
  # {OpenAI::Models::Realtime::AudioTranscription} for more details.
37
46
  #
47
+ # @param delay [Symbol, OpenAI::Models::Realtime::AudioTranscription::Delay] Controls how long the model waits before emitting transcription text.
48
+ #
38
49
  # @param language [String] The language of the input audio. Supplying the input language in
39
50
  #
40
51
  # @param model [String, Symbol, OpenAI::Models::Realtime::AudioTranscription::Model] The model to use for transcription. Current options are `whisper-1`, `gpt-4o-min
41
52
  #
42
53
  # @param prompt [String] An optional text to guide the model's style or continue a previous audio
43
54
 
55
+ # Controls how long the model waits before emitting transcription text. Higher
56
+ # values can improve transcription accuracy at the cost of latency. Only supported
57
+ # with `gpt-realtime-whisper` in GA Realtime sessions.
58
+ #
59
+ # @see OpenAI::Models::Realtime::AudioTranscription#delay
60
+ module Delay
61
+ extend OpenAI::Internal::Type::Enum
62
+
63
+ MINIMAL = :minimal
64
+ LOW = :low
65
+ MEDIUM = :medium
66
+ HIGH = :high
67
+ XHIGH = :xhigh
68
+
69
+ # @!method self.values
70
+ # @return [Array<Symbol>]
71
+ end
72
+
44
73
  # The model to use for transcription. Current options are `whisper-1`,
45
74
  # `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`,
46
- # `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use
47
- # `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
75
+ # `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`.
76
+ # Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
48
77
  #
49
78
  # @see OpenAI::Models::Realtime::AudioTranscription#model
50
79
  module Model
@@ -62,6 +91,8 @@ module OpenAI
62
91
 
63
92
  variant const: -> { OpenAI::Models::Realtime::AudioTranscription::Model::GPT_4O_TRANSCRIBE_DIARIZE }
64
93
 
94
+ variant const: -> { OpenAI::Models::Realtime::AudioTranscription::Model::GPT_REALTIME_WHISPER }
95
+
65
96
  # @!method self.variants
66
97
  # @return [Array(String, Symbol)]
67
98
 
@@ -76,6 +107,7 @@ module OpenAI
76
107
  GPT_4O_MINI_TRANSCRIBE_2025_12_15 = :"gpt-4o-mini-transcribe-2025-12-15"
77
108
  GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
78
109
  GPT_4O_TRANSCRIBE_DIARIZE = :"gpt-4o-transcribe-diarize"
110
+ GPT_REALTIME_WHISPER = :"gpt-realtime-whisper"
79
111
 
80
112
  # @!endgroup
81
113
  end
@@ -43,8 +43,7 @@ module OpenAI
43
43
 
44
44
  discriminator :type
45
45
 
46
- # A new Realtime session configuration, with an ephemeral key. Default TTL
47
- # for keys is one minute.
46
+ # A Realtime session configuration object.
48
47
  variant :realtime, -> { OpenAI::Realtime::RealtimeSessionCreateResponse }
49
48
 
50
49
  # A Realtime transcription session configuration object.
@@ -48,6 +48,9 @@ module OpenAI
48
48
  # wait longer for the user to continue speaking. This can be useful for more
49
49
  # natural conversations, but may have a higher latency.
50
50
  #
51
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
52
+ # `null`; VAD is not supported.
53
+ #
51
54
  # @return [OpenAI::Models::Realtime::RealtimeAudioInputTurnDetection::ServerVad, OpenAI::Models::Realtime::RealtimeAudioInputTurnDetection::SemanticVad, nil]
52
55
  optional :turn_detection, union: -> { OpenAI::Realtime::RealtimeAudioInputTurnDetection }, nil?: true
53
56
 
@@ -16,6 +16,9 @@ module OpenAI
16
16
  # trails off with "uhhm", the model will score a low probability of turn end and
17
17
  # wait longer for the user to continue speaking. This can be useful for more
18
18
  # natural conversations, but may have a higher latency.
19
+ #
20
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
21
+ # `null`; VAD is not supported.
19
22
  module RealtimeAudioInputTurnDetection
20
23
  extend OpenAI::Internal::Type::Union
21
24
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ class RealtimeReasoning < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute effort
8
+ # Constrains effort on reasoning for reasoning-capable Realtime models such as
9
+ # `gpt-realtime-2`.
10
+ #
11
+ # @return [Symbol, OpenAI::Models::Realtime::RealtimeReasoningEffort, nil]
12
+ optional :effort, enum: -> { OpenAI::Realtime::RealtimeReasoningEffort }
13
+
14
+ # @!method initialize(effort: nil)
15
+ # Some parameter documentations has been truncated, see
16
+ # {OpenAI::Models::Realtime::RealtimeReasoning} for more details.
17
+ #
18
+ # Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
19
+ #
20
+ # @param effort [Symbol, OpenAI::Models::Realtime::RealtimeReasoningEffort] Constrains effort on reasoning for reasoning-capable Realtime models such as
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Realtime
6
+ # Constrains effort on reasoning for reasoning-capable Realtime models such as
7
+ # `gpt-realtime-2`.
8
+ module RealtimeReasoningEffort
9
+ extend OpenAI::Internal::Type::Enum
10
+
11
+ MINIMAL = :minimal
12
+ LOW = :low
13
+ MEDIUM = :medium
14
+ HIGH = :high
15
+ XHIGH = :xhigh
16
+
17
+ # @!method self.values
18
+ # @return [Array<Symbol>]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -73,6 +73,13 @@ module OpenAI
73
73
  optional :output_modalities,
74
74
  -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeResponseCreateParams::OutputModality] }
75
75
 
76
+ # @!attribute parallel_tool_calls
77
+ # Whether the model may call multiple tools in parallel. Only supported by
78
+ # reasoning Realtime models such as `gpt-realtime-2`.
79
+ #
80
+ # @return [Boolean, nil]
81
+ optional :parallel_tool_calls, OpenAI::Internal::Type::Boolean
82
+
76
83
  # @!attribute prompt
77
84
  # Reference to a prompt template and its variables.
78
85
  # [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
@@ -80,6 +87,12 @@ module OpenAI
80
87
  # @return [OpenAI::Models::Responses::ResponsePrompt, nil]
81
88
  optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true
82
89
 
90
+ # @!attribute reasoning
91
+ # Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
92
+ #
93
+ # @return [OpenAI::Models::Realtime::RealtimeReasoning, nil]
94
+ optional :reasoning, -> { OpenAI::Realtime::RealtimeReasoning }
95
+
83
96
  # @!attribute tool_choice
84
97
  # How the model chooses tools. Provide one of the string modes or force a specific
85
98
  # function/MCP tool.
@@ -94,7 +107,7 @@ module OpenAI
94
107
  optional :tools,
95
108
  -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeResponseCreateParams::Tool] }
96
109
 
97
- # @!method initialize(audio: nil, conversation: nil, input: nil, instructions: nil, max_output_tokens: nil, metadata: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil)
110
+ # @!method initialize(audio: nil, conversation: nil, input: nil, instructions: nil, max_output_tokens: nil, metadata: nil, output_modalities: nil, parallel_tool_calls: nil, prompt: nil, reasoning: nil, tool_choice: nil, tools: nil)
98
111
  # Some parameter documentations has been truncated, see
99
112
  # {OpenAI::Models::Realtime::RealtimeResponseCreateParams} for more details.
100
113
  #
@@ -114,8 +127,12 @@ module OpenAI
114
127
  #
115
128
  # @param output_modalities [Array<Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateParams::OutputModality>] The set of modalities the model used to respond, currently the only possible val
116
129
  #
130
+ # @param parallel_tool_calls [Boolean] Whether the model may call multiple tools in parallel. Only supported by
131
+ #
117
132
  # @param prompt [OpenAI::Models::Responses::ResponsePrompt, nil] Reference to a prompt template and its variables.
118
133
  #
134
+ # @param reasoning [OpenAI::Models::Realtime::RealtimeReasoning] Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
135
+ #
119
136
  # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
120
137
  #
121
138
  # @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool>] Tools available to the model.
@@ -170,6 +170,9 @@ module OpenAI
170
170
  # wait longer for the user to continue speaking. This can be useful for more
171
171
  # natural conversations, but may have a higher latency.
172
172
  #
173
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
174
+ # `null`; VAD is not supported.
175
+ #
173
176
  # @return [OpenAI::Models::Realtime::RealtimeSession::TurnDetection::ServerVad, OpenAI::Models::Realtime::RealtimeSession::TurnDetection::SemanticVad, nil]
174
177
  optional :turn_detection, union: -> { OpenAI::Realtime::RealtimeSession::TurnDetection }, nil?: true
175
178
 
@@ -468,6 +471,9 @@ module OpenAI
468
471
  # wait longer for the user to continue speaking. This can be useful for more
469
472
  # natural conversations, but may have a higher latency.
470
473
  #
474
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
475
+ # `null`; VAD is not supported.
476
+ #
471
477
  # @see OpenAI::Models::Realtime::RealtimeSession#turn_detection
472
478
  module TurnDetection
473
479
  extend OpenAI::Internal::Type::Union
@@ -66,6 +66,13 @@ module OpenAI
66
66
  optional :output_modalities,
67
67
  -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateRequest::OutputModality] }
68
68
 
69
+ # @!attribute parallel_tool_calls
70
+ # Whether the model may call multiple tools in parallel. Only supported by
71
+ # reasoning Realtime models such as `gpt-realtime-2`.
72
+ #
73
+ # @return [Boolean, nil]
74
+ optional :parallel_tool_calls, OpenAI::Internal::Type::Boolean
75
+
69
76
  # @!attribute prompt
70
77
  # Reference to a prompt template and its variables.
71
78
  # [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
@@ -73,6 +80,12 @@ module OpenAI
73
80
  # @return [OpenAI::Models::Responses::ResponsePrompt, nil]
74
81
  optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true
75
82
 
83
+ # @!attribute reasoning
84
+ # Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
85
+ #
86
+ # @return [OpenAI::Models::Realtime::RealtimeReasoning, nil]
87
+ optional :reasoning, -> { OpenAI::Realtime::RealtimeReasoning }
88
+
76
89
  # @!attribute tool_choice
77
90
  # How the model chooses tools. Provide one of the string modes or force a specific
78
91
  # function/MCP tool.
@@ -121,7 +134,7 @@ module OpenAI
121
134
  # @return [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio, nil]
122
135
  optional :truncation, union: -> { OpenAI::Realtime::RealtimeTruncation }
123
136
 
124
- # @!method initialize(audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime)
137
+ # @!method initialize(audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, parallel_tool_calls: nil, prompt: nil, reasoning: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime)
125
138
  # Some parameter documentations has been truncated, see
126
139
  # {OpenAI::Models::Realtime::RealtimeSessionCreateRequest} for more details.
127
140
  #
@@ -139,8 +152,12 @@ module OpenAI
139
152
  #
140
153
  # @param output_modalities [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateRequest::OutputModality>] The set of modalities the model can respond with. It defaults to `["audio"]`, in
141
154
  #
155
+ # @param parallel_tool_calls [Boolean] Whether the model may call multiple tools in parallel. Only supported by
156
+ #
142
157
  # @param prompt [OpenAI::Models::Responses::ResponsePrompt, nil] Reference to a prompt template and its variables.
143
158
  #
159
+ # @param reasoning [OpenAI::Models::Realtime::RealtimeReasoning] Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
160
+ #
144
161
  # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
145
162
  #
146
163
  # @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp>] Tools available to the model.
@@ -188,6 +205,8 @@ module OpenAI
188
205
 
189
206
  variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_REALTIME_1_5 }
190
207
 
208
+ variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_REALTIME_2 }
209
+
191
210
  variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_REALTIME_2025_08_28 }
192
211
 
193
212
  variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_4O_REALTIME_PREVIEW }
@@ -227,6 +246,7 @@ module OpenAI
227
246
 
228
247
  GPT_REALTIME = :"gpt-realtime"
229
248
  GPT_REALTIME_1_5 = :"gpt-realtime-1.5"
249
+ GPT_REALTIME_2 = :"gpt-realtime-2"
230
250
  GPT_REALTIME_2025_08_28 = :"gpt-realtime-2025-08-28"
231
251
  GPT_4O_REALTIME_PREVIEW = :"gpt-4o-realtime-preview"
232
252
  GPT_4O_REALTIME_PREVIEW_2024_10_01 = :"gpt-4o-realtime-preview-2024-10-01"
@@ -4,11 +4,17 @@ module OpenAI
4
4
  module Models
5
5
  module Realtime
6
6
  class RealtimeSessionCreateResponse < OpenAI::Internal::Type::BaseModel
7
- # @!attribute client_secret
8
- # Ephemeral key returned by the API.
7
+ # @!attribute id
8
+ # Unique identifier for the session that looks like `sess_1234567890abcdef`.
9
9
  #
10
- # @return [OpenAI::Models::Realtime::RealtimeSessionClientSecret]
11
- required :client_secret, -> { OpenAI::Realtime::RealtimeSessionClientSecret }
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute object
14
+ # The object type. Always `realtime.session`.
15
+ #
16
+ # @return [Symbol, :"realtime.session"]
17
+ required :object, const: :"realtime.session"
12
18
 
13
19
  # @!attribute type
14
20
  # The type of session to create. Always `realtime` for the Realtime API.
@@ -22,6 +28,12 @@ module OpenAI
22
28
  # @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio, nil]
23
29
  optional :audio, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio }
24
30
 
31
+ # @!attribute expires_at
32
+ # Expiration timestamp for the session, in seconds since epoch.
33
+ #
34
+ # @return [Integer, nil]
35
+ optional :expires_at, Integer
36
+
25
37
  # @!attribute include
26
38
  # Additional fields to include in server outputs.
27
39
  #
@@ -80,6 +92,12 @@ module OpenAI
80
92
  # @return [OpenAI::Models::Responses::ResponsePrompt, nil]
81
93
  optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true
82
94
 
95
+ # @!attribute reasoning
96
+ # Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
97
+ #
98
+ # @return [OpenAI::Models::Realtime::RealtimeReasoning, nil]
99
+ optional :reasoning, -> { OpenAI::Realtime::RealtimeReasoning }
100
+
83
101
  # @!attribute tool_choice
84
102
  # How the model chooses tools. Provide one of the string modes or force a specific
85
103
  # function/MCP tool.
@@ -129,17 +147,18 @@ module OpenAI
129
147
  # @return [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio, nil]
130
148
  optional :truncation, union: -> { OpenAI::Realtime::RealtimeTruncation }
131
149
 
132
- # @!method initialize(client_secret:, audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime)
150
+ # @!method initialize(id:, audio: nil, expires_at: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, reasoning: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, object: :"realtime.session", type: :realtime)
133
151
  # Some parameter documentations has been truncated, see
134
152
  # {OpenAI::Models::Realtime::RealtimeSessionCreateResponse} for more details.
135
153
  #
136
- # A new Realtime session configuration, with an ephemeral key. Default TTL for
137
- # keys is one minute.
154
+ # A Realtime session configuration object.
138
155
  #
139
- # @param client_secret [OpenAI::Models::Realtime::RealtimeSessionClientSecret] Ephemeral key returned by the API.
156
+ # @param id [String] Unique identifier for the session that looks like `sess_1234567890abcdef`.
140
157
  #
141
158
  # @param audio [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio] Configuration for input and output audio.
142
159
  #
160
+ # @param expires_at [Integer] Expiration timestamp for the session, in seconds since epoch.
161
+ #
143
162
  # @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>] Additional fields to include in server outputs.
144
163
  #
145
164
  # @param instructions [String] The default system instructions (i.e. system message) prepended to model calls.
@@ -152,6 +171,8 @@ module OpenAI
152
171
  #
153
172
  # @param prompt [OpenAI::Models::Responses::ResponsePrompt, nil] Reference to a prompt template and its variables.
154
173
  #
174
+ # @param reasoning [OpenAI::Models::Realtime::RealtimeReasoning] Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
175
+ #
155
176
  # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
156
177
  #
157
178
  # @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool>] Tools available to the model.
@@ -160,6 +181,8 @@ module OpenAI
160
181
  #
161
182
  # @param truncation [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio] When the number of tokens in a conversation exceeds the model's input token limi
162
183
  #
184
+ # @param object [Symbol, :"realtime.session"] The object type. Always `realtime.session`.
185
+ #
163
186
  # @param type [Symbol, :realtime] The type of session to create. Always `realtime` for the Realtime API.
164
187
 
165
188
  # @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#audio
@@ -200,14 +223,6 @@ module OpenAI
200
223
  -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction }
201
224
 
202
225
  # @!attribute transcription
203
- # Configuration for input audio transcription, defaults to off and can be set to
204
- # `null` to turn off once on. Input audio transcription is not native to the
205
- # model, since the model consumes audio directly. Transcription runs
206
- # asynchronously through
207
- # [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
208
- # and should be treated as guidance of input audio content rather than precisely
209
- # what the model heard. The client can optionally set the language and prompt for
210
- # transcription, these offer additional guidance to the transcription service.
211
226
  #
212
227
  # @return [OpenAI::Models::Realtime::AudioTranscription, nil]
213
228
  optional :transcription, -> { OpenAI::Realtime::AudioTranscription }
@@ -227,6 +242,9 @@ module OpenAI
227
242
  # wait longer for the user to continue speaking. This can be useful for more
228
243
  # natural conversations, but may have a higher latency.
229
244
  #
245
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
246
+ # `null`; VAD is not supported.
247
+ #
230
248
  # @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::ServerVad, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::SemanticVad, nil]
231
249
  optional :turn_detection,
232
250
  union: -> {
@@ -243,7 +261,7 @@ module OpenAI
243
261
  #
244
262
  # @param noise_reduction [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction] Configuration for input audio noise reduction. This can be set to `null` to turn
245
263
  #
246
- # @param transcription [OpenAI::Models::Realtime::AudioTranscription] Configuration for input audio transcription, defaults to off and can be set to `
264
+ # @param transcription [OpenAI::Models::Realtime::AudioTranscription]
247
265
  #
248
266
  # @param turn_detection [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::ServerVad, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::SemanticVad, nil] Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
249
267
 
@@ -285,6 +303,9 @@ module OpenAI
285
303
  # wait longer for the user to continue speaking. This can be useful for more
286
304
  # natural conversations, but may have a higher latency.
287
305
  #
306
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
307
+ # `null`; VAD is not supported.
308
+ #
288
309
  # @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#turn_detection
289
310
  module TurnDetection
290
311
  extend OpenAI::Internal::Type::Union
@@ -597,6 +618,8 @@ module OpenAI
597
618
 
598
619
  variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME_1_5 }
599
620
 
621
+ variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME_2 }
622
+
600
623
  variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME_2025_08_28 }
601
624
 
602
625
  variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_REALTIME_PREVIEW }
@@ -636,6 +659,7 @@ module OpenAI
636
659
 
637
660
  GPT_REALTIME = :"gpt-realtime"
638
661
  GPT_REALTIME_1_5 = :"gpt-realtime-1.5"
662
+ GPT_REALTIME_2 = :"gpt-realtime-2"
639
663
  GPT_REALTIME_2025_08_28 = :"gpt-realtime-2025-08-28"
640
664
  GPT_4O_REALTIME_PREVIEW = :"gpt-4o-realtime-preview"
641
665
  GPT_4O_REALTIME_PREVIEW_2024_10_01 = :"gpt-4o-realtime-preview-2024-10-01"
@@ -48,6 +48,9 @@ module OpenAI
48
48
  # wait longer for the user to continue speaking. This can be useful for more
49
49
  # natural conversations, but may have a higher latency.
50
50
  #
51
+ # For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
52
+ # `null`; VAD is not supported.
53
+ #
51
54
  # @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionAudioInputTurnDetection::ServerVad, OpenAI::Models::Realtime::RealtimeTranscriptionSessionAudioInputTurnDetection::SemanticVad, nil]
52
55
  optional :turn_detection,
53
56
  union: -> { OpenAI::Realtime::RealtimeTranscriptionSessionAudioInputTurnDetection },