Class: OpenAI::Models::Admin::Organization::UsageCostsResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/admin/organization/usage_costs_response.rb

Defined Under Namespace

Modules: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(end_time:, results:, start_time:, object: :bucket) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
# File 'lib/openai/models/admin/organization/usage_costs_response.rb', line 36

class Data < OpenAI::Internal::Type::BaseModel
  # @!attribute end_time
  #
  #   @return [Integer]
  required :end_time, Integer

  # @!attribute object
  #
  #   @return [Symbol, :bucket]
  required :object, const: :bucket

  # @!attribute results
  #
  #   @return [Array<OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCompletionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageEmbeddingsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageModerationsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageImagesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioSpeechesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioTranscriptionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageVectorStoresResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCodeInterpreterSessionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult>]
  required :results,
           -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result] }

  # @!attribute start_time
  #
  #   @return [Integer]
  required :start_time, Integer

  # @!method initialize(end_time:, results:, start_time:, object: :bucket)
  #   @param end_time [Integer]
  #   @param results [Array<OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCompletionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageEmbeddingsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageModerationsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageImagesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioSpeechesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioTranscriptionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageVectorStoresResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCodeInterpreterSessionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult>]
  #   @param start_time [Integer]
  #   @param object [Symbol, :bucket]

  # The aggregated completions usage details of the specific time bucket.
  module Result
    extend OpenAI::Internal::Type::Union

    discriminator :object

    # The aggregated completions usage details of the specific time bucket.
    variant :"organization.usage.completions.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCompletionsResult }

    # The aggregated embeddings usage details of the specific time bucket.
    variant :"organization.usage.embeddings.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageEmbeddingsResult }

    # The aggregated moderations usage details of the specific time bucket.
    variant :"organization.usage.moderations.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageModerationsResult }

    # The aggregated images usage details of the specific time bucket.
    variant :"organization.usage.images.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageImagesResult }

    # The aggregated audio speeches usage details of the specific time bucket.
    variant :"organization.usage.audio_speeches.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioSpeechesResult }

    # The aggregated audio transcriptions usage details of the specific time bucket.
    variant :"organization.usage.audio_transcriptions.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioTranscriptionsResult }

    # The aggregated vector stores usage details of the specific time bucket.
    variant :"organization.usage.vector_stores.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageVectorStoresResult }

    # The aggregated code interpreter sessions usage details of the specific time bucket.
    variant :"organization.usage.code_interpreter_sessions.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCodeInterpreterSessionsResult }

    # The aggregated costs details of the specific time bucket.
    variant :"organization.costs.result",
            -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult }

    class OrganizationUsageCompletionsResult < OpenAI::Internal::Type::BaseModel
      # @!attribute input_tokens
      #   The aggregated number of text input tokens used, including cached tokens. For
      #   customers subscribe to scale tier, this includes scale tier tokens.
      #
      #   @return [Integer]
      required :input_tokens, Integer

      # @!attribute num_model_requests
      #   The count of requests made to the model.
      #
      #   @return [Integer]
      required :num_model_requests, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.completions.result"]
      required :object, const: :"organization.usage.completions.result"

      # @!attribute output_tokens
      #   The aggregated number of text output tokens used. For customers subscribe to
      #   scale tier, this includes scale tier tokens.
      #
      #   @return [Integer]
      required :output_tokens, Integer

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API key ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute batch
      #   When `group_by=batch`, this field tells whether the grouped usage result is
      #   batch or not.
      #
      #   @return [Boolean, nil]
      optional :batch, OpenAI::Internal::Type::Boolean, nil?: true

      # @!attribute input_audio_tokens
      #   The aggregated number of audio input tokens used, including cached tokens.
      #
      #   @return [Integer, nil]
      optional :input_audio_tokens, Integer

      # @!attribute input_cached_tokens
      #   The aggregated number of text input tokens that has been cached from previous
      #   requests. For customers subscribe to scale tier, this includes scale tier
      #   tokens.
      #
      #   @return [Integer, nil]
      optional :input_cached_tokens, Integer

      # @!attribute model
      #   When `group_by=model`, this field provides the model name of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :model, String, nil?: true

      # @!attribute output_audio_tokens
      #   The aggregated number of audio output tokens used.
      #
      #   @return [Integer, nil]
      optional :output_audio_tokens, Integer

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!attribute service_tier
      #   When `group_by=service_tier`, this field provides the service tier of the
      #   grouped usage result.
      #
      #   @return [String, nil]
      optional :service_tier, String, nil?: true

      # @!attribute user_id
      #   When `group_by=user_id`, this field provides the user ID of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :user_id, String, nil?: true

      # @!method initialize(input_tokens:, num_model_requests:, output_tokens:, api_key_id: nil, batch: nil, input_audio_tokens: nil, input_cached_tokens: nil, model: nil, output_audio_tokens: nil, project_id: nil, service_tier: nil, user_id: nil, object: :"organization.usage.completions.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCompletionsResult}
      #   for more details.
      #
      #   The aggregated completions usage details of the specific time bucket.
      #
      #   @param input_tokens [Integer] The aggregated number of text input tokens used, including cached tokens. For cu
      #
      #   @param num_model_requests [Integer] The count of requests made to the model.
      #
      #   @param output_tokens [Integer] The aggregated number of text output tokens used. For customers subscribe to sca
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
      #
      #   @param batch [Boolean, nil] When `group_by=batch`, this field tells whether the grouped usage result is batc
      #
      #   @param input_audio_tokens [Integer] The aggregated number of audio input tokens used, including cached tokens.
      #
      #   @param input_cached_tokens [Integer] The aggregated number of text input tokens that has been cached from previous re
      #
      #   @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
      #
      #   @param output_audio_tokens [Integer] The aggregated number of audio output tokens used.
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param service_tier [String, nil] When `group_by=service_tier`, this field provides the service tier of the groupe
      #
      #   @param user_id [String, nil] When `group_by=user_id`, this field provides the user ID of the grouped usage re
      #
      #   @param object [Symbol, :"organization.usage.completions.result"]
    end

    class OrganizationUsageEmbeddingsResult < OpenAI::Internal::Type::BaseModel
      # @!attribute input_tokens
      #   The aggregated number of input tokens used.
      #
      #   @return [Integer]
      required :input_tokens, Integer

      # @!attribute num_model_requests
      #   The count of requests made to the model.
      #
      #   @return [Integer]
      required :num_model_requests, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.embeddings.result"]
      required :object, const: :"organization.usage.embeddings.result"

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API key ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute model
      #   When `group_by=model`, this field provides the model name of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :model, String, nil?: true

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!attribute user_id
      #   When `group_by=user_id`, this field provides the user ID of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :user_id, String, nil?: true

      # @!method initialize(input_tokens:, num_model_requests:, api_key_id: nil, model: nil, project_id: nil, user_id: nil, object: :"organization.usage.embeddings.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageEmbeddingsResult}
      #   for more details.
      #
      #   The aggregated embeddings usage details of the specific time bucket.
      #
      #   @param input_tokens [Integer] The aggregated number of input tokens used.
      #
      #   @param num_model_requests [Integer] The count of requests made to the model.
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
      #
      #   @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param user_id [String, nil] When `group_by=user_id`, this field provides the user ID of the grouped usage re
      #
      #   @param object [Symbol, :"organization.usage.embeddings.result"]
    end

    class OrganizationUsageModerationsResult < OpenAI::Internal::Type::BaseModel
      # @!attribute input_tokens
      #   The aggregated number of input tokens used.
      #
      #   @return [Integer]
      required :input_tokens, Integer

      # @!attribute num_model_requests
      #   The count of requests made to the model.
      #
      #   @return [Integer]
      required :num_model_requests, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.moderations.result"]
      required :object, const: :"organization.usage.moderations.result"

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API key ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute model
      #   When `group_by=model`, this field provides the model name of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :model, String, nil?: true

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!attribute user_id
      #   When `group_by=user_id`, this field provides the user ID of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :user_id, String, nil?: true

      # @!method initialize(input_tokens:, num_model_requests:, api_key_id: nil, model: nil, project_id: nil, user_id: nil, object: :"organization.usage.moderations.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageModerationsResult}
      #   for more details.
      #
      #   The aggregated moderations usage details of the specific time bucket.
      #
      #   @param input_tokens [Integer] The aggregated number of input tokens used.
      #
      #   @param num_model_requests [Integer] The count of requests made to the model.
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
      #
      #   @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param user_id [String, nil] When `group_by=user_id`, this field provides the user ID of the grouped usage re
      #
      #   @param object [Symbol, :"organization.usage.moderations.result"]
    end

    class OrganizationUsageImagesResult < OpenAI::Internal::Type::BaseModel
      # @!attribute images
      #   The number of images processed.
      #
      #   @return [Integer]
      required :images, Integer

      # @!attribute num_model_requests
      #   The count of requests made to the model.
      #
      #   @return [Integer]
      required :num_model_requests, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.images.result"]
      required :object, const: :"organization.usage.images.result"

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API key ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute model
      #   When `group_by=model`, this field provides the model name of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :model, String, nil?: true

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!attribute size
      #   When `group_by=size`, this field provides the image size of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :size, String, nil?: true

      # @!attribute source
      #   When `group_by=source`, this field provides the source of the grouped usage
      #   result, possible values are `image.generation`, `image.edit`, `image.variation`.
      #
      #   @return [String, nil]
      optional :source, String, nil?: true

      # @!attribute user_id
      #   When `group_by=user_id`, this field provides the user ID of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :user_id, String, nil?: true

      # @!method initialize(images:, num_model_requests:, api_key_id: nil, model: nil, project_id: nil, size: nil, source: nil, user_id: nil, object: :"organization.usage.images.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageImagesResult}
      #   for more details.
      #
      #   The aggregated images usage details of the specific time bucket.
      #
      #   @param images [Integer] The number of images processed.
      #
      #   @param num_model_requests [Integer] The count of requests made to the model.
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
      #
      #   @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param size [String, nil] When `group_by=size`, this field provides the image size of the grouped usage re
      #
      #   @param source [String, nil] When `group_by=source`, this field provides the source of the grouped usage resu
      #
      #   @param user_id [String, nil] When `group_by=user_id`, this field provides the user ID of the grouped usage re
      #
      #   @param object [Symbol, :"organization.usage.images.result"]
    end

    class OrganizationUsageAudioSpeechesResult < OpenAI::Internal::Type::BaseModel
      # @!attribute characters
      #   The number of characters processed.
      #
      #   @return [Integer]
      required :characters, Integer

      # @!attribute num_model_requests
      #   The count of requests made to the model.
      #
      #   @return [Integer]
      required :num_model_requests, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.audio_speeches.result"]
      required :object, const: :"organization.usage.audio_speeches.result"

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API key ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute model
      #   When `group_by=model`, this field provides the model name of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :model, String, nil?: true

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!attribute user_id
      #   When `group_by=user_id`, this field provides the user ID of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :user_id, String, nil?: true

      # @!method initialize(characters:, num_model_requests:, api_key_id: nil, model: nil, project_id: nil, user_id: nil, object: :"organization.usage.audio_speeches.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioSpeechesResult}
      #   for more details.
      #
      #   The aggregated audio speeches usage details of the specific time bucket.
      #
      #   @param characters [Integer] The number of characters processed.
      #
      #   @param num_model_requests [Integer] The count of requests made to the model.
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
      #
      #   @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param user_id [String, nil] When `group_by=user_id`, this field provides the user ID of the grouped usage re
      #
      #   @param object [Symbol, :"organization.usage.audio_speeches.result"]
    end

    class OrganizationUsageAudioTranscriptionsResult < OpenAI::Internal::Type::BaseModel
      # @!attribute num_model_requests
      #   The count of requests made to the model.
      #
      #   @return [Integer]
      required :num_model_requests, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.audio_transcriptions.result"]
      required :object, const: :"organization.usage.audio_transcriptions.result"

      # @!attribute seconds
      #   The number of seconds processed.
      #
      #   @return [Integer]
      required :seconds, Integer

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API key ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute model
      #   When `group_by=model`, this field provides the model name of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :model, String, nil?: true

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!attribute user_id
      #   When `group_by=user_id`, this field provides the user ID of the grouped usage
      #   result.
      #
      #   @return [String, nil]
      optional :user_id, String, nil?: true

      # @!method initialize(num_model_requests:, seconds:, api_key_id: nil, model: nil, project_id: nil, user_id: nil, object: :"organization.usage.audio_transcriptions.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioTranscriptionsResult}
      #   for more details.
      #
      #   The aggregated audio transcriptions usage details of the specific time bucket.
      #
      #   @param num_model_requests [Integer] The count of requests made to the model.
      #
      #   @param seconds [Integer] The number of seconds processed.
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
      #
      #   @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param user_id [String, nil] When `group_by=user_id`, this field provides the user ID of the grouped usage re
      #
      #   @param object [Symbol, :"organization.usage.audio_transcriptions.result"]
    end

    class OrganizationUsageVectorStoresResult < OpenAI::Internal::Type::BaseModel
      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.vector_stores.result"]
      required :object, const: :"organization.usage.vector_stores.result"

      # @!attribute usage_bytes
      #   The vector stores usage in bytes.
      #
      #   @return [Integer]
      required :usage_bytes, Integer

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!method initialize(usage_bytes:, project_id: nil, object: :"organization.usage.vector_stores.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageVectorStoresResult}
      #   for more details.
      #
      #   The aggregated vector stores usage details of the specific time bucket.
      #
      #   @param usage_bytes [Integer] The vector stores usage in bytes.
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param object [Symbol, :"organization.usage.vector_stores.result"]
    end

    class OrganizationUsageCodeInterpreterSessionsResult < OpenAI::Internal::Type::BaseModel
      # @!attribute num_sessions
      #   The number of code interpreter sessions.
      #
      #   @return [Integer]
      required :num_sessions, Integer

      # @!attribute object
      #
      #   @return [Symbol, :"organization.usage.code_interpreter_sessions.result"]
      required :object, const: :"organization.usage.code_interpreter_sessions.result"

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   usage result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!method initialize(num_sessions:, project_id: nil, object: :"organization.usage.code_interpreter_sessions.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCodeInterpreterSessionsResult}
      #   for more details.
      #
      #   The aggregated code interpreter sessions usage details of the specific time
      #   bucket.
      #
      #   @param num_sessions [Integer] The number of code interpreter sessions.
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
      #
      #   @param object [Symbol, :"organization.usage.code_interpreter_sessions.result"]
    end

    class OrganizationCostsResult < OpenAI::Internal::Type::BaseModel
      # @!attribute object
      #
      #   @return [Symbol, :"organization.costs.result"]
      required :object, const: :"organization.costs.result"

      # @!attribute amount
      #   The monetary value in its associated currency.
      #
      #   @return [OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult::Amount, nil]
      optional :amount,
               -> { OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult::Amount }

      # @!attribute api_key_id
      #   When `group_by=api_key_id`, this field provides the API Key ID of the grouped
      #   costs result.
      #
      #   @return [String, nil]
      optional :api_key_id, String, nil?: true

      # @!attribute line_item
      #   When `group_by=line_item`, this field provides the line item of the grouped
      #   costs result.
      #
      #   @return [String, nil]
      optional :line_item, String, nil?: true

      # @!attribute project_id
      #   When `group_by=project_id`, this field provides the project ID of the grouped
      #   costs result.
      #
      #   @return [String, nil]
      optional :project_id, String, nil?: true

      # @!method initialize(amount: nil, api_key_id: nil, line_item: nil, project_id: nil, object: :"organization.costs.result")
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult}
      #   for more details.
      #
      #   The aggregated costs details of the specific time bucket.
      #
      #   @param amount [OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult::Amount] The monetary value in its associated currency.
      #
      #   @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API Key ID of the grouped co
      #
      #   @param line_item [String, nil] When `group_by=line_item`, this field provides the line item of the grouped cost
      #
      #   @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped co
      #
      #   @param object [Symbol, :"organization.costs.result"]

      # @see OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult#amount
      class Amount < OpenAI::Internal::Type::BaseModel
        # @!attribute currency
        #   Lowercase ISO-4217 currency e.g. "usd"
        #
        #   @return [String, nil]
        optional :currency, String

        # @!attribute value
        #   The numeric value of the cost.
        #
        #   @return [Float, nil]
        optional :value, Float

        # @!method initialize(currency: nil, value: nil)
        #   The monetary value in its associated currency.
        #
        #   @param currency [String] Lowercase ISO-4217 currency e.g. "usd"
        #
        #   @param value [Float] The numeric value of the cost.
      end
    end

    # @!method self.variants
    #   @return [Array(OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCompletionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageEmbeddingsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageModerationsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageImagesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioSpeechesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioTranscriptionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageVectorStoresResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCodeInterpreterSessionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult)]
  end
end

Instance Attribute Details

#end_timeInteger

Returns:

  • (Integer)


40
# File 'lib/openai/models/admin/organization/usage_costs_response.rb', line 40

required :end_time, Integer

#objectSymbol, :bucket

Returns:

  • (Symbol, :bucket)


45
# File 'lib/openai/models/admin/organization/usage_costs_response.rb', line 45

required :object, const: :bucket

#resultsArray<OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCompletionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageEmbeddingsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageModerationsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageImagesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioSpeechesResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageAudioTranscriptionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageVectorStoresResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationUsageCodeInterpreterSessionsResult, OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result::OrganizationCostsResult>



50
51
# File 'lib/openai/models/admin/organization/usage_costs_response.rb', line 50

required :results,
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Models::Admin::Organization::UsageCostsResponse::Data::Result] }

#start_timeInteger

Returns:

  • (Integer)


56
# File 'lib/openai/models/admin/organization/usage_costs_response.rb', line 56

required :start_time, Integer