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
@@ -4,7 +4,11 @@ module OpenAI
4
4
  module Resources
5
5
  # Given a prompt and/or an input image, the model will generate a new image.
6
6
  class Images
7
- # Creates a variation of a given image. This endpoint only supports `dall-e-2`.
7
+ # @deprecated
8
+ #
9
+ # This endpoint is retired and no longer available. Use the image edits endpoint
10
+ # with a GPT Image model and a prompt to create a variation of an image. The
11
+ # request and response schemas below describe the legacy contract.
8
12
  #
9
13
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
10
14
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
@@ -21,8 +25,8 @@ module OpenAI
21
25
  # content type.
22
26
  #
23
27
  # @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
24
- # The model to use for image generation. Only `dall-e-2` is supported at this
25
- # time.
28
+ # The legacy model used by the retired image variations endpoint. This endpoint no
29
+ # longer accepts requests.
26
30
  #
27
31
  # @param n [Integer, nil]
28
32
  # The number of images to generate. Must be between 1 and 10.
@@ -62,7 +66,7 @@ module OpenAI
62
66
  # See {OpenAI::Resources::Images#edit_stream_raw} for streaming counterpart.
63
67
  #
64
68
  # Creates an edited or extended image given one or more source images and a
65
- # prompt. This endpoint supports GPT Image models and `dall-e-2`.
69
+ # prompt. This endpoint supports GPT Image models.
66
70
  #
67
71
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
68
72
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
@@ -80,16 +84,13 @@ module OpenAI
80
84
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
81
85
  # images.
82
86
  #
83
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
84
- # file less than 4MB.
85
- #
86
87
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
87
88
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
88
89
  # content type.
89
90
  #
90
91
  # @param prompt [String]
91
- # A text description of the desired image(s). The maximum length is 1000
92
- # characters for `dall-e-2`, and 32000 characters for the GPT image models.
92
+ # A text description of the desired image(s). The maximum length is 32000
93
+ # characters for the GPT image models.
93
94
  #
94
95
  # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil]
95
96
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -118,12 +119,11 @@ module OpenAI
118
119
  # content type.
119
120
  #
120
121
  # @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
121
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
122
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
123
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
124
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
125
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
126
- # `gpt-image-1.5`.
122
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
123
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
124
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
125
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
126
+ # `chatgpt-image-latest`).
127
127
  #
128
128
  # @param n [Integer, nil]
129
129
  # The number of images to generate. Must be between 1 and 10.
@@ -153,24 +153,21 @@ module OpenAI
153
153
  # `xhigh` and `max`. Defaults to `auto`.
154
154
  #
155
155
  # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil]
156
- # The format in which the generated images are returned. Must be one of `url` or
157
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
158
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
159
- # `dall-e-2`), as GPT image models always return base64-encoded images.
156
+ # Legacy response format parameter for retired image models. Unsupported for GPT
157
+ # image models, which always return base64-encoded images.
160
158
  #
161
159
  # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil]
162
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
163
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
164
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
165
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
166
- # Width and height must both be divisible by 16 and the requested aspect ratio
167
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
168
- # the maximum supported resolution is `3840x2160`. The requested size must also
169
- # satisfy the model's current pixel and edge limits. The standard sizes
170
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
171
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
172
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
173
- # `1024x1024`, `1792x1024`, or `1024x1792`.
160
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
161
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
162
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
163
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
164
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
165
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
166
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
167
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
168
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
169
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
170
+ # models that allow automatic sizing.
174
171
  #
175
172
  # @param user [String]
176
173
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -203,7 +200,7 @@ module OpenAI
203
200
  # See {OpenAI::Resources::Images#edit} for non-streaming counterpart.
204
201
  #
205
202
  # Creates an edited or extended image given one or more source images and a
206
- # prompt. This endpoint supports GPT Image models and `dall-e-2`.
203
+ # prompt. This endpoint supports GPT Image models.
207
204
  #
