openai 0.98.0 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
  5. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
  6. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
  7. data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
  8. data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
  9. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
  10. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
  11. data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
  12. data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
  13. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
  14. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
  15. data/lib/openai/models/all_models.rb +42 -0
  16. data/lib/openai/models/audio/speech_create_params.rb +6 -0
  17. data/lib/openai/models/audio/voice.rb +75 -0
  18. data/lib/openai/models/audio/voice_create_params.rb +217 -0
  19. data/lib/openai/models/beta/agent_create_params.rb +0 -3
  20. data/lib/openai/models/beta/agent_update_params.rb +0 -3
  21. data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
  22. data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
  23. data/lib/openai/models/beta/beta_response.rb +220 -0
  24. data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
  25. data/lib/openai/models/beta/beta_tool.rb +3 -9
  26. data/lib/openai/models/beta/response_compact_params.rb +220 -0
  27. data/lib/openai/models/beta/response_create_params.rb +220 -0
  28. data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
  29. data/lib/openai/models/chat_model.rb +178 -0
  30. data/lib/openai/models/image.rb +14 -14
  31. data/lib/openai/models/image_create_variation_params.rb +7 -7
  32. data/lib/openai/models/image_edit_params.rb +76 -87
  33. data/lib/openai/models/image_generate_params.rb +51 -62
  34. data/lib/openai/models/image_model.rb +5 -3
  35. data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
  36. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
  37. data/lib/openai/models/responses/response_compact_params.rb +220 -0
  38. data/lib/openai/models/responses/tool.rb +3 -9
  39. data/lib/openai/models/responses_model.rb +42 -0
  40. data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
  41. data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
  42. data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
  43. data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
  44. data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
  45. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
  46. data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
  47. data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
  48. data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
  49. data/lib/openai/resources/audio/speech.rb +2 -0
  50. data/lib/openai/resources/audio/voices.rb +53 -0
  51. data/lib/openai/resources/audio.rb +5 -0
  52. data/lib/openai/resources/images.rb +71 -103
  53. data/lib/openai/resources/webhooks.rb +1 -1
  54. data/lib/openai/version.rb +1 -1
  55. data/lib/openai.rb +8 -0
  56. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
  57. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
  58. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
  59. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
  60. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
  61. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
  62. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
  63. data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
  64. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
  65. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
  66. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
  67. data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
  68. data/rbi/openai/models/audio/voice.rbi +111 -0
  69. data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
  70. data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
  71. data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
  72. data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
  73. data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
  74. data/rbi/openai/models/beta/beta_tool.rbi +3 -9
  75. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
  76. data/rbi/openai/models/image.rbi +14 -14
  77. data/rbi/openai/models/image_create_variation_params.rbi +6 -6
  78. data/rbi/openai/models/image_edit_params.rbi +61 -82
  79. data/rbi/openai/models/image_generate_params.rbi +30 -61
  80. data/rbi/openai/models/image_model.rbi +3 -3
  81. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
  82. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
  83. data/rbi/openai/models/responses/tool.rbi +3 -9
  84. data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
  85. data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
  86. data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
  87. data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
  88. data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
  89. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
  90. data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
  91. data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
  92. data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
  93. data/rbi/openai/resources/audio/speech.rbi +2 -0
  94. data/rbi/openai/resources/audio/voices.rbi +49 -0
  95. data/rbi/openai/resources/audio.rbi +4 -0
  96. data/rbi/openai/resources/images.rbi +69 -103
  97. data/rbi/openai/resources/webhooks.rbi +5 -0
  98. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
  99. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
  100. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
  101. data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
  102. data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
  103. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
  104. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
  105. data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
  106. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
  107. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
  108. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
  109. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  110. data/sig/openai/models/audio/voice.rbs +70 -0
  111. data/sig/openai/models/audio/voice_create_params.rbs +203 -0
  112. data/sig/openai/models/beta/agent_create_params.rbs +1 -5
  113. data/sig/openai/models/beta/agent_update_params.rbs +1 -5
  114. data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
  115. data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
  116. data/sig/openai/models/beta/beta_tool.rbs +3 -9
  117. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
  118. data/sig/openai/models/image.rbs +21 -21
  119. data/sig/openai/models/image_create_variation_params.rbs +4 -4
  120. data/sig/openai/models/image_edit_params.rbs +46 -60
  121. data/sig/openai/models/image_generate_params.rbs +23 -45
  122. data/sig/openai/models/image_model.rbs +6 -6
  123. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
  124. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
  125. data/sig/openai/models/responses/tool.rbs +3 -9
  126. data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
  127. data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
  128. data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
  129. data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
  130. data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
  131. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
  132. data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
  133. data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
  134. data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
  135. data/sig/openai/resources/audio/voices.rbs +14 -0
  136. data/sig/openai/resources/audio.rbs +2 -0
  137. data/sig/openai/resources/webhooks.rbs +6 -1
  138. metadata +25 -1
