openai 0.70.0 → 0.71.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +51 -1
- data/lib/openai/client.rb +62 -8
- data/lib/openai/internal/provider.rb +31 -0
- data/lib/openai/internal/transport/base_client.rb +65 -21
- data/lib/openai/models/admin/organization/audit_log_list_params.rb +84 -0
- data/lib/openai/models/admin/organization/audit_log_list_response.rb +84 -0
- data/lib/openai/models/admin/organization/projects/project_service_account.rb +4 -3
- data/lib/openai/models/admin/organization/projects/service_account_create_params.rb +9 -1
- data/lib/openai/models/admin/organization/projects/service_account_create_response.rb +26 -6
- data/lib/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rb +54 -0
- data/lib/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rb +57 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_completions_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_costs_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_images_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +88 -13
- data/lib/openai/models/beta/beta_response_input_item.rb +16 -32
- data/lib/openai/provider.rb +18 -0
- data/lib/openai/providers/bedrock.rb +489 -0
- data/lib/openai/resources/admin/organization/projects/service_accounts/api_keys.rb +60 -0
- data/lib/openai/resources/admin/organization/projects/service_accounts.rb +10 -3
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +6 -0
- data/rbi/openai/client.rbi +17 -0
- data/rbi/openai/internal/provider.rbi +51 -0
- data/rbi/openai/internal/transport/base_client.rbi +32 -0
- data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +420 -0
- data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +420 -0
- data/rbi/openai/models/admin/organization/projects/project_service_account.rbi +8 -3
- data/rbi/openai/models/admin/organization/projects/service_account_create_params.rbi +8 -0
- data/rbi/openai/models/admin/organization/projects/service_account_create_response.rbi +52 -8
- data/rbi/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rbi +84 -0
- data/rbi/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rbi +80 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +121 -16
- data/rbi/openai/models/beta/beta_response_input_item.rbi +39 -46
- data/rbi/openai/provider.rbi +9 -0
- data/rbi/openai/providers.rbi +33 -0
- data/rbi/openai/resources/admin/organization/projects/service_accounts/api_keys.rbi +45 -0
- data/rbi/openai/resources/admin/organization/projects/service_accounts.rbi +12 -2
- data/sig/openai/client.rbs +7 -0
- data/sig/openai/internal/provider.rbs +29 -0
- data/sig/openai/internal/transport/base_client.rbs +17 -1
- data/sig/openai/models/admin/organization/audit_log_list_params.rbs +168 -0
- data/sig/openai/models/admin/organization/audit_log_list_response.rbs +168 -0
- data/sig/openai/models/admin/organization/projects/project_service_account.rbs +2 -1
- data/sig/openai/models/admin/organization/projects/service_account_create_params.rbs +9 -1
- data/sig/openai/models/admin/organization/projects/service_account_create_response.rbs +16 -5
- data/sig/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rbs +53 -0
- data/sig/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rbs +48 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_images_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +63 -0
- data/sig/openai/models/beta/beta_response_input_item.rbs +18 -24
- data/sig/openai/provider.rbs +5 -0
- data/sig/openai/providers.rbs +15 -0
- data/sig/openai/resources/admin/organization/projects/service_accounts/api_keys.rbs +23 -0
- data/sig/openai/resources/admin/organization/projects/service_accounts.rbs +3 -0
- metadata +20 -2
|
@@ -160,8 +160,9 @@ module OpenAI
|
|
|
160
160
|
)
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
-
# The aggregated number of
|
|
164
|
-
#
|
|
163
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
164
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
165
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
165
166
|
sig { returns(Integer) }
|
|
166
167
|
attr_accessor :input_tokens
|
|
167
168
|
|
|
@@ -172,8 +173,9 @@ module OpenAI
|
|
|
172
173
|
sig { returns(Symbol) }
|
|
173
174
|
attr_accessor :object
|
|
174
175
|
|
|
175
|
-
# The aggregated number of
|
|
176
|
-
#
|
|
176
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
177
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
178
|
+
# tokens.
|
|
177
179
|
sig { returns(Integer) }
|
|
178
180
|
attr_accessor :output_tokens
|
|
179
181
|
|
|
@@ -187,22 +189,72 @@ module OpenAI
|
|
|
187
189
|
sig { returns(T.nilable(T::Boolean)) }
|
|
188
190
|
attr_accessor :batch
|
|
189
191
|
|
|
190
|
-
# The aggregated number of audio input tokens used
|
|
192
|
+
# The aggregated number of uncached audio input tokens used.
|
|
191
193
|
sig { returns(T.nilable(Integer)) }
|
|
192
194
|
attr_reader :input_audio_tokens
|
|
193
195
|
|
|
194
196
|
sig { params(input_audio_tokens: Integer).void }
|
|
195
197
|
attr_writer :input_audio_tokens
|
|
196
198
|
|
|
197
|
-
# The aggregated number of
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
# The aggregated number of input tokens written to the cache.
|
|
200
|
+
sig { returns(T.nilable(Integer)) }
|
|
201
|
+
attr_reader :input_cache_write_tokens
|
|
202
|
+
|
|
203
|
+
sig { params(input_cache_write_tokens: Integer).void }
|
|
204
|
+
attr_writer :input_cache_write_tokens
|
|
205
|
+
|
|
206
|
+
# The aggregated number of cached audio input tokens used.
|
|
207
|
+
sig { returns(T.nilable(Integer)) }
|
|
208
|
+
attr_reader :input_cached_audio_tokens
|
|
209
|
+
|
|
210
|
+
sig { params(input_cached_audio_tokens: Integer).void }
|
|
211
|
+
attr_writer :input_cached_audio_tokens
|
|
212
|
+
|
|
213
|
+
# The aggregated number of cached image input tokens used.
|
|
214
|
+
sig { returns(T.nilable(Integer)) }
|
|
215
|
+
attr_reader :input_cached_image_tokens
|
|
216
|
+
|
|
217
|
+
sig { params(input_cached_image_tokens: Integer).void }
|
|
218
|
+
attr_writer :input_cached_image_tokens
|
|
219
|
+
|
|
220
|
+
# The aggregated number of cached text input tokens used.
|
|
221
|
+
sig { returns(T.nilable(Integer)) }
|
|
222
|
+
attr_reader :input_cached_text_tokens
|
|
223
|
+
|
|
224
|
+
sig { params(input_cached_text_tokens: Integer).void }
|
|
225
|
+
attr_writer :input_cached_text_tokens
|
|
226
|
+
|
|
227
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
228
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
200
229
|
sig { returns(T.nilable(Integer)) }
|
|
201
230
|
attr_reader :input_cached_tokens
|
|
202
231
|
|
|
203
232
|
sig { params(input_cached_tokens: Integer).void }
|
|
204
233
|
attr_writer :input_cached_tokens
|
|
205
234
|
|
|
235
|
+
# The aggregated number of uncached image input tokens used.
|
|
236
|
+
sig { returns(T.nilable(Integer)) }
|
|
237
|
+
attr_reader :input_image_tokens
|
|
238
|
+
|
|
239
|
+
sig { params(input_image_tokens: Integer).void }
|
|
240
|
+
attr_writer :input_image_tokens
|
|
241
|
+
|
|
242
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
243
|
+
# tokens.
|
|
244
|
+
sig { returns(T.nilable(Integer)) }
|
|
245
|
+
attr_reader :input_text_tokens
|
|
246
|
+
|
|
247
|
+
sig { params(input_text_tokens: Integer).void }
|
|
248
|
+
attr_writer :input_text_tokens
|
|
249
|
+
|
|
250
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
251
|
+
# image inputs, excluding cache-write tokens.
|
|
252
|
+
sig { returns(T.nilable(Integer)) }
|
|
253
|
+
attr_reader :input_uncached_tokens
|
|
254
|
+
|
|
255
|
+
sig { params(input_uncached_tokens: Integer).void }
|
|
256
|
+
attr_writer :input_uncached_tokens
|
|
257
|
+
|
|
206
258
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
207
259
|
# result.
|
|
208
260
|
sig { returns(T.nilable(String)) }
|
|
@@ -215,6 +267,20 @@ module OpenAI
|
|
|
215
267
|
sig { params(output_audio_tokens: Integer).void }
|
|
216
268
|
attr_writer :output_audio_tokens
|
|
217
269
|
|
|
270
|
+
# The aggregated number of image output tokens used.
|
|
271
|
+
sig { returns(T.nilable(Integer)) }
|
|
272
|
+
attr_reader :output_image_tokens
|
|
273
|
+
|
|
274
|
+
sig { params(output_image_tokens: Integer).void }
|
|
275
|
+
attr_writer :output_image_tokens
|
|
276
|
+
|
|
277
|
+
# The aggregated number of text output tokens used.
|
|
278
|
+
sig { returns(T.nilable(Integer)) }
|
|
279
|
+
attr_reader :output_text_tokens
|
|
280
|
+
|
|
281
|
+
sig { params(output_text_tokens: Integer).void }
|
|
282
|
+
attr_writer :output_text_tokens
|
|
283
|
+
|
|
218
284
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
219
285
|
# usage result.
|
|
220
286
|
sig { returns(T.nilable(String)) }
|
|
@@ -239,9 +305,18 @@ module OpenAI
|
|
|
239
305
|
api_key_id: T.nilable(String),
|
|
240
306
|
batch: T.nilable(T::Boolean),
|
|
241
307
|
input_audio_tokens: Integer,
|
|
308
|
+
input_cache_write_tokens: Integer,
|
|
309
|
+
input_cached_audio_tokens: Integer,
|
|
310
|
+
input_cached_image_tokens: Integer,
|
|
311
|
+
input_cached_text_tokens: Integer,
|
|
242
312
|
input_cached_tokens: Integer,
|
|
313
|
+
input_image_tokens: Integer,
|
|
314
|
+
input_text_tokens: Integer,
|
|
315
|
+
input_uncached_tokens: Integer,
|
|
243
316
|
model: T.nilable(String),
|
|
244
317
|
output_audio_tokens: Integer,
|
|
318
|
+
output_image_tokens: Integer,
|
|
319
|
+
output_text_tokens: Integer,
|
|
245
320
|
project_id: T.nilable(String),
|
|
246
321
|
service_tier: T.nilable(String),
|
|
247
322
|
user_id: T.nilable(String),
|
|
@@ -249,13 +324,15 @@ module OpenAI
|
|
|
249
324
|
).returns(T.attached_class)
|
|
250
325
|
end
|
|
251
326
|
def self.new(
|
|
252
|
-
# The aggregated number of
|
|
253
|
-
#
|
|
327
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
328
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
329
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
254
330
|
input_tokens:,
|
|
255
331
|
# The count of requests made to the model.
|
|
256
332
|
num_model_requests:,
|
|
257
|
-
# The aggregated number of
|
|
258
|
-
#
|
|
333
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
334
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
335
|
+
# tokens.
|
|
259
336
|
output_tokens:,
|
|
260
337
|
# When `group_by=api_key_id`, this field provides the API key ID of the grouped
|
|
261
338
|
# usage result.
|
|
@@ -263,17 +340,36 @@ module OpenAI
|
|
|
263
340
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
264
341
|
# batch or not.
|
|
265
342
|
batch: nil,
|
|
266
|
-
# The aggregated number of audio input tokens used
|
|
343
|
+
# The aggregated number of uncached audio input tokens used.
|
|
267
344
|
input_audio_tokens: nil,
|
|
268
|
-
# The aggregated number of
|
|
269
|
-
|
|
270
|
-
# tokens.
|
|
345
|
+
# The aggregated number of input tokens written to the cache.
|
|
346
|
+
input_cache_write_tokens: nil,
|
|
347
|
+
# The aggregated number of cached audio input tokens used.
|
|
348
|
+
input_cached_audio_tokens: nil,
|
|
349
|
+
# The aggregated number of cached image input tokens used.
|
|
350
|
+
input_cached_image_tokens: nil,
|
|
351
|
+
# The aggregated number of cached text input tokens used.
|
|
352
|
+
input_cached_text_tokens: nil,
|
|
353
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
354
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
271
355
|
input_cached_tokens: nil,
|
|
356
|
+
# The aggregated number of uncached image input tokens used.
|
|
357
|
+
input_image_tokens: nil,
|
|
358
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
359
|
+
# tokens.
|
|
360
|
+
input_text_tokens: nil,
|
|
361
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
362
|
+
# image inputs, excluding cache-write tokens.
|
|
363
|
+
input_uncached_tokens: nil,
|
|
272
364
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
273
365
|
# result.
|
|
274
366
|
model: nil,
|
|
275
367
|
# The aggregated number of audio output tokens used.
|
|
276
368
|
output_audio_tokens: nil,
|
|
369
|
+
# The aggregated number of image output tokens used.
|
|
370
|
+
output_image_tokens: nil,
|
|
371
|
+
# The aggregated number of text output tokens used.
|
|
372
|
+
output_text_tokens: nil,
|
|
277
373
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
278
374
|
# usage result.
|
|
279
375
|
project_id: nil,
|
|
@@ -297,9 +393,18 @@ module OpenAI
|
|
|
297
393
|
api_key_id: T.nilable(String),
|
|
298
394
|
batch: T.nilable(T::Boolean),
|
|
299
395
|
input_audio_tokens: Integer,
|
|
396
|
+
input_cache_write_tokens: Integer,
|
|
397
|
+
input_cached_audio_tokens: Integer,
|
|
398
|
+
input_cached_image_tokens: Integer,
|
|
399
|
+
input_cached_text_tokens: Integer,
|
|
300
400
|
input_cached_tokens: Integer,
|
|
401
|
+
input_image_tokens: Integer,
|
|
402
|
+
input_text_tokens: Integer,
|
|
403
|
+
input_uncached_tokens: Integer,
|
|
301
404
|
model: T.nilable(String),
|
|
302
405
|
output_audio_tokens: Integer,
|
|
406
|
+
output_image_tokens: Integer,
|
|
407
|
+
output_text_tokens: Integer,
|
|
303
408
|
project_id: T.nilable(String),
|
|
304
409
|
service_tier: T.nilable(String),
|
|
305
410
|
user_id: T.nilable(String)
|
|
@@ -160,8 +160,9 @@ module OpenAI
|
|
|
160
160
|
)
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
-
# The aggregated number of
|
|
164
|
-
#
|
|
163
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
164
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
165
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
165
166
|
sig { returns(Integer) }
|
|
166
167
|
attr_accessor :input_tokens
|
|
167
168
|
|
|
@@ -172,8 +173,9 @@ module OpenAI
|
|
|
172
173
|
sig { returns(Symbol) }
|
|
173
174
|
attr_accessor :object
|
|
174
175
|
|
|
175
|
-
# The aggregated number of
|
|
176
|
-
#
|
|
176
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
177
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
178
|
+
# tokens.
|
|
177
179
|
sig { returns(Integer) }
|
|
178
180
|
attr_accessor :output_tokens
|
|
179
181
|
|
|
@@ -187,22 +189,72 @@ module OpenAI
|
|
|
187
189
|
sig { returns(T.nilable(T::Boolean)) }
|
|
188
190
|
attr_accessor :batch
|
|
189
191
|
|
|
190
|
-
# The aggregated number of audio input tokens used
|
|
192
|
+
# The aggregated number of uncached audio input tokens used.
|
|
191
193
|
sig { returns(T.nilable(Integer)) }
|
|
192
194
|
attr_reader :input_audio_tokens
|
|
193
195
|
|
|
194
196
|
sig { params(input_audio_tokens: Integer).void }
|
|
195
197
|
attr_writer :input_audio_tokens
|
|
196
198
|
|
|
197
|
-
# The aggregated number of
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
# The aggregated number of input tokens written to the cache.
|
|
200
|
+
sig { returns(T.nilable(Integer)) }
|
|
201
|
+
attr_reader :input_cache_write_tokens
|
|
202
|
+
|
|
203
|
+
sig { params(input_cache_write_tokens: Integer).void }
|
|
204
|
+
attr_writer :input_cache_write_tokens
|
|
205
|
+
|
|
206
|
+
# The aggregated number of cached audio input tokens used.
|
|
207
|
+
sig { returns(T.nilable(Integer)) }
|
|
208
|
+
attr_reader :input_cached_audio_tokens
|
|
209
|
+
|
|
210
|
+
sig { params(input_cached_audio_tokens: Integer).void }
|
|
211
|
+
attr_writer :input_cached_audio_tokens
|
|
212
|
+
|
|
213
|
+
# The aggregated number of cached image input tokens used.
|
|
214
|
+
sig { returns(T.nilable(Integer)) }
|
|
215
|
+
attr_reader :input_cached_image_tokens
|
|
216
|
+
|
|
217
|
+
sig { params(input_cached_image_tokens: Integer).void }
|
|
218
|
+
attr_writer :input_cached_image_tokens
|
|
219
|
+
|
|
220
|
+
# The aggregated number of cached text input tokens used.
|
|
221
|
+
sig { returns(T.nilable(Integer)) }
|
|
222
|
+
attr_reader :input_cached_text_tokens
|
|
223
|
+
|
|
224
|
+
sig { params(input_cached_text_tokens: Integer).void }
|
|
225
|
+
attr_writer :input_cached_text_tokens
|
|
226
|
+
|
|
227
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
228
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
200
229
|
sig { returns(T.nilable(Integer)) }
|
|
201
230
|
attr_reader :input_cached_tokens
|
|
202
231
|
|
|
203
232
|
sig { params(input_cached_tokens: Integer).void }
|
|
204
233
|
attr_writer :input_cached_tokens
|
|
205
234
|
|
|
235
|
+
# The aggregated number of uncached image input tokens used.
|
|
236
|
+
sig { returns(T.nilable(Integer)) }
|
|
237
|
+
attr_reader :input_image_tokens
|
|
238
|
+
|
|
239
|
+
sig { params(input_image_tokens: Integer).void }
|
|
240
|
+
attr_writer :input_image_tokens
|
|
241
|
+
|
|
242
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
243
|
+
# tokens.
|
|
244
|
+
sig { returns(T.nilable(Integer)) }
|
|
245
|
+
attr_reader :input_text_tokens
|
|
246
|
+
|
|
247
|
+
sig { params(input_text_tokens: Integer).void }
|
|
248
|
+
attr_writer :input_text_tokens
|
|
249
|
+
|
|
250
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
251
|
+
# image inputs, excluding cache-write tokens.
|
|
252
|
+
sig { returns(T.nilable(Integer)) }
|
|
253
|
+
attr_reader :input_uncached_tokens
|
|
254
|
+
|
|
255
|
+
sig { params(input_uncached_tokens: Integer).void }
|
|
256
|
+
attr_writer :input_uncached_tokens
|
|
257
|
+
|
|
206
258
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
207
259
|
# result.
|
|
208
260
|
sig { returns(T.nilable(String)) }
|
|
@@ -215,6 +267,20 @@ module OpenAI
|
|
|
215
267
|
sig { params(output_audio_tokens: Integer).void }
|
|
216
268
|
attr_writer :output_audio_tokens
|
|
217
269
|
|
|
270
|
+
# The aggregated number of image output tokens used.
|
|
271
|
+
sig { returns(T.nilable(Integer)) }
|
|
272
|
+
attr_reader :output_image_tokens
|
|
273
|
+
|
|
274
|
+
sig { params(output_image_tokens: Integer).void }
|
|
275
|
+
attr_writer :output_image_tokens
|
|
276
|
+
|
|
277
|
+
# The aggregated number of text output tokens used.
|
|
278
|
+
sig { returns(T.nilable(Integer)) }
|
|
279
|
+
attr_reader :output_text_tokens
|
|
280
|
+
|
|
281
|
+
sig { params(output_text_tokens: Integer).void }
|
|
282
|
+
attr_writer :output_text_tokens
|
|
283
|
+
|
|
218
284
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
219
285
|
# usage result.
|
|
220
286
|
sig { returns(T.nilable(String)) }
|
|
@@ -239,9 +305,18 @@ module OpenAI
|
|
|
239
305
|
api_key_id: T.nilable(String),
|
|
240
306
|
batch: T.nilable(T::Boolean),
|
|
241
307
|
input_audio_tokens: Integer,
|
|
308
|
+
input_cache_write_tokens: Integer,
|
|
309
|
+
input_cached_audio_tokens: Integer,
|
|
310
|
+
input_cached_image_tokens: Integer,
|
|
311
|
+
input_cached_text_tokens: Integer,
|
|
242
312
|
input_cached_tokens: Integer,
|
|
313
|
+
input_image_tokens: Integer,
|
|
314
|
+
input_text_tokens: Integer,
|
|
315
|
+
input_uncached_tokens: Integer,
|
|
243
316
|
model: T.nilable(String),
|
|
244
317
|
output_audio_tokens: Integer,
|
|
318
|
+
output_image_tokens: Integer,
|
|
319
|
+
output_text_tokens: Integer,
|
|
245
320
|
project_id: T.nilable(String),
|
|
246
321
|
service_tier: T.nilable(String),
|
|
247
322
|
user_id: T.nilable(String),
|
|
@@ -249,13 +324,15 @@ module OpenAI
|
|
|
249
324
|
).returns(T.attached_class)
|
|
250
325
|
end
|
|
251
326
|
def self.new(
|
|
252
|
-
# The aggregated number of
|
|
253
|
-
#
|
|
327
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
328
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
329
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
254
330
|
input_tokens:,
|
|
255
331
|
# The count of requests made to the model.
|
|
256
332
|
num_model_requests:,
|
|
257
|
-
# The aggregated number of
|
|
258
|
-
#
|
|
333
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
334
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
335
|
+
# tokens.
|
|
259
336
|
output_tokens:,
|
|
260
337
|
# When `group_by=api_key_id`, this field provides the API key ID of the grouped
|
|
261
338
|
# usage result.
|
|
@@ -263,17 +340,36 @@ module OpenAI
|
|
|
263
340
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
264
341
|
# batch or not.
|
|
265
342
|
batch: nil,
|
|
266
|
-
# The aggregated number of audio input tokens used
|
|
343
|
+
# The aggregated number of uncached audio input tokens used.
|
|
267
344
|
input_audio_tokens: nil,
|
|
268
|
-
# The aggregated number of
|
|
269
|
-
|
|
270
|
-
# tokens.
|
|
345
|
+
# The aggregated number of input tokens written to the cache.
|
|
346
|
+
input_cache_write_tokens: nil,
|
|
347
|
+
# The aggregated number of cached audio input tokens used.
|
|
348
|
+
input_cached_audio_tokens: nil,
|
|
349
|
+
# The aggregated number of cached image input tokens used.
|
|
350
|
+
input_cached_image_tokens: nil,
|
|
351
|
+
# The aggregated number of cached text input tokens used.
|
|
352
|
+
input_cached_text_tokens: nil,
|
|
353
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
354
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
271
355
|
input_cached_tokens: nil,
|
|
356
|
+
# The aggregated number of uncached image input tokens used.
|
|
357
|
+
input_image_tokens: nil,
|
|
358
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
359
|
+
# tokens.
|
|
360
|
+
input_text_tokens: nil,
|
|
361
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
362
|
+
# image inputs, excluding cache-write tokens.
|
|
363
|
+
input_uncached_tokens: nil,
|
|
272
364
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
273
365
|
# result.
|
|
274
366
|
model: nil,
|
|
275
367
|
# The aggregated number of audio output tokens used.
|
|
276
368
|
output_audio_tokens: nil,
|
|
369
|
+
# The aggregated number of image output tokens used.
|
|
370
|
+
output_image_tokens: nil,
|
|
371
|
+
# The aggregated number of text output tokens used.
|
|
372
|
+
output_text_tokens: nil,
|
|
277
373
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
278
374
|
# usage result.
|
|
279
375
|
project_id: nil,
|
|
@@ -297,9 +393,18 @@ module OpenAI
|
|
|
297
393
|
api_key_id: T.nilable(String),
|
|
298
394
|
batch: T.nilable(T::Boolean),
|
|
299
395
|
input_audio_tokens: Integer,
|
|
396
|
+
input_cache_write_tokens: Integer,
|
|
397
|
+
input_cached_audio_tokens: Integer,
|
|
398
|
+
input_cached_image_tokens: Integer,
|
|
399
|
+
input_cached_text_tokens: Integer,
|
|
300
400
|
input_cached_tokens: Integer,
|
|
401
|
+
input_image_tokens: Integer,
|
|
402
|
+
input_text_tokens: Integer,
|
|
403
|
+
input_uncached_tokens: Integer,
|
|
301
404
|
model: T.nilable(String),
|
|
302
405
|
output_audio_tokens: Integer,
|
|
406
|
+
output_image_tokens: Integer,
|
|
407
|
+
output_text_tokens: Integer,
|
|
303
408
|
project_id: T.nilable(String),
|
|
304
409
|
service_tier: T.nilable(String),
|
|
305
410
|
user_id: T.nilable(String)
|
|
@@ -160,8 +160,9 @@ module OpenAI
|
|
|
160
160
|
)
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
-
# The aggregated number of
|
|
164
|
-
#
|
|
163
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
164
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
165
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
165
166
|
sig { returns(Integer) }
|
|
166
167
|
attr_accessor :input_tokens
|
|
167
168
|
|
|
@@ -172,8 +173,9 @@ module OpenAI
|
|
|
172
173
|
sig { returns(Symbol) }
|
|
173
174
|
attr_accessor :object
|
|
174
175
|
|
|
175
|
-
# The aggregated number of
|
|
176
|
-
#
|
|
176
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
177
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
178
|
+
# tokens.
|
|
177
179
|
sig { returns(Integer) }
|
|
178
180
|
attr_accessor :output_tokens
|
|
179
181
|
|
|
@@ -187,22 +189,72 @@ module OpenAI
|
|
|
187
189
|
sig { returns(T.nilable(T::Boolean)) }
|
|
188
190
|
attr_accessor :batch
|
|
189
191
|
|
|
190
|
-
# The aggregated number of audio input tokens used
|
|
192
|
+
# The aggregated number of uncached audio input tokens used.
|
|
191
193
|
sig { returns(T.nilable(Integer)) }
|
|
192
194
|
attr_reader :input_audio_tokens
|
|
193
195
|
|
|
194
196
|
sig { params(input_audio_tokens: Integer).void }
|
|
195
197
|
attr_writer :input_audio_tokens
|
|
196
198
|
|
|
197
|
-
# The aggregated number of
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
# The aggregated number of input tokens written to the cache.
|
|
200
|
+
sig { returns(T.nilable(Integer)) }
|
|
201
|
+
attr_reader :input_cache_write_tokens
|
|
202
|
+
|
|
203
|
+
sig { params(input_cache_write_tokens: Integer).void }
|
|
204
|
+
attr_writer :input_cache_write_tokens
|
|
205
|
+
|
|
206
|
+
# The aggregated number of cached audio input tokens used.
|
|
207
|
+
sig { returns(T.nilable(Integer)) }
|
|
208
|
+
attr_reader :input_cached_audio_tokens
|
|
209
|
+
|
|
210
|
+
sig { params(input_cached_audio_tokens: Integer).void }
|
|
211
|
+
attr_writer :input_cached_audio_tokens
|
|
212
|
+
|
|
213
|
+
# The aggregated number of cached image input tokens used.
|
|
214
|
+
sig { returns(T.nilable(Integer)) }
|
|
215
|
+
attr_reader :input_cached_image_tokens
|
|
216
|
+
|
|
217
|
+
sig { params(input_cached_image_tokens: Integer).void }
|
|
218
|
+
attr_writer :input_cached_image_tokens
|
|
219
|
+
|
|
220
|
+
# The aggregated number of cached text input tokens used.
|
|
221
|
+
sig { returns(T.nilable(Integer)) }
|
|
222
|
+
attr_reader :input_cached_text_tokens
|
|
223
|
+
|
|
224
|
+
sig { params(input_cached_text_tokens: Integer).void }
|
|
225
|
+
attr_writer :input_cached_text_tokens
|
|
226
|
+
|
|
227
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
228
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
200
229
|
sig { returns(T.nilable(Integer)) }
|
|
201
230
|
attr_reader :input_cached_tokens
|
|
202
231
|
|
|
203
232
|
sig { params(input_cached_tokens: Integer).void }
|
|
204
233
|
attr_writer :input_cached_tokens
|
|
205
234
|
|
|
235
|
+
# The aggregated number of uncached image input tokens used.
|
|
236
|
+
sig { returns(T.nilable(Integer)) }
|
|
237
|
+
attr_reader :input_image_tokens
|
|
238
|
+
|
|
239
|
+
sig { params(input_image_tokens: Integer).void }
|
|
240
|
+
attr_writer :input_image_tokens
|
|
241
|
+
|
|
242
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
243
|
+
# tokens.
|
|
244
|
+
sig { returns(T.nilable(Integer)) }
|
|
245
|
+
attr_reader :input_text_tokens
|
|
246
|
+
|
|
247
|
+
sig { params(input_text_tokens: Integer).void }
|
|
248
|
+
attr_writer :input_text_tokens
|
|
249
|
+
|
|
250
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
251
|
+
# image inputs, excluding cache-write tokens.
|
|
252
|
+
sig { returns(T.nilable(Integer)) }
|
|
253
|
+
attr_reader :input_uncached_tokens
|
|
254
|
+
|
|
255
|
+
sig { params(input_uncached_tokens: Integer).void }
|
|
256
|
+
attr_writer :input_uncached_tokens
|
|
257
|
+
|
|
206
258
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
207
259
|
# result.
|
|
208
260
|
sig { returns(T.nilable(String)) }
|
|
@@ -215,6 +267,20 @@ module OpenAI
|
|
|
215
267
|
sig { params(output_audio_tokens: Integer).void }
|
|
216
268
|
attr_writer :output_audio_tokens
|
|
217
269
|
|
|
270
|
+
# The aggregated number of image output tokens used.
|
|
271
|
+
sig { returns(T.nilable(Integer)) }
|
|
272
|
+
attr_reader :output_image_tokens
|
|
273
|
+
|
|
274
|
+
sig { params(output_image_tokens: Integer).void }
|
|
275
|
+
attr_writer :output_image_tokens
|
|
276
|
+
|
|
277
|
+
# The aggregated number of text output tokens used.
|
|
278
|
+
sig { returns(T.nilable(Integer)) }
|
|
279
|
+
attr_reader :output_text_tokens
|
|
280
|
+
|
|
281
|
+
sig { params(output_text_tokens: Integer).void }
|
|
282
|
+
attr_writer :output_text_tokens
|
|
283
|
+
|
|
218
284
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
219
285
|
# usage result.
|
|
220
286
|
sig { returns(T.nilable(String)) }
|
|
@@ -239,9 +305,18 @@ module OpenAI
|
|
|
239
305
|
api_key_id: T.nilable(String),
|
|
240
306
|
batch: T.nilable(T::Boolean),
|
|
241
307
|
input_audio_tokens: Integer,
|
|
308
|
+
input_cache_write_tokens: Integer,
|
|
309
|
+
input_cached_audio_tokens: Integer,
|
|
310
|
+
input_cached_image_tokens: Integer,
|
|
311
|
+
input_cached_text_tokens: Integer,
|
|
242
312
|
input_cached_tokens: Integer,
|
|
313
|
+
input_image_tokens: Integer,
|
|
314
|
+
input_text_tokens: Integer,
|
|
315
|
+
input_uncached_tokens: Integer,
|
|
243
316
|
model: T.nilable(String),
|
|
244
317
|
output_audio_tokens: Integer,
|
|
318
|
+
output_image_tokens: Integer,
|
|
319
|
+
output_text_tokens: Integer,
|
|
245
320
|
project_id: T.nilable(String),
|
|
246
321
|
service_tier: T.nilable(String),
|
|
247
322
|
user_id: T.nilable(String),
|
|
@@ -249,13 +324,15 @@ module OpenAI
|
|
|
249
324
|
).returns(T.attached_class)
|
|
250
325
|
end
|
|
251
326
|
def self.new(
|
|
252
|
-
# The aggregated number of
|
|
253
|
-
#
|
|
327
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
328
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
329
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
254
330
|
input_tokens:,
|
|
255
331
|
# The count of requests made to the model.
|
|
256
332
|
num_model_requests:,
|
|
257
|
-
# The aggregated number of
|
|
258
|
-
#
|
|
333
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
334
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
335
|
+
# tokens.
|
|
259
336
|
output_tokens:,
|
|
260
337
|
# When `group_by=api_key_id`, this field provides the API key ID of the grouped
|
|
261
338
|
# usage result.
|
|
@@ -263,17 +340,36 @@ module OpenAI
|
|
|
263
340
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
264
341
|
# batch or not.
|
|
265
342
|
batch: nil,
|
|
266
|
-
# The aggregated number of audio input tokens used
|
|
343
|
+
# The aggregated number of uncached audio input tokens used.
|
|
267
344
|
input_audio_tokens: nil,
|
|
268
|
-
# The aggregated number of
|
|
269
|
-
|
|
270
|
-
# tokens.
|
|
345
|
+
# The aggregated number of input tokens written to the cache.
|
|
346
|
+
input_cache_write_tokens: nil,
|
|
347
|
+
# The aggregated number of cached audio input tokens used.
|
|
348
|
+
input_cached_audio_tokens: nil,
|
|
349
|
+
# The aggregated number of cached image input tokens used.
|
|
350
|
+
input_cached_image_tokens: nil,
|
|
351
|
+
# The aggregated number of cached text input tokens used.
|
|
352
|
+
input_cached_text_tokens: nil,
|
|
353
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
354
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
271
355
|
input_cached_tokens: nil,
|
|
356
|
+
# The aggregated number of uncached image input tokens used.
|
|
357
|
+
input_image_tokens: nil,
|
|
358
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
359
|
+
# tokens.
|
|
360
|
+
input_text_tokens: nil,
|
|
361
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
362
|
+
# image inputs, excluding cache-write tokens.
|
|
363
|
+
input_uncached_tokens: nil,
|
|
272
364
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
273
365
|
# result.
|
|
274
366
|
model: nil,
|
|
275
367
|
# The aggregated number of audio output tokens used.
|
|
276
368
|
output_audio_tokens: nil,
|
|
369
|
+
# The aggregated number of image output tokens used.
|
|
370
|
+
output_image_tokens: nil,
|
|
371
|
+
# The aggregated number of text output tokens used.
|
|
372
|
+
output_text_tokens: nil,
|
|
277
373
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
278
374
|
# usage result.
|
|
279
375
|
project_id: nil,
|
|
@@ -297,9 +393,18 @@ module OpenAI
|
|
|
297
393
|
api_key_id: T.nilable(String),
|
|
298
394
|
batch: T.nilable(T::Boolean),
|
|
299
395
|
input_audio_tokens: Integer,
|
|
396
|
+
input_cache_write_tokens: Integer,
|
|
397
|
+
input_cached_audio_tokens: Integer,
|
|
398
|
+
input_cached_image_tokens: Integer,
|
|
399
|
+
input_cached_text_tokens: Integer,
|
|
300
400
|
input_cached_tokens: Integer,
|
|
401
|
+
input_image_tokens: Integer,
|
|
402
|
+
input_text_tokens: Integer,
|
|
403
|
+
input_uncached_tokens: Integer,
|
|
301
404
|
model: T.nilable(String),
|
|
302
405
|
output_audio_tokens: Integer,
|
|
406
|
+
output_image_tokens: Integer,
|
|
407
|
+
output_text_tokens: Integer,
|
|
303
408
|
project_id: T.nilable(String),
|
|
304
409
|
service_tier: T.nilable(String),
|
|
305
410
|
user_id: T.nilable(String)
|