208
205
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
209
206
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
@@ -221,16 +218,13 @@ module OpenAI
221
218
  # be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
222
219
  # images.
223
220
  #
224
- # For `dall-e-2`, you can only provide one image, and it should be a square `png`
225
- # file less than 4MB.
226
- #
227
221
  # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
228
222
  # metadata. Use `OpenAI::FilePart` when you need to override the filename or
229
223
  # content type.
230
224
  #
231
225
  # @param prompt [String]
232
- # A text description of the desired image(s). The maximum length is 1000
233
- # characters for `dall-e-2`, and 32000 characters for the GPT image models.
226
+ # A text description of the desired image(s). The maximum length is 32000
227
+ # characters for the GPT image models.
234
228
  #
235
229
  # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil]
236
230
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -259,12 +253,11 @@ module OpenAI
259
253
  # content type.
260
254
  #
261
255
  # @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
262
- # The model to use for image generation. One of `dall-e-2` or a GPT image model
263
- # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
264
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
265
- # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
266
- # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to
267
- # `gpt-image-1.5`.
256
+ # The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
257
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
258
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
259
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
260
+ # `chatgpt-image-latest`).
268
261
  #
269
262
  # @param n [Integer, nil]
270
263
  # The number of images to generate. Must be between 1 and 10.
@@ -294,24 +287,21 @@ module OpenAI
294
287
  # `xhigh` and `max`. Defaults to `auto`.
295
288
  #
296
289
  # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil]
297
- # The format in which the generated images are returned. Must be one of `url` or
298
- # `b64_json`. URLs are only valid for 60 minutes after the image has been
299
- # generated. This parameter is only supported for `dall-e-2` (default is `url` for
300
- # `dall-e-2`), as GPT image models always return base64-encoded images.
290
+ # Legacy response format parameter for retired image models. Unsupported for GPT
291
+ # image models, which always return base64-encoded images.
301
292
  #
302
293
  # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil]
303
- # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
304
- # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
305
- # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
306
- # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
307
- # Width and height must both be divisible by 16 and the requested aspect ratio
308
- # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
309
- # the maximum supported resolution is `3840x2160`. The requested size must also
310
- # satisfy the model's current pixel and edge limits. The standard sizes
311
- # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
312
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
313
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
314
- # `1024x1024`, `1792x1024`, or `1024x1792`.
294
+ # The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
295
+ # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
296
+ # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
297
+ # `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
298
+ # `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
299
+ # divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
300
+ # Resolutions above `2560x1440` are experimental, and the maximum supported
301
+ # resolution is `3840x2160`. The requested size must also satisfy the model's
302
+ # current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
303
+ # `1024x1536` are supported by the GPT image models; `auto` is supported for
304
+ # models that allow automatic sizing.
315
305
  #
316
306
  # @param user [String]
317
307
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -349,15 +339,14 @@ module OpenAI
349
339
 
350
340
  # See {OpenAI::Resources::Images#generate_stream_raw} for streaming counterpart.
351
341
  #
352
- # Creates an image given a prompt.
342
+ # Creates an image given a prompt using a GPT Image model.
353
343
  # [Learn more](https://developers.openai.com/api/docs/guides/images-vision).
354
344
  #
355
345
  # @overload generate(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {})
356
346
  #
357
347
  # @param prompt [String]
358
348
  # A text description of the desired image(s). The maximum length is 32000
359
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
360
- # characters for `dall-e-3`.
349
+ # characters.
361
350
  #
362
351
  # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil]
363
352
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -371,12 +360,11 @@ module OpenAI
371
360
  # set the output format to `png` or `webp`.
372
361
  #
373
362
  # @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
374
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
375
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
376
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
363
+ # The GPT image model to use for image generation. Specify a model explicitly.
364
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
365
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
377
366
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
378
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
379
- # specific to the GPT image models is used.
367
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
380
368
  #
381
369
  # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil]
382
370
  # Control the content-moderation level for images generated by the GPT image
@@ -384,8 +372,7 @@ module OpenAI
384
372
  # value).
