Class: OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/admin/organization/usage_decisions_response.rb,
sig/openai/models/admin/organization/usage_decisions_response.rbs

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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(data:, has_more:, next_page:, object: :page) ⇒ Data

Returns a new instance of Data.

Parameters:



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
# File 'lib/openai/models/admin/organization/usage_decisions_response.rb', line 38

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::UsageDecisionsResponse::Data::Result>]
  required(
    :results,
    -> {
      OpenAI::Internal::Type::ArrayOf[
        OpenAI::Models::Admin::Organization::UsageDecisionsResponse::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::UsageDecisionsResponse::Data::Result>]
  #   @param start_time [Integer]
  #   @param object [Symbol, :bucket]

  class Result < OpenAI::Internal::Type::BaseModel
    # @!attribute input_tokens
    #   The aggregated number of input tokens used, including cached and cache-write
    #   tokens. This includes text, audio, and image tokens. For customers subscribed 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.decisions.result"]
    required :object, const: :"organization.usage.decisions.result"

    # @!attribute output_tokens
    #   The aggregated number of output tokens used across text, audio, and image
    #   outputs. For customers subscribed 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 api_source
    #   When grouped by `api_source`, `agents_api` identifies attributed Agents API
    #   activity and `unlabeled` includes all records without published source
    #   attribution, including historical and unknown origins. Unlabeled does not imply
    #   direct API usage. Without source grouping, this field is null.
    #
    #   @return [Symbol, OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result::APISource, nil]
    optional(
      :api_source,
      enum: -> { OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result::APISource },
      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 uncached audio input tokens used.
    #
    #   @return [Integer, nil]
    optional :input_audio_tokens, Integer, nil?: true

    # @!attribute input_cache_write_12h_tokens
    #   The aggregated number of input tokens written to the cache with a 12-hour
    #   retention period.
    #
    #   @return [Integer, nil]
    optional :input_cache_write_12h_tokens, Integer, nil?: true

    # @!attribute input_cache_write_30m_tokens
    #   The aggregated number of input tokens written to the cache with a 30-minute
    #   retention period.
    #
    #   @return [Integer, nil]
    optional :input_cache_write_30m_tokens, Integer, nil?: true

    # @!attribute input_cache_write_tokens
    #   The aggregated number of input tokens written to the cache across 30-minute and
    #   12-hour retention periods.
    #
    #   @return [Integer, nil]
    optional :input_cache_write_tokens, Integer, nil?: true

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

    # @!attribute input_cached_image_tokens
    #   The aggregated number of cached image input tokens used.
    #
    #   @return [Integer, nil]
    optional :input_cached_image_tokens, Integer, nil?: true

    # @!attribute input_cached_text_tokens
    #   The aggregated number of cached text input tokens used.
    #
    #   @return [Integer, nil]
    optional :input_cached_text_tokens, Integer, nil?: true

    # @!attribute input_cached_tokens
    #   The aggregated number of cached input tokens used across text, audio, and image
    #   inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
    #
    #   @return [Integer, nil]
    optional :input_cached_tokens, Integer, nil?: true

    # @!attribute input_image_tokens
    #   The aggregated number of uncached image input tokens used.
    #
    #   @return [Integer, nil]
    optional :input_image_tokens, Integer, nil?: true

    # @!attribute input_text_tokens
    #   The aggregated number of uncached text input tokens used, excluding cache-write
    #   tokens.
    #
    #   @return [Integer, nil]
    optional :input_text_tokens, Integer, nil?: true

    # @!attribute input_uncached_tokens
    #   The aggregated number of uncached input tokens used across text, audio, and
    #   image inputs, excluding cache-write tokens.
    #
    #   @return [Integer, nil]
    optional :input_uncached_tokens, Integer, 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 output_audio_tokens
    #   The aggregated number of audio output tokens used.
    #
    #   @return [Integer, nil]
    optional :output_audio_tokens, Integer, nil?: true

    # @!attribute output_image_tokens
    #   The aggregated number of image output tokens used.
    #
    #   @return [Integer, nil]
    optional :output_image_tokens, Integer, nil?: true

    # @!attribute output_text_tokens
    #   The aggregated number of text output tokens used.
    #
    #   @return [Integer, nil]
    optional :output_text_tokens, Integer, 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 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, api_source: nil, batch: nil, input_audio_tokens: nil, input_cache_write_12h_tokens: nil, input_cache_write_30m_tokens: nil, input_cache_write_tokens: nil, input_cached_audio_tokens: nil, input_cached_image_tokens: nil, input_cached_text_tokens: nil, input_cached_tokens: nil, input_image_tokens: nil, input_text_tokens: nil, input_uncached_tokens: nil, model: nil, output_audio_tokens: nil, output_image_tokens: nil, output_text_tokens: nil, project_id: nil, service_tier: nil, user_id: nil, object: :"organization.usage.decisions.result")
    #   The aggregated Decisions API usage details of the specific time bucket.
    #
    #   @param input_tokens [Integer]
    #     The aggregated number of input tokens used, including cached and cache-write
    #     tokens. This includes text, audio, and image tokens. For customers subscribed to
    #     Scale Tier, this includes Scale Tier tokens.
    #
    #   @param num_model_requests [Integer]
    #     The count of requests made to the model.
    #
    #   @param output_tokens [Integer]
    #     The aggregated number of output tokens used across text, audio, and image
    #     outputs. For customers subscribed to Scale Tier, this includes Scale Tier
    #     tokens.
    #
    #   @param api_key_id [String, nil]
    #     When `group_by=api_key_id`, this field provides the API key ID of the grouped
    #     usage result.
    #
    #   @param api_source [Symbol, OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result::APISource, nil]
    #     When grouped by `api_source`, `agents_api` identifies attributed Agents API
    #     activity and `unlabeled` includes all records without published source
    #     attribution, including historical and unknown origins. Unlabeled does not imply
    #     direct API usage. Without source grouping, this field is null.
    #
    #   @param batch [Boolean, nil]
    #     When `group_by=batch`, this field tells whether the grouped usage result is
    #     batch or not.
    #
    #   @param input_audio_tokens [Integer, nil]
    #     The aggregated number of uncached audio input tokens used.
    #
    #   @param input_cache_write_12h_tokens [Integer, nil]
    #     The aggregated number of input tokens written to the cache with a 12-hour
    #     retention period.
    #
    #   @param input_cache_write_30m_tokens [Integer, nil]
    #     The aggregated number of input tokens written to the cache with a 30-minute
    #     retention period.
    #
    #   @param input_cache_write_tokens [Integer, nil]
    #     The aggregated number of input tokens written to the cache across 30-minute and
    #     12-hour retention periods.
    #
    #   @param input_cached_audio_tokens [Integer, nil]
    #     The aggregated number of cached audio input tokens used.
    #
    #   @param input_cached_image_tokens [Integer, nil]
    #     The aggregated number of cached image input tokens used.
    #
    #   @param input_cached_text_tokens [Integer, nil]
    #     The aggregated number of cached text input tokens used.
    #
    #   @param input_cached_tokens [Integer, nil]
    #     The aggregated number of cached input tokens used across text, audio, and image
    #     inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
    #
    #   @param input_image_tokens [Integer, nil]
    #     The aggregated number of uncached image input tokens used.
    #
    #   @param input_text_tokens [Integer, nil]
    #     The aggregated number of uncached text input tokens used, excluding cache-write
    #     tokens.
    #
    #   @param input_uncached_tokens [Integer, nil]
    #     The aggregated number of uncached input tokens used across text, audio, and
    #     image inputs, excluding cache-write tokens.
    #
    #   @param model [String, nil]
    #     When `group_by=model`, this field provides the model name of the grouped usage
    #     result.
    #
    #   @param output_audio_tokens [Integer, nil]
    #     The aggregated number of audio output tokens used.
    #
    #   @param output_image_tokens [Integer, nil]
    #     The aggregated number of image output tokens used.
    #
    #   @param output_text_tokens [Integer, nil]
    #     The aggregated number of text output tokens used.
    #
    #   @param project_id [String, nil]
    #     When `group_by=project_id`, this field provides the project ID of the grouped
    #     usage result.
    #
    #   @param service_tier [String, nil]
    #     When `group_by=service_tier`, this field provides the service tier of the
    #     grouped usage result.
    #
    #   @param user_id [String, nil]
    #     When `group_by=user_id`, this field provides the user ID of the grouped usage
    #     result.
    #
    #   @param object [Symbol, :"organization.usage.decisions.result"]

    # When grouped by `api_source`, `agents_api` identifies attributed Agents API
    # activity and `unlabeled` includes all records without published source
    # attribution, including historical and unknown origins. Unlabeled does not imply
    # direct API usage. Without source grouping, this field is null.
    #
    # @see OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result#api_source
    module APISource
      extend OpenAI::Internal::Type::Enum

      AGENTS_API = :agents_api
      UNLABELED = :unlabeled

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end
end

Instance Attribute Details

#end_time ⇒ Integer

Parameters:

  • value (Integer)

Returns:

  • (Integer)


42
# File 'lib/openai/models/admin/organization/usage_decisions_response.rb', line 42

required :end_time, Integer

#object ⇒ Symbol, :bucket

Parameters:

  • value (:bucket)

Returns:

  • (Symbol, :bucket)


47
# File 'lib/openai/models/admin/organization/usage_decisions_response.rb', line 47

required :object, const: :bucket

#results ⇒ Array<OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result>



52
53
54
55
56
57
58
59
# File 'lib/openai/models/admin/organization/usage_decisions_response.rb', line 52

required(
  :results,
  -> {
    OpenAI::Internal::Type::ArrayOf[
      OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result
    ]
  }
)

#start_time ⇒ Integer

Parameters:

  • value (Integer)

Returns:

  • (Integer)


64
# File 'lib/openai/models/admin/organization/usage_decisions_response.rb', line 64

required :start_time, Integer

Instance Method Details

#to_hash ⇒ { end_time: Integer, ?object: :bucket, results: ::Array[OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result], start_time: Integer }

Returns:



60
61
62
63
64
65
# File 'sig/openai/models/admin/organization/usage_decisions_response.rbs', line 60

def to_hash: -> {
  end_time: Integer,
  ?object: :bucket,
  results: ::Array[OpenAI::Models::Admin::Organization::UsageDecisionsResponse::Data::Result],
  start_time: Integer
}