openai 1.6.0 → 1.7.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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +8 -1
  5. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +8 -1
  6. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +8 -1
  7. data/lib/openai/models/admin/organization/usage_completions_params.rb +23 -8
  8. data/lib/openai/models/admin/organization/usage_completions_response.rb +8 -1
  9. data/lib/openai/models/admin/organization/usage_costs_params.rb +25 -12
  10. data/lib/openai/models/admin/organization/usage_costs_response.rb +47 -19
  11. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +8 -1
  12. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +8 -1
  13. data/lib/openai/models/admin/organization/usage_images_response.rb +8 -1
  14. data/lib/openai/models/admin/organization/usage_moderations_response.rb +8 -1
  15. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +8 -1
  16. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +8 -1
  17. data/lib/openai/resources/admin/organization/usage.rb +24 -11
  18. data/lib/openai/version.rb +1 -1
  19. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +8 -0
  20. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +8 -0
  21. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +8 -0
  22. data/rbi/openai/models/admin/organization/usage_completions_params.rbi +26 -8
  23. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +8 -0
  24. data/rbi/openai/models/admin/organization/usage_costs_params.rbi +28 -12
  25. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +91 -67
  26. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +8 -0
  27. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +8 -0
  28. data/rbi/openai/models/admin/organization/usage_images_response.rbi +8 -0
  29. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +8 -0
  30. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +8 -0
  31. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +8 -0
  32. data/rbi/openai/resources/admin/organization/usage.rbi +24 -11
  33. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +5 -0
  34. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +5 -0
  35. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +5 -0
  36. data/sig/openai/models/admin/organization/usage_completions_params.rbs +35 -12
  37. data/sig/openai/models/admin/organization/usage_completions_response.rbs +5 -0
  38. data/sig/openai/models/admin/organization/usage_costs_params.rbs +43 -19
  39. data/sig/openai/models/admin/organization/usage_costs_response.rbs +38 -21
  40. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +5 -0
  41. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +5 -0
  42. data/sig/openai/models/admin/organization/usage_images_response.rbs +5 -0
  43. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +5 -0
  44. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +5 -0
  45. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +5 -0
  46. data/sig/openai/resources/admin/organization/usage.rbs +1 -1
  47. metadata +1 -1
@@ -222,6 +222,11 @@ module OpenAI
222
222
  # @return [Boolean, nil]
223
223
  optional :batch, OpenAI::Internal::Type::Boolean, nil?: true
224
224
 
225
+ # @!attribute completion_window
226
+ #
227
+ # @return [String, nil]
228
+ optional :completion_window, String, nil?: true
229
+
225
230
  # @!attribute input_audio_tokens
226
231
  # The aggregated number of uncached audio input tokens used.
227
232
  #
@@ -340,7 +345,7 @@ module OpenAI
340
345
  # @return [String, nil]
341
346
  optional :user_id, String, nil?: true
342
347
 
343
- # @!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.completions.result")
348
+ # @!method initialize(input_tokens:, num_model_requests:, output_tokens:, api_key_id: nil, api_source: nil, batch: nil, completion_window: 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.completions.result")
344
349
  # The aggregated completions usage details of the specific time bucket.
345
350
  #
346
351
  # @param input_tokens [Integer]
@@ -370,6 +375,8 @@ module OpenAI
370
375
  # When `group_by=batch`, this field tells whether the grouped usage result is
371
376
  # batch or not.
372
377
  #
378
+ # @param completion_window [String, nil]
379
+ #
373
380
  # @param input_audio_tokens [Integer]
374
381
  # The aggregated number of uncached audio input tokens used.
375
382
  #
@@ -222,6 +222,11 @@ module OpenAI
222
222
  # @return [Boolean, nil]
223
223
  optional :batch, OpenAI::Internal::Type::Boolean, nil?: true
224
224
 
225
+ # @!attribute completion_window
226
+ #
227
+ # @return [String, nil]
228
+ optional :completion_window, String, nil?: true
229
+
225
230
  # @!attribute input_audio_tokens
226
231
  # The aggregated number of uncached audio input tokens used.
227
232
  #
@@ -340,7 +345,7 @@ module OpenAI
340
345
  # @return [String, nil]
341
346
  optional :user_id, String, nil?: true
342
347
 