385
373
  #
386
374
  # @param n [Integer, nil]
387
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
388
- # `n=1` is supported.
375
+ # The number of images to generate. Must be between 1 and 10.
389
376
  #
390
377
  # @param output_compression [Integer, nil]
391
378
  # The compression level (0-100%) for the generated images. This parameter is only
@@ -412,13 +399,9 @@ module OpenAI
412
399
  # - `high`, `medium` and `low` are supported for the GPT image models.
413
400
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
414
401
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
415
- # - `hd` and `standard` are supported for `dall-e-3`.
416
- # - `standard` is the only option for `dall-e-2`.
417
402
  #
418
403
  # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil]
419
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
420
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
421
- # after the image has been generated. This parameter isn't supported for the GPT
404
+ # Legacy response format parameter for retired image models. Unsupported for GPT
422
405
  # image models, which always return base64-encoded images.
423
406
  #
424
407
  # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
@@ -431,15 +414,11 @@ module OpenAI
431
414
  # the maximum supported resolution is `3840x2160`. The requested size must also
432
415
  # satisfy the model's current pixel and edge limits. The standard sizes
433
416
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
434
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
435
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
436
- # `1024x1024`, `1792x1024`, or `1024x1792`.
417
+ # `auto` is supported for models that allow automatic sizing.
437
418
  #
438
419
  # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil]
439
- # The style of the generated images. This parameter is only supported for
440
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
441
- # towards generating hyper-real and dramatic images. Natural causes the model to
442
- # produce more natural, less hyper-real looking images.
420
+ # Legacy style parameter for retired image models. Unsupported for GPT image
421
+ # models; describe the desired style in the prompt instead.
443
422
  #
444
423
  # @param user [String]
445
424
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -470,15 +449,14 @@ module OpenAI
470
449
 
471
450
  # See {OpenAI::Resources::Images#generate} for non-streaming counterpart.
472
451
  #
473
- # Creates an image given a prompt.
452
+ # Creates an image given a prompt using a GPT Image model.
474
453
  # [Learn more](https://developers.openai.com/api/docs/guides/images-vision).
475
454
  #
476
455
  # @overload generate_stream_raw(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {})
477
456
  #
478
457
  # @param prompt [String]
479
458
  # A text description of the desired image(s). The maximum length is 32000
480
- # characters for the GPT image models, 1000 characters for `dall-e-2` and 4000
481
- # characters for `dall-e-3`.
459
+ # characters.
482
460
  #
483
461
  # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil]
484
462
  # Allows to set transparency for the background of the generated image(s). Must be
@@ -492,12 +470,11 @@ module OpenAI
492
470
  # set the output format to `png` or `webp`.
493
471
  #
494
472
  # @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
495
- # The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT
496
- # image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
497
- # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
473
+ # The GPT image model to use for image generation. Specify a model explicitly.
474
+ # Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
475
+ # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
498
476
  # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
499
- # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter
500
- # specific to the GPT image models is used.
477
+ # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
501
478
  #
502
479
  # @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil]
503
480
  # Control the content-moderation level for images generated by the GPT image
@@ -505,8 +482,7 @@ module OpenAI
505
482
  # value).
506
483
  #
507
484
  # @param n [Integer, nil]
508
- # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only
509
- # `n=1` is supported.
485
+ # The number of images to generate. Must be between 1 and 10.
510
486
  #
511
487
  # @param output_compression [Integer, nil]
512
488
  # The compression level (0-100%) for the generated images. This parameter is only
@@ -533,13 +509,9 @@ module OpenAI
533
509
  # - `high`, `medium` and `low` are supported for the GPT image models.
534
510
  # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
535
511
  # `2026-09-08` snapshots, also support `xhigh` and `max`.
536
- # - `hd` and `standard` are supported for `dall-e-3`.
537
- # - `standard` is the only option for `dall-e-2`.
538
512
  #
539
513
  # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil]