@@ -23,8 +23,7 @@ module OpenAI
23
23
  include OpenAI::Internal::Type::RequestParameters
24
24
 
25
25
  # A text description of the desired image(s). The maximum length is 32000
26
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
27
- # characters for `dall-e-3`.
26
+ # characters.
28
27
  attr_accessor prompt: String
29
28
 
30
29
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -38,12 +37,11 @@ module OpenAI
38
37
  # set the output format to `png` or `webp`.
39
38
  attr_accessor background: OpenAI::Models::ImageGenerateParams::background?
40
39
 
41
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
42
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
43
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
40
+ # The GPT image model to use for image generation. Specify a model explicitly.
41
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
42
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
44
43
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
45
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
46
- # specific to the GPT image models is used.
44
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
47
45
  attr_accessor model: OpenAI::Models::ImageGenerateParams::model?
48
46
 
49
47
  # Control the content-moderation level for images generated by the GPT image
@@ -51,8 +49,7 @@ module OpenAI
51
49
  # value).
52
50
  attr_accessor moderation: OpenAI::Models::ImageGenerateParams::moderation?
53
51
 
54
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
55
- # `n=1` is supported.
52
+ # The number of images to generate. Must be between 1 and 10.
56
53
  attr_accessor n: Integer?
57
54
 
58
55
  # The compression level (0-100%) for the generated images. This parameter is only
@@ -79,13 +76,9 @@ module OpenAI
79
76
  # - `high`, `medium` and `low` are supported for the GPT image models.
80
77
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
81
78
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
82
- # - `hd` and `standard` are supported for `dall-e-3`.
83
- # - `standard` is the only option for `dall-e-2`.
84
79
  attr_accessor quality: OpenAI::Models::ImageGenerateParams::quality?
85
80
 
86
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
87
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
88
- # after the image has been generated. This parameter isn't supported for the GPT
81
+ # Legacy response format parameter for retired image models. Unsupported for GPT
89
82
  # image models, which always return base64-encoded images.
90
83
  attr_accessor response_format: OpenAI::Models::ImageGenerateParams::response_format?
91
84
 
@@ -98,15 +91,11 @@ module OpenAI
98
91
  # the maximum supported resolution is `3840x2160`. The requested size must also
99
92
  # satisfy the model's current pixel and edge limits. The standard sizes
100
93
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
101
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
102
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
103
- # `1024x1024`, `1792x1024`, or `1024x1792`.
94
+ # `auto` is supported for models that allow automatic sizing.
104
95
  attr_accessor size: OpenAI::Models::ImageGenerateParams::size?
105
96
 
106
- # The style of the generated images. This parameter is only supported for
107
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
108
- # towards generating hyper-real and dramatic images. Natural causes the model to
109
- # produce more natural, less hyper-real looking images.
97
+ # Legacy style parameter for retired image models. Unsupported for GPT image
98
+ # models; describe the desired style in the prompt instead.
110
99
  attr_accessor style: OpenAI::Models::ImageGenerateParams::style?
111
100
 
112
101
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -121,8 +110,7 @@ module OpenAI
121
110
 
122
111
  # @param prompt
123
112
  # A text description of the desired image(s). The maximum length is 32000
124
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
125
- # characters for `dall-e-3`.
113
+ # characters.
126
114
  # @param background