343
- # @!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.completions.result")
348
+ # @!method initialize(input_tokens:, num_model_requests:, output_tokens:, api_key_id: nil, api_source: nil, batch: nil, completion_window: 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.completions.result")
344
349
  # The aggregated completions usage details of the specific time bucket.
345
350
  #
346
351
  # @param input_tokens [Integer]
@@ -370,6 +375,8 @@ module OpenAI
370
375
  # When `group_by=batch`, this field tells whether the grouped usage result is
371
376
  # batch or not.
372
377
  #
378
+ # @param completion_window [String, nil]
379
+ #
373
380
  # @param input_audio_tokens [Integer]
374
381
  # The aggregated number of uncached audio input tokens used.
375
382
  #
@@ -195,11 +195,18 @@ module OpenAI
195
195
  # End time (Unix seconds) of the query time range, exclusive.
196
196
  #
197
197
  # @param group_by [Array<Symbol, OpenAI::Models::Admin::Organization::UsageCompletionsParams::GroupBy>]
198
- # Group the usage data by the specified fields. Support fields include
198
+ # Group the usage data by the specified fields. Supported fields include
199
199
  # `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
200
- # `api_source` or any combination of them. When grouped by `api_source`, results
201
- # use `agents_api` for attributed Agents API activity and `unlabeled` for all
202
- # other activity. Without source grouping, `api_source` is null.
200
+ # `api_source`, `completion_window` or any combination of them. When grouped by
201
+ # `api_source`, results use `agents_api` for attributed Agents API activity and
202
+ # `unlabeled` for all other activity. Without source grouping, `api_source` is
203
+ # null. When grouped by `completion_window`, results use `2h`, `8h`, or
204
+ # `unlabeled` when no known or applicable window is available. Without window
205
+ # grouping, `completion_window` is null. Unlabeled does not imply Standard
206
+ # traffic. The field may be omitted when completion-window reporting is
207
+ # unavailable. Completion window is separate from `service_tier`; Batch's 24h
208
+ # window and legacy Flex scheduling are not included. Keep the same grouping and
209
+ # filters when following `next_page`.
203
210
  #
204
211
  # @param limit [Integer]
205
212
  # Specifies the number of buckets to return.
@@ -258,12 +265,18 @@ module OpenAI
258
265
  #
259
266
  # @param group_by [Array<Symbol, OpenAI::Models::Admin::Organization::UsageCostsParams::GroupBy>]
260
267
  # Group the costs by the specified fields. Supported fields include `project_id`,
261
- # `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
262
- # `user_id` with `project_id` grouping or the `project_ids` filter depends on the
263
- # organization and requested time range. Unsupported combinations return HTTP 400.
264
- # When grouped by `api_source`, results use `agents_api` for attributed Agents API
265
- # activity and `unlabeled` for all other activity. Without source grouping,
266
- # `api_source` is null.
268
+ # `user_id`, `line_item`, `api_key_id`, `api_source`, and `completion_window`.
269
+ # Support for combining `user_id` with `project_id` grouping or the `project_ids`
270
+ # filter depends on the organization and requested time range. Unsupported
271
+ # combinations return HTTP 400. When grouped by `api_source`, results use
272
+ # `agents_api` for attributed Agents API activity and `unlabeled` for all other
273
+ # activity. Without source grouping, `api_source` is null. When grouped by
274
+ # `completion_window`, results use `2h`, `8h`, or `unlabeled` when no known or
275
+ # applicable window is available. Without window grouping, `completion_window` is
276
+ # null. Unlabeled does not imply Standard traffic. The field may be omitted when
277
+ # completion-window reporting is unavailable. Batch's 24h window and legacy Flex
278
+ # scheduling are not included. Existing line item names and exact-name filters are
279
+ # unchanged. Keep the same grouping and filters when following `next_page`.
267
280
  #
268
281
  # @param limit [Integer]
269
282
  # A limit on the number of buckets to be returned. Limit can range between 1 and
@@ -292,7 +305,7 @@ module OpenAI
292
305
  method: :get,
293
306
  path: "organization/costs",
294
307
  query: query,
295
- model: OpenAI::Admin::Organization::UsageCostsResponse,
308
+ model: OpenAI::Models::Admin::Organization::UsageCostsResponse,
296
309
  security: {admin_api_key_auth: true},
297
310
  options: options