540
- # The format in which generated images with `dall-e-2` and `dall-e-3` are
541
- # returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
542
- # after the image has been generated. This parameter isn't supported for the GPT
514
+ # Legacy response format parameter for retired image models. Unsupported for GPT
543
515
  # image models, which always return base64-encoded images.
544
516
  #
545
517
  # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
@@ -552,15 +524,11 @@ module OpenAI
552
524
  # the maximum supported resolution is `3840x2160`. The requested size must also
553
525
  # satisfy the model's current pixel and edge limits. The standard sizes
554
526
  # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
555
- # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
556
- # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
557
- # `1024x1024`, `1792x1024`, or `1024x1792`.
527
+ # `auto` is supported for models that allow automatic sizing.
558
528
  #
559
529
  # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil]
560
- # The style of the generated images. This parameter is only supported for
561
- # `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean
562
- # towards generating hyper-real and dramatic images. Natural causes the model to
563
- # produce more natural, less hyper-real looking images.
530
+ # Legacy style parameter for retired image models. Unsupported for GPT image
531
+ # models; describe the desired style in the prompt instead.
564
532
  #
565
533
  # @param user [String]
566
534
  # A unique identifier representing your end-user, which can help OpenAI to monitor
@@ -203,7 +203,7 @@ module OpenAI
203
203
  # @param headers [Hash] The webhook headers
204
204
  # @param webhook_secret [String, nil] The webhook secret (optional, will use client webhook secret or ENV["OPENAI_WEBHOOK_SECRET"] if not provided)
205
205
  #
206
- # @return [OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent, OpenAI::Models::Webhooks::LiveTransportIncomingWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent, OpenAI::Models::Webhooks::SafetyAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyDeactivationIssuedWebhookEvent, OpenAI::Models::Webhooks::SafetyOrgAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyWarningIssuedWebhookEvent]
206
+ # @return [OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent, OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent, OpenAI::Models::Webhooks::AgentSessionFailedWebhookEvent, OpenAI::Models::Webhooks::AgentSessionIdleWebhookEvent, OpenAI::Models::Webhooks::AgentSessionInProgressWebhookEvent, OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent, OpenAI::Models::Webhooks::LiveTransportIncomingWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent, OpenAI::Models::Webhooks::SafetyAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyDeactivationIssuedWebhookEvent, OpenAI::Models::Webhooks::SafetyOrgAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyWarningIssuedWebhookEvent]
207
207
  #
208
208
  # @raise [ArgumentError] if signature verification fails