127
115
  # Allows to set transparency for the background of the generated image(s). Must be
128
116
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
@@ -134,19 +122,17 @@ module OpenAI
134
122
  # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
135
123
  # set the output format to `png` or `webp`.
136
124
  # @param model
137
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
138
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
139
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
125
+ # The GPT image model to use for image generation. Specify a model explicitly.
126
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
127
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
140
128
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
141
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
142
- # specific to the GPT image models is used.
129
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
143
130
  # @param moderation
144
131
  # Control the content-moderation level for images generated by the GPT image
145
132
  # models. Must be either `low` for less restrictive filtering or `auto` (default
146
133
  # value).
147
134
  # @param n
148
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
149
- # `n=1` is supported.
135
+ # The number of images to generate. Must be between 1 and 10.
150
136
  # @param output_compression
151
137
  # The compression level (0-100%) for the generated images. This parameter is only
152
138
  # supported for the GPT image models with the `webp` or `jpeg` output formats, and
@@ -169,12 +155,8 @@ module OpenAI
169
155
  # - `high`, `medium` and `low` are supported for the GPT image models.
170
156
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
171
157
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
172
- # - `hd` and `standard` are supported for `dall-e-3`.
173
- # - `standard` is the only option for `dall-e-2`.
174
158
  # @param response_format
175
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
176
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
177
- # after the image has been generated. This parameter isn't supported for the GPT
159
+ # Legacy response format parameter for retired image models. Unsupported for GPT
178
160
  # image models, which always return base64-encoded images.
179
161
  # @param size
180
162
  # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
@@ -186,14 +168,10 @@ module OpenAI
186
168
  # the maximum supported resolution is `3840x2160`. The requested size must also
187
169
  # satisfy the model's current pixel and edge limits. The standard sizes
188
170
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
189
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
190
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
191
- # `1024x1024`, `1792x1024`, or `1024x1792`.
171
+ # `auto` is supported for models that allow automatic sizing.
192
172
  # @param style
193
- # The style of the generated images. This parameter is only supported for
194
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
195
- # towards generating hyper-real and dramatic images. Natural causes the model to
196
- # produce more natural, less hyper-real looking images.
173
+ # Legacy style parameter for retired image models. Unsupported for GPT image
174
+ # models; describe the desired style in the prompt instead.
197
175
  # @param user
198
176
  # A unique identifier representing your end-user, which can help OpenAI to monitor
199
177
  # and detect abuse.
@@ -276,19 +254,19 @@ module OpenAI
276
254
  end
277
255
 
278
256
  type quality =
279
- :standard | :hd | :low | :medium | :high | :xhigh | :max | :auto
257
+ :low | :medium | :high | :xhigh | :max | :auto | :standard | :hd
280
258
 
281
259
  module Quality
282
260
  extend OpenAI::Internal::Type::Enum
283
261
 
284
- STANDARD: :standard
285
- HD: :hd
286
262
  LOW: :low
287
263
  MEDIUM: :medium
288
264
  HIGH: :high
289
265
  XHIGH: :xhigh
290
266
  MAX: :max
291
267
  AUTO: :auto
268
+ STANDARD: :standard
269
+ HD: :hd
292
270
 
293
271
  def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::quality]
294
272
  end
@@ -1,15 +1,15 @@
1
1
  module OpenAI
2
2
  module Models
3
3
  type image_model =
4
- :"gpt-image-1"
5
- | :"gpt-image-1-mini"
4
+ :"gpt-image-1.5"
6
5
  | :"gpt-image-2"
7
6
  | :"gpt-image-2-2026-04-21"
8
7
  | :"gpt-image-2.5-sunburst"
9
8
  | :"gpt-image-2.5-sunburst-2026-09-08"
10
9
  | :"gpt-image-2.5-flare"
11
10
  | :"gpt-image-2.5-flare-2026-09-08"
12
- | :"gpt-image-1.5"
11
+ | :"gpt-image-1"
12
+ | :"gpt-image-1-mini"
13
13
  | :"chatgpt-image-latest"
14
14
  | :"dall-e-2"