298
311
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "1.6.0"
4
+ VERSION = "1.7.0"
5
5
  end
@@ -212,6 +212,9 @@ module OpenAI
212
212
  sig { returns(T.nilable(T::Boolean)) }
213
213
  attr_accessor :batch
214
214
 
215
+ sig { returns(T.nilable(String)) }
216
+ attr_accessor :completion_window
217
+
215
218
  # The aggregated number of uncached audio input tokens used.
216
219
  sig { returns(T.nilable(Integer)) }
217
220
  attr_reader :input_audio_tokens
@@ -351,6 +354,8 @@ module OpenAI
351
354
 
352
355
  batch: T.nilable(T::Boolean),
353
356
 
357
+ completion_window: T.nilable(String),
358
+
354
359
  input_audio_tokens: Integer,
355
360
 
356
361
  input_cache_write_12h_tokens: Integer,
@@ -420,6 +425,8 @@ module OpenAI
420
425
  # batch or not.
421
426
  batch: nil,
422
427
 
428
+ completion_window: nil,
429
+
423
430
  # The aggregated number of uncached audio input tokens used.
424
431
  input_audio_tokens: nil,
425
432
 
@@ -500,6 +507,7 @@ module OpenAI
500
507
  OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
501
508
  ),
502
509
  batch: T.nilable(T::Boolean),
510
+ completion_window: T.nilable(String),
503
511
  input_audio_tokens: Integer,
504
512
  input_cache_write_12h_tokens: Integer,
505
513
  input_cache_write_30m_tokens: T.nilable(Integer),
@@ -214,6 +214,9 @@ module OpenAI
214
214
  sig { returns(T.nilable(T::Boolean)) }
215
215
  attr_accessor :batch
216
216
 
217
+ sig { returns(T.nilable(String)) }
218
+ attr_accessor :completion_window
219
+
217
220
  # The aggregated number of uncached audio input tokens used.
218
221
  sig { returns(T.nilable(Integer)) }
219
222
  attr_reader :input_audio_tokens
@@ -353,6 +356,8 @@ module OpenAI
353
356
 
354
357
  batch: T.nilable(T::Boolean),
355
358
 
359
+ completion_window: T.nilable(String),
360
+
356
361
  input_audio_tokens: Integer,
357
362
 
358
363
  input_cache_write_12h_tokens: Integer,
@@ -422,6 +427,8 @@ module OpenAI
422
427
  # batch or not.
423
428
  batch: nil,
424
429
 
430
+ completion_window: nil,
431
+
425
432
  # The aggregated number of uncached audio input tokens used.
426
433
  input_audio_tokens: nil,
427
434
 
@@ -502,6 +509,7 @@ module OpenAI
502
509
  OpenAI::Models::Admin::Organization::UsageAudioTranscriptionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
503
510
  ),
504
511
  batch: T.nilable(T::Boolean),
512
+ completion_window: T.nilable(String),
505
513
  input_audio_tokens: Integer,
506
514
  input_cache_write_12h_tokens: Integer,
507
515
  input_cache_write_30m_tokens: T.nilable(Integer),
@@ -216,6 +216,9 @@ module OpenAI
216
216
  sig { returns(T.nilable(T::Boolean)) }
217
217
  attr_accessor :batch
218
218
 
219
+ sig { returns(T.nilable(String)) }
220
+ attr_accessor :completion_window
221
+
219
222
  # The aggregated number of uncached audio input tokens used.
220
223
  sig { returns(T.nilable(Integer)) }
221
224
  attr_reader :input_audio_tokens
@@ -355,6 +358,8 @@ module OpenAI
355
358
 
356
359
  batch: T.nilable(T::Boolean),
357
360
 
361
+ completion_window: T.nilable(String),
362
+
358
363
  input_audio_tokens: Integer,
359
364
 
360
365
  input_cache_write_12h_tokens: Integer,
@@ -424,6 +429,8 @@ module OpenAI
424
429
  # batch or not.
425
430
  batch: nil,
426
431
 
432
+ completion_window: nil,
433
+
427
434
  # The aggregated number of uncached audio input tokens used.
428
435
  input_audio_tokens: nil,
429
436
 
@@ -504,6 +511,7 @@ module OpenAI
504
511
  OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
505
512
  ),
506
513
  batch: T.nilable(T::Boolean),
