openai 0.106.0 → 0.108.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 (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +74 -0
  3. data/README.md +49 -1
  4. data/examples/chat/tool_runner.rb +33 -0
  5. data/lib/openai/client.rb +2 -2
  6. data/lib/openai/helpers/chat/tool_runner.rb +259 -0
  7. data/lib/openai/helpers/live/websocket.rb +12 -141
  8. data/lib/openai/helpers/local_audio/process.rb +13 -3
  9. data/lib/openai/helpers/models/embedding.rb +42 -0
  10. data/lib/openai/helpers/realtime/connection.rb +22 -5
  11. data/lib/openai/helpers/realtime/recovery.rb +19 -7
  12. data/lib/openai/helpers/realtime/translation.rb +37 -169
  13. data/lib/openai/helpers/realtime/unknown_server_event.rb +5 -12
  14. data/lib/openai/helpers/responses_websocket/connection.rb +56 -35
  15. data/lib/openai/helpers/responses_websocket/incremental.rb +5 -1
  16. data/lib/openai/helpers/responses_websocket/session.rb +11 -4
  17. data/lib/openai/helpers/responses_websocket/unknown_server_event.rb +2 -14
  18. data/lib/openai/helpers/streaming/chat_completion_resource.rb +52 -0
  19. data/lib/openai/helpers/websocket/async_websocket_transport.rb +8 -6
  20. data/lib/openai/helpers/websocket/client_request.rb +1 -1
  21. data/lib/openai/helpers/websocket/connection.rb +21 -10
  22. data/lib/openai/helpers/websocket/connection_manager.rb +2 -1
  23. data/lib/openai/helpers/websocket/protocol.rb +160 -0
  24. data/lib/openai/helpers/websocket/typed_connection.rb +22 -16
  25. data/lib/openai/helpers/websocket/typed_resource.rb +15 -0
  26. data/lib/openai/internal/transport/base_client.rb +1 -1
  27. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -5
  28. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -5
  29. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -5
  30. data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -5
  31. data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -5
  32. data/lib/openai/models/admin/organization/usage_decisions_response.rb +14 -3
  33. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -5
  34. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -5
  35. data/lib/openai/models/admin/organization/usage_images_response.rb +16 -5
  36. data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -5
  37. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -5
  38. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -5
  39. data/lib/openai/models/audio/voice_consent.rb +58 -0
  40. data/lib/openai/models/audio/voice_consent_create_params.rb +57 -0
  41. data/lib/openai/models/audio/voice_consent_delete_params.rb +22 -0
  42. data/lib/openai/models/audio/voice_consent_deleted.rb +34 -0
  43. data/lib/openai/models/audio/voice_consent_list_params.rb +42 -0
  44. data/lib/openai/models/audio/voice_consent_retrieve_params.rb +22 -0
  45. data/lib/openai/models/audio/voice_consent_update_params.rb +32 -0
  46. data/lib/openai/models/beta/beta_response_input_item.rb +10 -1
  47. data/lib/openai/models/responses/response_input_item.rb +10 -1
  48. data/lib/openai/resources/audio/voice_consents.rb +163 -0
  49. data/lib/openai/resources/audio.rb +5 -0
  50. data/lib/openai/version.rb +1 -1
  51. data/lib/openai.rb +9 -0
  52. data/rbi/openai/client.rbi +1 -8
  53. data/rbi/openai/helpers/chat/tool_runner.rbi +74 -0
  54. data/rbi/openai/helpers/realtime/translation.rbi +0 -5
  55. data/rbi/openai/helpers/realtime/unknown_server_event.rbi +6 -0
  56. data/rbi/openai/helpers/websocket.rbi +44 -6
  57. data/rbi/openai/internal/transport/base_client.rbi +2 -6
  58. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +14 -2
  59. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +14 -2
  60. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +14 -2
  61. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +14 -2
  62. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +14 -2
  63. data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +12 -0
  64. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +14 -2
  65. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +14 -2
  66. data/rbi/openai/models/admin/organization/usage_images_response.rbi +14 -2
  67. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +14 -2
  68. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +14 -2
  69. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +14 -2
  70. data/rbi/openai/models/audio/voice_consent.rbi +86 -0
  71. data/rbi/openai/models/audio/voice_consent_create_params.rbi +92 -0
  72. data/rbi/openai/models/audio/voice_consent_delete_params.rbi +53 -0
  73. data/rbi/openai/models/audio/voice_consent_deleted.rbi +62 -0
  74. data/rbi/openai/models/audio/voice_consent_list_params.rbi +78 -0
  75. data/rbi/openai/models/audio/voice_consent_retrieve_params.rbi +53 -0
  76. data/rbi/openai/models/audio/voice_consent_update_params.rbi +62 -0
  77. data/rbi/openai/models/beta/beta_response_input_item.rbi +14 -1
  78. data/rbi/openai/models/response_format_json_schema.rbi +13 -11
  79. data/rbi/openai/models/responses/response_input_item.rbi +10 -1
  80. data/rbi/openai/resources/audio/voice_consents.rbi +108 -0
  81. data/rbi/openai/resources/audio.rbi +4 -0
  82. data/realtime.md +22 -3
  83. data/sig/openai/client.rbs +1 -1
  84. data/sig/openai/helpers/chat/tool_runner.rbs +48 -0
  85. data/sig/openai/helpers/realtime/translation.rbs +0 -2
  86. data/sig/openai/helpers/realtime/unknown_server_event.rbs +2 -0
  87. data/sig/openai/helpers/websocket.rbs +23 -6
  88. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +15 -5
  89. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +15 -5
  90. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +15 -5
  91. data/sig/openai/models/admin/organization/usage_completions_response.rbs +15 -5
  92. data/sig/openai/models/admin/organization/usage_costs_response.rbs +15 -5
  93. data/sig/openai/models/admin/organization/usage_decisions_response.rbs +11 -1
  94. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +15 -5
  95. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +15 -5
  96. data/sig/openai/models/admin/organization/usage_images_response.rbs +15 -5
  97. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +15 -5
  98. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +15 -5
  99. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +15 -5
  100. data/sig/openai/models/audio/voice_consent.rbs +57 -0
  101. data/sig/openai/models/audio/voice_consent_create_params.rbs +61 -0
  102. data/sig/openai/models/audio/voice_consent_delete_params.rbs +25 -0
  103. data/sig/openai/models/audio/voice_consent_deleted.rbs +31 -0
  104. data/sig/openai/models/audio/voice_consent_list_params.rbs +57 -0
  105. data/sig/openai/models/audio/voice_consent_retrieve_params.rbs +25 -0
  106. data/sig/openai/models/audio/voice_consent_update_params.rbs +36 -0
  107. data/sig/openai/models/beta/beta_response_input_item.rbs +8 -0
  108. data/sig/openai/models/responses/response_input_item.rbs +8 -3
  109. data/sig/openai/resources/audio/voice_consents.rbs +38 -0
  110. data/sig/openai/resources/audio.rbs +2 -0
  111. metadata +31 -1
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -75,6 +75,7 @@ module OpenAI
75
75
  ?batch: bool?,
76
76
  ?input_audio_tokens: Integer?,
77
77
  ?:input_cache_write_12h_tokens => Integer?,
78
+ ?:input_cache_write_30m_tokens => Integer?,
78
79
  ?input_cache_write_tokens: Integer?,
79
80
  ?input_cached_audio_tokens: Integer?,
80
81
  ?input_cached_image_tokens: Integer?,
@@ -131,6 +132,10 @@ module OpenAI
131
132
 
132
133
  # The aggregated number of input tokens written to the cache with a 30-minute
133
134
  # retention period.
135
+ attr_accessor input_cache_write_30m_tokens: Integer?
136
+
137
+ # The aggregated number of input tokens written to the cache across 30-minute and
138
+ # 12-hour retention periods.
134
139
  attr_accessor input_cache_write_tokens: Integer?
135
140
 
136
141
  # The aggregated number of cached audio input tokens used.
@@ -208,9 +213,12 @@ module OpenAI
208
213
  # @param input_cache_write_12h_tokens
209
214
  # The aggregated number of input tokens written to the cache with a 12-hour
210
215
  # retention period.
211
- # @param input_cache_write_tokens
216
+ # @param input_cache_write_30m_tokens
212
217
  # The aggregated number of input tokens written to the cache with a 30-minute
213
218
  # retention period.
219
+ # @param input_cache_write_tokens
220
+ # The aggregated number of input tokens written to the cache across 30-minute and
221
+ # 12-hour retention periods.
214
222
  # @param input_cached_audio_tokens
215
223
  # The aggregated number of cached audio input tokens used.
216
224
  # @param input_cached_image_tokens
@@ -255,6 +263,7 @@ module OpenAI
255
263
  ?batch: bool?,
256
264
  ?input_audio_tokens: Integer?,
257
265
  ?input_cache_write_12h_tokens: Integer?,
266
+ ?input_cache_write_30m_tokens: Integer?,
258
267
  ?input_cache_write_tokens: Integer?,
259
268
  ?input_cached_audio_tokens: Integer?,
260
269
  ?input_cached_image_tokens: Integer?,
@@ -283,6 +292,7 @@ module OpenAI
283
292
  ?batch: bool?,
284
293
  ?input_audio_tokens: Integer?,
285
294
  ?:input_cache_write_12h_tokens => Integer?,
295
+ ?:input_cache_write_30m_tokens => Integer?,
286
296
  ?input_cache_write_tokens: Integer?,
287
297
  ?input_cached_audio_tokens: Integer?,
288
298
  ?input_cached_image_tokens: Integer?,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,
@@ -91,6 +91,7 @@ module OpenAI
91
91
  ?batch: bool?,
92
92
  ?input_audio_tokens: Integer,
93
93
  ?:input_cache_write_12h_tokens => Integer,
94
+ ?:input_cache_write_30m_tokens => Integer?,
94
95
  ?input_cache_write_tokens: Integer,
95
96
  ?input_cached_audio_tokens: Integer,
96
97
  ?input_cached_image_tokens: Integer,
@@ -153,11 +154,15 @@ module OpenAI
153
154
  def input_cache_write_12h_tokens=: (Integer) -> Integer
154
155
 
155
156
  # The aggregated number of input tokens written to the cache with a 30-minute
156
- # retention period.
157
+ # retention period. May be absent or null for older responses.
158
+ attr_accessor input_cache_write_30m_tokens: Integer?
159
+
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
157
162
  attr_reader input_cache_write_tokens: Integer?
158
163
 
159
- # The aggregated number of input tokens written to the cache with a 30-minute
160
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
161
166
  def input_cache_write_tokens=: (Integer) -> Integer
162
167
 
163
168
  # The aggregated number of cached audio input tokens used.
@@ -268,9 +273,12 @@ module OpenAI
268
273
  # @param input_cache_write_12h_tokens
269
274
  # The aggregated number of input tokens written to the cache with a 12-hour
270
275
  # retention period.
271
- # @param input_cache_write_tokens
276
+ # @param input_cache_write_30m_tokens
272
277
  # The aggregated number of input tokens written to the cache with a 30-minute
273
- # retention period.
278
+ # retention period. May be absent or null for older responses.
279
+ # @param input_cache_write_tokens
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
274
282
  # @param input_cached_audio_tokens
275
283
  # The aggregated number of cached audio input tokens used.
276
284
  # @param input_cached_image_tokens
@@ -315,6 +323,7 @@ module OpenAI
315
323
  ?batch: bool?,
316
324
  ?input_audio_tokens: Integer,
317
325
  ?input_cache_write_12h_tokens: Integer,
326
+ ?input_cache_write_30m_tokens: Integer?,
318
327
  ?input_cache_write_tokens: Integer,
319
328
  ?input_cached_audio_tokens: Integer,
320
329
  ?input_cached_image_tokens: Integer,
@@ -343,6 +352,7 @@ module OpenAI
343
352
  ?batch: bool?,
344
353
  ?input_audio_tokens: Integer,
345
354
  ?:input_cache_write_12h_tokens => Integer,
355
+ ?:input_cache_write_30m_tokens => Integer?,
346
356
  ?input_cache_write_tokens: Integer,
347
357
  ?input_cached_audio_tokens: Integer,
348
358
  ?input_cached_image_tokens: Integer,