15
15
  | :"dall-e-3"
@@ -17,15 +17,15 @@ module OpenAI
17
17
  module ImageModel
18
18
  extend OpenAI::Internal::Type::Enum
19
19
 
20
- GPT_IMAGE_1: :"gpt-image-1"
21
- GPT_IMAGE_1_MINI: :"gpt-image-1-mini"
20
+ GPT_IMAGE_1_5: :"gpt-image-1.5"
22
21
  GPT_IMAGE_2: :"gpt-image-2"
23
22
  GPT_IMAGE_2_2026_04_21: :"gpt-image-2-2026-04-21"
24
23
  GPT_IMAGE_2_5_SUNBURST: :"gpt-image-2.5-sunburst"
25
24
  GPT_IMAGE_2_5_SUNBURST_2026_09_08: :"gpt-image-2.5-sunburst-2026-09-08"
26
25
  GPT_IMAGE_2_5_FLARE: :"gpt-image-2.5-flare"
27
26
  GPT_IMAGE_2_5_FLARE_2026_09_08: :"gpt-image-2.5-flare-2026-09-08"
28
- GPT_IMAGE_1_5: :"gpt-image-1.5"
27
+ GPT_IMAGE_1: :"gpt-image-1"
28
+ GPT_IMAGE_1_MINI: :"gpt-image-1-mini"
29
29
  CHATGPT_IMAGE_LATEST: :"chatgpt-image-latest"
30
30
  DALL_E_2: :"dall-e-2"
31
31
  DALL_E_3: :"dall-e-3"
@@ -39,16 +39,18 @@ module OpenAI
39
39
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
40
40
  # `cedar`. You may also provide a custom voice object with an `id`, for example
41
41
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
42
- # model has responded with audio at least once. We recommend `marin` and `cedar`
43
- # for best quality.
42
+ # model has responded with audio at least once. Custom voices must be created from
43
+ # audio samples. Voices created from text prompts are supported only in Live. We
44
+ # recommend `marin` and `cedar` for best quality.
44
45
  attr_reader voice: OpenAI::Models::Realtime::RealtimeAudioConfigOutput::voice?
45
46
 
46
47
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
47
48
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
48
49
  # `cedar`. You may also provide a custom voice object with an `id`, for example
49
50
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
50
- # model has responded with audio at least once. We recommend `marin` and `cedar`
51
- # for best quality.
51
+ # model has responded with audio at least once. Custom voices must be created from
52
+ # audio samples. Voices created from text prompts are supported only in Live. We
53
+ # recommend `marin` and `cedar` for best quality.
52
54
  def voice=: (
53
55
  OpenAI::Models::Realtime::RealtimeAudioConfigOutput::voice
54
56
  ) -> OpenAI::Models::Realtime::RealtimeAudioConfigOutput::voice
@@ -68,8 +70,9 @@ module OpenAI
68
70
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
69
71
  # `cedar`. You may also provide a custom voice object with an `id`, for example