514
+ completion_window: T.nilable(String),
507
515
  input_audio_tokens: Integer,
508
516
  input_cache_write_12h_tokens: Integer,
509
517
  input_cache_write_30m_tokens: T.nilable(Integer),
@@ -53,11 +53,18 @@ module OpenAI
53
53
  sig { params(end_time: Integer).void }
54
54
  attr_writer :end_time
55
55
 
56
- # Group the usage data by the specified fields. Support fields include
56
+ # Group the usage data by the specified fields. Supported fields include
57
57
  # `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
58
- # `api_source` or any combination of them. When grouped by `api_source`, results
59
- # use `agents_api` for attributed Agents API activity and `unlabeled` for all
60
- # other activity. Without source grouping, `api_source` is null.
58
+ # `api_source`, `completion_window` or any combination of them. When grouped by
59
+ # `api_source`, results use `agents_api` for attributed Agents API activity and
60
+ # `unlabeled` for all other activity. Without source grouping, `api_source` is
61
+ # null. When grouped by `completion_window`, results use `2h`, `8h`, or
62
+ # `unlabeled` when no known or applicable window is available. Without window
63
+ # grouping, `completion_window` is null. Unlabeled does not imply Standard
64
+ # traffic. The field may be omitted when completion-window reporting is
65
+ # unavailable. Completion window is separate from `service_tier`; Batch's 24h
66
+ # window and legacy Flex scheduling are not included. Keep the same grouping and
67
+ # filters when following `next_page`.
61
68
  sig { returns(T.nilable(T::Array[OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::OrSymbol])) }
62
69
  attr_reader :group_by
63
70
 
@@ -154,11 +161,18 @@ module OpenAI
154
161
  # End time (Unix seconds) of the query time range, exclusive.
155
162
  end_time: nil,
156
163
 
157
- # Group the usage data by the specified fields. Support fields include
164
+ # Group the usage data by the specified fields. Supported fields include
158
165
  # `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
159
- # `api_source` or any combination of them. When grouped by `api_source`, results
160
- # use `agents_api` for attributed Agents API activity and `unlabeled` for all
161
- # other activity. Without source grouping, `api_source` is null.
166
+ # `api_source`, `completion_window` or any combination of them. When grouped by
167
+ # `api_source`, results use `agents_api` for attributed Agents API activity and
168
+ # `unlabeled` for all other activity. Without source grouping, `api_source` is
169
+ # null. When grouped by `completion_window`, results use `2h`, `8h`, or
170
+ # `unlabeled` when no known or applicable window is available. Without window
171
+ # grouping, `completion_window` is null. Unlabeled does not imply Standard
172
+ # traffic. The field may be omitted when completion-window reporting is
173
+ # unavailable. Completion window is separate from `service_tier`; Batch's 24h
174
+ # window and legacy Flex scheduling are not included. Keep the same grouping and
175
+ # filters when following `next_page`.
162
176
  group_by: nil,
163
177
 
164
178
  # Specifies the number of buckets to return.
@@ -252,6 +266,10 @@ module OpenAI
252
266
  OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol
253
267
  )
254
268
  API_SOURCE = T.let(:api_source, OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol)
269
+ COMPLETION_WINDOW = T.let(
270
+ :completion_window,
271
+ OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol
272
+ )
255
273
 
256
274
  sig {
257
275
  override.returns(T::Array[OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol])
@@ -212,6 +212,9 @@ module OpenAI
212
212
  sig { returns(T.nilable(T::Boolean)) }
213
213
  attr_accessor :batch
214
214
 
215
+ sig { returns(T.nilable(String)) }
216
+ attr_accessor :completion_window
217
+
215
218
  # The aggregated number of uncached audio input tokens used.
216
219
  sig { returns(T.nilable(Integer)) }
217
220
  attr_reader :input_audio_tokens
@@ -351,6 +354,8 @@ module OpenAI
351
354
 
352
355
  batch: T.nilable(T::Boolean),
353
356
 
357
+ completion_window: T.nilable(String),
358
+
354
359
  input_audio_tokens: Integer,
355
360
 
356
361
  input_cache_write_12h_tokens: Integer,
@@ -420,6 +425,8 @@ module OpenAI
420
425
  # batch or not.
421
426
  batch: nil,
422
427
 
428
+ completion_window: nil,
429
+
423
430
  # The aggregated number of uncached audio input tokens used.
424
431
  input_audio_tokens: nil,
425
432
 
@@ -500,6 +507,7 @@ module OpenAI
500
507
  OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
501
508
  ),