209
209
  def unwrap(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.98.0"
4
+ VERSION = "0.99.0"
5
5
  end
data/lib/openai.rb CHANGED
@@ -454,6 +454,8 @@ require_relative "openai/models/audio/translation"
454
454
  require_relative "openai/models/audio/translation_create_params"
455
455
  require_relative "openai/models/audio/translation_create_response"
456
456
  require_relative "openai/models/audio/translation_verbose"
457
+ require_relative "openai/models/audio/voice"
458
+ require_relative "openai/models/audio/voice_create_params"
457
459
  require_relative "openai/models/audio_model"
458
460
  require_relative "openai/models/audio_response_format"
459
461
  require_relative "openai/models/auto_file_chunking_strategy_param"
@@ -1435,6 +1437,11 @@ require_relative "openai/models/video_remix_params"
1435
1437
  require_relative "openai/models/video_retrieve_params"
1436
1438
  require_relative "openai/models/video_seconds"
1437
1439
  require_relative "openai/models/video_size"
1440
+ require_relative "openai/models/webhooks/agent_session_action_required_webhook_event"
1441
+ require_relative "openai/models/webhooks/agent_session_created_webhook_event"
1442
+ require_relative "openai/models/webhooks/agent_session_failed_webhook_event"
1443
+ require_relative "openai/models/webhooks/agent_session_idle_webhook_event"
1444
+ require_relative "openai/models/webhooks/agent_session_in_progress_webhook_event"
1438
1445
  require_relative "openai/models/webhooks/batch_cancelled_webhook_event"
1439
1446
  require_relative "openai/models/webhooks/batch_completed_webhook_event"
1440
1447
  require_relative "openai/models/webhooks/batch_expired_webhook_event"
@@ -1510,6 +1517,7 @@ require_relative "openai/resources/audio"
1510
1517
  require_relative "openai/resources/audio/speech"
1511
1518
  require_relative "openai/resources/audio/transcriptions"
1512
1519
  require_relative "openai/resources/audio/translations"
1520
+ require_relative "openai/resources/audio/voices"
1513
1521
  require_relative "openai/resources/batches"
1514
1522
  require_relative "openai/resources/beta"
1515
1523
  require_relative "openai/resources/beta/agents"
@@ -206,7 +206,16 @@ module OpenAI
206
206
  sig { params(input_audio_tokens: Integer).void }
207
207
  attr_writer :input_audio_tokens
208
208
 
209
- # The aggregated number of input tokens written to the cache.
209
+ # The aggregated number of input tokens written to the cache with a 12-hour
210
+ # retention period.
211
+ sig { returns(T.nilable(Integer)) }
212
+ attr_reader :input_cache_write_12h_tokens
213
+
214
+ sig { params(input_cache_write_12h_tokens: Integer).void }
215
+ attr_writer :input_cache_write_12h_tokens
216
+
217
+ # The aggregated number of input tokens written to the cache with a 30-minute
218
+ # retention period.
210
219
  sig { returns(T.nilable(Integer)) }
211
220
  attr_reader :input_cache_write_tokens
212
221
 
@@ -322,6 +331,8 @@ module OpenAI
322
331
 
323
332
  input_audio_tokens: Integer,
324
333
 
334
+ input_cache_write_12h_tokens: Integer,
335
+
325
336
  input_cache_write_tokens: Integer,
326
337
 
327
338
  input_cached_audio_tokens: Integer,
@@ -382,7 +393,12 @@ module OpenAI
382
393
  # The aggregated number of uncached audio input tokens used.
383
394
  input_audio_tokens: nil,
384
395
 
385
- # The aggregated number of input tokens written to the cache.
396
+ # The aggregated number of input tokens written to the cache with a 12-hour
397
+ # retention period.
398
+ input_cache_write_12h_tokens: nil,
399
+
400
+ # The aggregated number of input tokens written to the cache with a 30-minute
401
+ # retention period.
386
402
  input_cache_write_tokens: nil,
387
403
 
388
404
  # The aggregated number of cached audio input tokens used.
@@ -448,6 +464,7 @@ module OpenAI
448
464
  api_key_id: T.nilable(String),
449
465
  batch: T.nilable(T::Boolean),
450
466
  input_audio_tokens: Integer,
467
+ input_cache_write_12h_tokens: Integer,
451
468
  input_cache_write_tokens: Integer,
452
469
  input_cached_audio_tokens: Integer,
453
470
  input_cached_image_tokens: Integer,
@@ -208,7 +208,16 @@ module OpenAI
208
208
  sig { params(input_audio_tokens: Integer).void }
209
209
  attr_writer :input_audio_tokens
210
210
 
211
- # The aggregated number of input tokens written to the cache.
211
+ # The aggregated number of input tokens written to the cache with a 12-hour
212
+ # retention period.
213
+ sig { returns(T.nilable(Integer)) }
214
+ attr_reader :input_cache_write_12h_tokens
215
+
216
+ sig { params(input_cache_write_12h_tokens: Integer).void }
217
+ attr_writer :input_cache_write_12h_tokens
218
+
219
+ # The aggregated number of input tokens written to the cache with a 30-minute
220
+ # retention period.
212
221
  sig { returns(T.nilable(Integer)) }
213
222
  attr_reader :input_cache_write_tokens
214
223
 
@@ -324,6 +333,8 @@ module OpenAI
324
333
 
325
334
  input_audio_tokens: Integer,
326
335
 
336
+ input_cache_write_12h_tokens: Integer,
337
+
327
338
  input_cache_write_tokens: Integer,
328
339
 
329
340
  input_cached_audio_tokens: Integer,
@@ -384,7 +395,12 @@ module OpenAI
384
395
  # The aggregated number of uncached audio input tokens used.
385
396
  input_audio_tokens: nil,
386
397
 
387
- # The aggregated number of input tokens written to the cache.
398
+ # The aggregated number of input tokens written to the cache with a 12-hour
399
+ # retention period.
400
+ input_cache_write_12h_tokens: nil,
401
+
402
+ # The aggregated number of input tokens written to the cache with a 30-minute
403
+ # retention period.
388
404
  input_cache_write_tokens: nil,
389
405
 
390
406
  # The aggregated number of cached audio input tokens used.
@@ -450,6 +466,7 @@ module OpenAI
450
466
  api_key_id: T.nilable(String),
451
467
  batch: T.nilable(T::Boolean),
452
468
  input_audio_tokens: Integer,
469
+ input_cache_write_12h_tokens: Integer,
453
470
  input_cache_write_tokens: Integer,
454
471
  input_cached_audio_tokens: Integer,
455
472
  input_cached_image_tokens: Integer,
@@ -210,7 +210,16 @@ module OpenAI
210
210
  sig { params(input_audio_tokens: Integer).void }
211
211
  attr_writer :input_audio_tokens
212
212
 
213
- # The aggregated number of input tokens written to the cache.
213
+ # The aggregated number of input tokens written to the cache with a 12-hour
214
+ # retention period.
215
+ sig { returns(T.nilable(Integer)) }
216
+ attr_reader :input_cache_write_12h_tokens
217
+
218
+ sig { params(input_cache_write_12h_tokens: Integer).void }
219
+ attr_writer :input_cache_write_12h_tokens
220
+
221
+ # The aggregated number of input tokens written to the cache with a 30-minute
222
+ # retention period.
214
223
  sig { returns(T.nilable(Integer)) }
215
224
  attr_reader :input_cache_write_tokens
216
225
 
@@ -326,6 +335,8 @@ module OpenAI
326
335
 
327
336
  input_audio_tokens: Integer,
328
337
 
338
+ input_cache_write_12h_tokens: Integer,
339
+
329
340
  input_cache_write_tokens: Integer,
330
341
 
331
342
  input_cached_audio_tokens: Integer,
@@ -386,7 +397,12 @@ module OpenAI
386
397
  # The aggregated number of uncached audio input tokens used.
387
398
  input_audio_tokens: nil,
388
399
 
389
- # The aggregated number of input tokens written to the cache.
400
+ # The aggregated number of input tokens written to the cache with a 12-hour
401
+ # retention period.
402
+ input_cache_write_12h_tokens: nil,
403
+
404
+ # The aggregated number of input tokens written to the cache with a 30-minute
405
+ # retention period.
390
406
  input_cache_write_tokens: nil,
391
407
 
392
408
  # The aggregated number of cached audio input tokens used.
@@ -452,6 +468,7 @@ module OpenAI
452
468
  api_key_id: T.nilable(String),
453
469
  batch: T.nilable(T::Boolean),
454
470
  input_audio_tokens: Integer,
471
+ input_cache_write_12h_tokens: Integer,
455
472
  input_cache_write_tokens: Integer,
456
473
  input_cached_audio_tokens: Integer,
457
474
  input_cached_image_tokens: Integer,
@@ -206,7 +206,16 @@ module OpenAI
206
206
  sig { params(input_audio_tokens: Integer).void }
207
207
  attr_writer :input_audio_tokens
208
208
 
209
- # The aggregated number of input tokens written to the cache.
209
+ # The aggregated number of input tokens written to the cache with a 12-hour
210
+ # retention period.
211
+ sig { returns(T.nilable(Integer)) }
212
+ attr_reader :input_cache_write_12h_tokens
213
+
214
+ sig { params(input_cache_write_12h_tokens: Integer).void }
215
+ attr_writer :input_cache_write_12h_tokens
216
+
217
+ # The aggregated number of input tokens written to the cache with a 30-minute
218
+ # retention period.
210
219
  sig { returns(T.nilable(Integer)) }
211
220
  attr_reader :input_cache_write_tokens
212
221
 
@@ -322,6 +331,8 @@ module OpenAI
322
331
 
323
332
  input_audio_tokens: Integer,
324
333
 
334
+ input_cache_write_12h_tokens: Integer,
335
+
325
336
  input_cache_write_tokens: Integer,
326
337
 
327
338
  input_cached_audio_tokens: Integer,
@@ -382,7 +393,12 @@ module OpenAI
382
393
  # The aggregated number of uncached audio input tokens used.
383
394
  input_audio_tokens: nil,
384
395
 
385
- # The aggregated number of input tokens written to the cache.
396
+ # The aggregated number of input tokens written to the cache with a 12-hour
397
+ # retention period.
398
+ input_cache_write_12h_tokens: nil,
399
+
400
+ # The aggregated number of input tokens written to the cache with a 30-minute
401
+ # retention period.
386
402
  input_cache_write_tokens: nil,
387
403
 
388
404
  # The aggregated number of cached audio input tokens used.
@@ -448,6 +464,7 @@ module OpenAI
448
464
  api_key_id: T.nilable(String),
449
465
  batch: T.nilable(T::Boolean),
450
466
  input_audio_tokens: Integer,
467
+ input_cache_write_12h_tokens: Integer,
451
468
  input_cache_write_tokens: Integer,
452
469
  input_cached_audio_tokens: Integer,
453
470
  input_cached_image_tokens: Integer,
@@ -202,7 +202,16 @@ module OpenAI
202
202
  sig { params(input_audio_tokens: Integer).void }
203
203
  attr_writer :input_audio_tokens
204
204
 
205
- # The aggregated number of input tokens written to the cache.
205
+ # The aggregated number of input tokens written to the cache with a 12-hour
206
+ # retention period.
207
+ sig { returns(T.nilable(Integer)) }
208
+ attr_reader :input_cache_write_12h_tokens
209
+
210
+ sig { params(input_cache_write_12h_tokens: Integer).void }
211
+ attr_writer :input_cache_write_12h_tokens
212
+
213
+ # The aggregated number of input tokens written to the cache with a 30-minute
214
+ # retention period.
206
215
  sig { returns(T.nilable(Integer)) }
207
216
  attr_reader :input_cache_write_tokens
208
217
 
@@ -318,6 +327,8 @@ module OpenAI
318
327
 
319
328
  input_audio_tokens: Integer,
320
329
 
330
+ input_cache_write_12h_tokens: Integer,
331
+
321
332
  input_cache_write_tokens: Integer,
322
333
 
323
334
  input_cached_audio_tokens: Integer,
@@ -378,7 +389,12 @@ module OpenAI
378
389
  # The aggregated number of uncached audio input tokens used.
379
390
  input_audio_tokens: nil,
380
391
 
381
- # The aggregated number of input tokens written to the cache.
392
+ # The aggregated number of input tokens written to the cache with a 12-hour
393
+ # retention period.
394
+ input_cache_write_12h_tokens: nil,
395
+
396
+ # The aggregated number of input tokens written to the cache with a 30-minute
397
+ # retention period.
382
398
  input_cache_write_tokens: nil,
383
399
 
384
400
  # The aggregated number of cached audio input tokens used.
@@ -444,6 +460,7 @@ module OpenAI
444
460
  api_key_id: T.nilable(String),
445
461
  batch: T.nilable(T::Boolean),
446
462
  input_audio_tokens: Integer,
463
+ input_cache_write_12h_tokens: Integer,
447
464
  input_cache_write_tokens: Integer,
448
465
  input_cached_audio_tokens: Integer,
449
466
  input_cached_image_tokens: Integer,