70
72
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
71
- # model has responded with audio at least once. We recommend `marin` and `cedar`
72
- # for best quality.
73
+ # model has responded with audio at least once. Custom voices must be created from
74
+ # audio samples. Voices created from text prompts are supported only in Live. We
75
+ # recommend `marin` and `cedar` for best quality.
73
76
  def initialize: (
74
77
  ?format_: OpenAI::Models::Realtime::realtime_audio_formats,
75
78
  ?speed: Float,
@@ -38,16 +38,18 @@ module OpenAI
38
38
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
39
39
  # `cedar`. You may also provide a custom voice object with an `id`, for example
40
40
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
41
- # model has responded with audio at least once. We recommend `marin` and `cedar`
42
- # for best quality.
41
+ # model has responded with audio at least once. Custom voices must be created from
42
+ # audio samples. Voices created from text prompts are supported only in Live. We
43
+ # recommend `marin` and `cedar` for best quality.
43
44
  attr_reader voice: OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::voice?
44
45
 
45
46
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
46
47
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
47
48
  # `cedar`. You may also provide a custom voice object with an `id`, for example
48
49
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
49
- # model has responded with audio at least once. We recommend `marin` and `cedar`
50
- # for best quality.
50
+ # model has responded with audio at least once. Custom voices must be created from
51
+ # audio samples. Voices created from text prompts are supported only in Live. We
52
+ # recommend `marin` and `cedar` for best quality.
51
53
  def voice=: (
52
54
  OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::voice
53
55
  ) -> OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::voice
@@ -59,8 +61,9 @@ module OpenAI
59
61
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
60
62
  # `cedar`. You may also provide a custom voice object with an `id`, for example
61
63
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
62
- # model has responded with audio at least once. We recommend `marin` and `cedar`
63
- # for best quality.
64
+ # model has responded with audio at least once. Custom voices must be created from
65
+ # audio samples. Voices created from text prompts are supported only in Live. We
66
+ # recommend `marin` and `cedar` for best quality.
64
67
  def initialize: (
65
68
  ?format_: OpenAI::Models::Realtime::realtime_audio_formats,
66
69
  ?voice: OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::voice
@@ -727,9 +727,7 @@ module OpenAI
727
727
  # the maximum supported resolution is `3840x2160`. The requested size must also
728
728
  # satisfy the model's current pixel and edge limits. The standard sizes
729
729
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
730
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
731
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
732
- # `1024x1024`, `1792x1024`, or `1024x1792`.
730
+ # `auto` is supported for models that allow automatic sizing.
733
731
  attr_reader size: OpenAI::Models::Responses::Tool::ImageGeneration::size?
734
732
 
735
733
  # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
@@ -741,9 +739,7 @@ module OpenAI
741
739
  # the maximum supported resolution is `3840x2160`. The requested size must also
742
740
  # satisfy the model's current pixel and edge limits. The standard sizes
743
741
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
744
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
745
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
746
- # `1024x1024`, `1792x1024`, or `1024x1792`.
742
+ # `auto` is supported for models that allow automatic sizing.
747
743
  def size=: (
748
744
  OpenAI::Models::Responses::Tool::ImageGeneration::size
749
745
  ) -> OpenAI::Models::Responses::Tool::ImageGeneration::size
@@ -798,9 +794,7 @@ module OpenAI
798
794
  # the maximum supported resolution is `3840x2160`. The requested size must also
799
795
  # satisfy the model's current pixel and edge limits. The standard sizes
800
796
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
801
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
802
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
803
- # `1024x1024`, `1792x1024`, or `1024x1792`.
797
+ # `auto` is supported for models that allow automatic sizing.
804
798
  # @param type
805
799
  # The type of the image generation tool. Always `image_generation`.
806
800
  def initialize: (
@@ -0,0 +1,114 @@
1
+ module OpenAI
2
+ module Models
3
+ module Webhooks
4
+ type agent_session_action_required_webhook_event =
5
+ {
6
+ id: String,
7
+ created_at: Integer,
8
+ data: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data,
9
+ ?object: :event,
10
+ ?type: :"agent.session.action_required"
11
+ }
12
+
13
+ class AgentSessionActionRequiredWebhookEvent < OpenAI::Internal::Type::BaseModel
14
+ # The unique ID of the event.
15
+ attr_accessor id: String
16
+
17
+ # The Unix timestamp, in seconds, when the event was created.
18
+ attr_accessor created_at: Integer
19
+
20
+ attr_accessor data: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data
21
+
22
+ # The object type. Always `event`.
23
+ attr_accessor object: :event
24
+
25
+ # The event type. Always `agent.session.action_required`.
26
+ attr_accessor type: :"agent.session.action_required"
27
+
28
+ # @param id
29
+ # The unique ID of the event.
30
+ # @param created_at
31
+ # The Unix timestamp, in seconds, when the event was created.
32
+ # @param object
33
+ # The object type. Always `event`.
34
+ # @param type
35
+ # The event type. Always `agent.session.action_required`.
36
+ def initialize: (
37
+ id: String,
38
+ created_at: Integer,
39
+ data: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data,
40
+ ?object: :event,
41
+ ?type: :"agent.session.action_required"
42
+ ) -> void
43
+
44
+ def to_hash: -> {
45
+ id: String,
46
+ created_at: Integer,
47
+ data: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data,
48
+ ?object: :event,
49
+ ?type: :"agent.session.action_required"
50
+ }
51
+
52
+ type data =
53
+ {
54
+ id: String,
55
+ required_action: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction
56
+ }
57
+
58
+ class Data < OpenAI::Internal::Type::BaseModel
59
+ # The ID of the session.
60
+ attr_accessor id: String
61
+
62
+ # The action type. Retrieve the session for action details.
63
+ attr_accessor required_action: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction
64
+
65
+ # @param id
66
+ # The ID of the session.
67
+ # @param required_action
68
+ # The action type. Retrieve the session for action details.
69
+ def initialize: (
70
+ id: String,
71
+ required_action: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction
72
+ ) -> void
73
+
74
+ def to_hash: -> {
75
+ id: String,
76
+ required_action: OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction
77
+ }
78
+
79
+ type required_action =
80
+ {
81
+ type: OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction::type_
82
+ }
83
+
84
+ class RequiredAction < OpenAI::Internal::Type::BaseModel
85
+ attr_accessor type: OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction::type_
86
+
87
+ def initialize: (
88
+ type: OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction::type_
89
+ ) -> void
90
+
91
+ def to_hash: -> {
92
+ type: OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction::type_
93
+ }
94
+
95
+ type type_ =
96
+ :computer_use_approval_request
97
+ | :function_call
98
+ | :environment_connection
99
+
100
+ module Type
101
+ extend OpenAI::Internal::Type::Enum
102
+
103
+ COMPUTER_USE_APPROVAL_REQUEST: :computer_use_approval_request
104
+ FUNCTION_CALL: :function_call
105
+ ENVIRONMENT_CONNECTION: :environment_connection
106
+
107
+ def self?.values: -> ::Array[OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent::Data::RequiredAction::type_]
108
+ end
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,115 @@
1
+ module OpenAI
2
+ module Models
3
+ module Webhooks
4
+ type agent_session_created_webhook_event =
5
+ {
6
+ id: String,
7
+ created_at: Integer,
8
+ data: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data,
9
+ ?object: :event,
10
+ ?type: :"agent.session.created"
11
+ }
12
+
13
+ class AgentSessionCreatedWebhookEvent < OpenAI::Internal::Type::BaseModel
14
+ # The unique ID of the event.
15
+ attr_accessor id: String
16
+
17
+ # The Unix timestamp, in seconds, when the event was created.
18
+ attr_accessor created_at: Integer
19
+
20
+ attr_accessor data: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data
21
+
22
+ # The object type. Always `event`.
23
+ attr_accessor object: :event
24
+
25
+ # The event type. Always `agent.session.created`.
26
+ attr_accessor type: :"agent.session.created"
27
+
28
+ # @param id
29
+ # The unique ID of the event.
30
+ # @param created_at
31
+ # The Unix timestamp, in seconds, when the event was created.
32
+ # @param object
33
+ # The object type. Always `event`.
34
+ # @param type
35
+ # The event type. Always `agent.session.created`.
36
+ def initialize: (
37
+ id: String,
38
+ created_at: Integer,
39
+ data: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data,
40
+ ?object: :event,
41
+ ?type: :"agent.session.created"
42
+ ) -> void
43
+
44
+ def to_hash: -> {
45
+ id: String,
46
+ created_at: Integer,
47
+ data: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data,
48
+ ?object: :event,
49
+ ?type: :"agent.session.created"
50
+ }
51
+
52
+ type data =
53
+ {
54
+ id: String,
55
+ environment_type: String,
56
+ ?connect: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect,
57
+ ?environment_id: String
58
+ }
59
+
60
+ class Data < OpenAI::Internal::Type::BaseModel
61
+ # The ID of the session.
62
+ attr_accessor id: String
63
+
64
+ # The environment type: `none`, `openai_hosted`, or `self_hosted`.
65
+ attr_accessor environment_type: String
66
+
67
+ attr_reader connect: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect?
68
+
69
+ def connect=: (
70
+ OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect
71
+ ) -> OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect
72
+
73
+ # The ID of the environment, when one exists.
74
+ attr_reader environment_id: String?
75
+
76
+ # The ID of the environment, when one exists.
77
+ def environment_id=: (String) -> String
78
+
79
+ # @param id
80
+ # The ID of the session.
81
+ # @param environment_type
82
+ # The environment type: `none`, `openai_hosted`, or `self_hosted`.
83
+ # @param environment_id
84
+ # The ID of the environment, when one exists.
85
+ def initialize: (
86
+ id: String,
87
+ environment_type: String,
88
+ ?connect: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect,
89
+ ?environment_id: String
90
+ ) -> void
91
+
92
+ def to_hash: -> {
93
+ id: String,
94
+ environment_type: String,
95
+ ?connect: OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect,
96
+ ?environment_id: String
97
+ }
98
+
99
+ type connect = { remote_url: String }
100
+
101
+ class Connect < OpenAI::Internal::Type::BaseModel
102
+ # The URL used to connect the self-hosted environment.
103
+ attr_accessor remote_url: String
104
+
105
+ # @param remote_url
106
+ # The URL used to connect the self-hosted environment.
107
+ def initialize: (remote_url: String) -> void
108
+
109
+ def to_hash: -> { remote_url: String }
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,89 @@
1
+ module OpenAI
2
+ module Models
3
+ module Webhooks
4
+ type agent_session_failed_webhook_event =
5
+ {
6
+ id: String,
7
+ created_at: Integer,
8
+ data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::Data,
9
+ ?object: :event,
10
+ ?type: :"agent.session.failed"
11
+ }
12
+
13
+ class AgentSessionFailedWebhookEvent < OpenAI::Internal::Type::BaseModel
14
+ # The unique ID of the event.
15
+ attr_accessor id: String
16
+
17
+ # The Unix timestamp, in seconds, when the event was created.
18
+ attr_accessor created_at: Integer
19
+
20
+ attr_accessor data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::Data
21
+
22
+ # The object type. Always `event`.
23
+ attr_accessor object: :event
24
+
25
+ # The event type. Always `agent.session.failed`.
26
+ attr_accessor type: :"agent.session.failed"
27
+
28
+ # @param id
29
+ # The unique ID of the event.
30
+ # @param created_at
31
+ # The Unix timestamp, in seconds, when the event was created.
32
+ # @param object
33
+ # The object type. Always `event`.
34
+ # @param type
35
+ # The event type. Always `agent.session.failed`.
36
+ def initialize: (
37
+ id: String,
38
+ created_at: Integer,
39
+ data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::Data,
40
+ ?object: :event,
41
+ ?type: :"agent.session.failed"
42
+ ) -> void
43
+
44
+ def to_hash: -> {
45
+ id: String,
46
+ created_at: Integer,
47
+ data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::Data,
48
+ ?object: :event,
49
+ ?type: :"agent.session.failed"
50
+ }
51
+
52
+ type data =
53
+ { id: String, environment_type: String, ?environment_id: String }
54
+
55
+ class Data < OpenAI::Internal::Type::BaseModel
56
+ # The ID of the session.
57
+ attr_accessor id: String
58
+
59
+ # The environment type: `none`, `openai_hosted`, or `self_hosted`.
60
+ attr_accessor environment_type: String
61
+
62
+ # The ID of the environment, when one exists.
63
+ attr_reader environment_id: String?
64
+
65
+ # The ID of the environment, when one exists.
66
+ def environment_id=: (String) -> String
67
+
68
+ # @param id
69
+ # The ID of the session.
70
+ # @param environment_type
71
+ # The environment type: `none`, `openai_hosted`, or `self_hosted`.
72
+ # @param environment_id
73
+ # The ID of the environment, when one exists.
74
+ def initialize: (
75
+ id: String,
76
+ environment_type: String,
77
+ ?environment_id: String
78
+ ) -> void
79
+
80
+ def to_hash: -> {
81
+ id: String,
82
+ environment_type: String,
83
+ ?environment_id: String
84
+ }
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end