502
509
  batch: T.nilable(T::Boolean),
510
+ completion_window: T.nilable(String),
503
511
  input_audio_tokens: Integer,
504
512
  input_cache_write_12h_tokens: Integer,
505
513
  input_cache_write_30m_tokens: T.nilable(Integer),
@@ -46,12 +46,18 @@ module OpenAI
46
46
  attr_writer :end_time
47
47
 
48
48
  # Group the costs by the specified fields. Supported fields include `project_id`,
49
- # `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
50
- # `user_id` with `project_id` grouping or the `project_ids` filter depends on the
51
- # organization and requested time range. Unsupported combinations return HTTP 400.
52
- # When grouped by `api_source`, results use `agents_api` for attributed Agents API
53
- # activity and `unlabeled` for all other activity. Without source grouping,
54
- # `api_source` is null.
49
+ # `user_id`, `line_item`, `api_key_id`, `api_source`, and `completion_window`.
50
+ # Support for combining `user_id` with `project_id` grouping or the `project_ids`
51
+ # filter depends on the organization and requested time range. Unsupported
52
+ # combinations return HTTP 400. When grouped by `api_source`, results use
53
+ # `agents_api` for attributed Agents API activity and `unlabeled` for all other
54
+ # activity. Without source grouping, `api_source` is null. When grouped by
55
+ # `completion_window`, results use `2h`, `8h`, or `unlabeled` when no known or
56
+ # applicable window is available. Without window grouping, `completion_window` is
57
+ # null. Unlabeled does not imply Standard traffic. The field may be omitted when
58
+ # completion-window reporting is unavailable. Batch's 24h window and legacy Flex
59
+ # scheduling are not included. Existing line item names and exact-name filters are
60
+ # unchanged. Keep the same grouping and filters when following `next_page`.
55
61
  sig { returns(T.nilable(T::Array[OpenAI::Admin::Organization::UsageCostsParams::GroupBy::OrSymbol])) }
56
62
  attr_reader :group_by
57
63
 
@@ -130,12 +136,18 @@ module OpenAI
130
136
  end_time: nil,
131
137
 
132
138
  # Group the costs by the specified fields. Supported fields include `project_id`,
133
- # `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
134
- # `user_id` with `project_id` grouping or the `project_ids` filter depends on the
135
- # organization and requested time range. Unsupported combinations return HTTP 400.
136
- # When grouped by `api_source`, results use `agents_api` for attributed Agents API
137
- # activity and `unlabeled` for all other activity. Without source grouping,
138
- # `api_source` is null.
139
+ # `user_id`, `line_item`, `api_key_id`, `api_source`, and `completion_window`.
140
+ # Support for combining `user_id` with `project_id` grouping or the `project_ids`
141
+ # filter depends on the organization and requested time range. Unsupported
142
+ # combinations return HTTP 400. When grouped by `api_source`, results use
143
+ # `agents_api` for attributed Agents API activity and `unlabeled` for all other
144
+ # activity. Without source grouping, `api_source` is null. When grouped by
145
+ # `completion_window`, results use `2h`, `8h`, or `unlabeled` when no known or
146
+ # applicable window is available. Without window grouping, `completion_window` is
147
+ # null. Unlabeled does not imply Standard traffic. The field may be omitted when
148
+ # completion-window reporting is unavailable. Batch's 24h window and legacy Flex
149
+ # scheduling are not included. Existing line item names and exact-name filters are
150
+ # unchanged. Keep the same grouping and filters when following `next_page`.
139
151
  group_by: nil,
140
152
 
141
153
  # A limit on the number of buckets to be returned. Limit can range between 1 and
@@ -204,6 +216,10 @@ module OpenAI
204
216
  LINE_ITEM = T.let(:line_item, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
205
217
  API_KEY_ID = T.let(:api_key_id, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
206
218
  API_SOURCE = T.let(:api_source, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
219
+ COMPLETION_WINDOW = T.let(
220
+ :completion_window,
221
+ OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol
222
+ )
207
223
 
208
224
  sig { override.returns(T::Array[OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol]) }
209
225
  def self.values