openai 0.70.0 → 0.72.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 (172) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +51 -1
  4. data/lib/openai/client.rb +62 -8
  5. data/lib/openai/internal/provider.rb +31 -0
  6. data/lib/openai/internal/transport/base_client.rb +65 -21
  7. data/lib/openai/models/admin/organization/audit_log_list_params.rb +84 -0
  8. data/lib/openai/models/admin/organization/audit_log_list_response.rb +84 -0
  9. data/lib/openai/models/admin/organization/organization_spend_limit.rb +151 -0
  10. data/lib/openai/models/admin/organization/organization_spend_limit_deleted.rb +33 -0
  11. data/lib/openai/models/admin/organization/projects/project_service_account.rb +4 -3
  12. data/lib/openai/models/admin/organization/projects/project_spend_limit.rb +155 -0
  13. data/lib/openai/models/admin/organization/projects/project_spend_limit_deleted.rb +35 -0
  14. data/lib/openai/models/admin/organization/projects/service_account_create_params.rb +9 -1
  15. data/lib/openai/models/admin/organization/projects/service_account_create_response.rb +26 -6
  16. data/lib/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rb +54 -0
  17. data/lib/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rb +57 -0
  18. data/lib/openai/models/admin/organization/projects/spend_limit_delete_params.rb +26 -0
  19. data/lib/openai/models/admin/organization/projects/spend_limit_retrieve_params.rb +26 -0
  20. data/lib/openai/models/admin/organization/projects/spend_limit_update_params.rb +77 -0
  21. data/lib/openai/models/admin/organization/spend_limit_delete_params.rb +18 -0
  22. data/lib/openai/models/admin/organization/spend_limit_retrieve_params.rb +18 -0
  23. data/lib/openai/models/admin/organization/spend_limit_update_params.rb +67 -0
  24. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +88 -13
  25. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +88 -13
  26. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +88 -13
  27. data/lib/openai/models/admin/organization/usage_completions_response.rb +88 -13
  28. data/lib/openai/models/admin/organization/usage_costs_response.rb +88 -13
  29. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +88 -13
  30. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +88 -13
  31. data/lib/openai/models/admin/organization/usage_images_response.rb +88 -13
  32. data/lib/openai/models/admin/organization/usage_moderations_response.rb +88 -13
  33. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +88 -13
  34. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +88 -13
  35. data/lib/openai/models/beta/beta_response.rb +12 -6
  36. data/lib/openai/models/beta/beta_response_error.rb +1 -0
  37. data/lib/openai/models/beta/beta_response_input_item.rb +16 -32
  38. data/lib/openai/models/beta/beta_response_text_config.rb +4 -2
  39. data/lib/openai/models/beta/beta_responses_client_event.rb +12 -6
  40. data/lib/openai/models/beta/response_create_params.rb +12 -6
  41. data/lib/openai/models/beta/responses/input_token_count_params.rb +12 -4
  42. data/lib/openai/models/chat/completion_create_params.rb +8 -6
  43. data/lib/openai/models/reasoning.rb +8 -2
  44. data/lib/openai/models/responses/input_token_count_params.rb +4 -2
  45. data/lib/openai/models/responses/response.rb +4 -4
  46. data/lib/openai/models/responses/response_create_params.rb +4 -4
  47. data/lib/openai/models/responses/response_error.rb +1 -0
  48. data/lib/openai/models/responses/response_text_config.rb +4 -2
  49. data/lib/openai/models/responses/responses_client_event.rb +4 -4
  50. data/lib/openai/provider.rb +18 -0
  51. data/lib/openai/providers/bedrock.rb +489 -0
  52. data/lib/openai/resources/admin/organization/projects/service_accounts/api_keys.rb +60 -0
  53. data/lib/openai/resources/admin/organization/projects/service_accounts.rb +10 -3
  54. data/lib/openai/resources/admin/organization/projects/spend_limit.rb +95 -0
  55. data/lib/openai/resources/admin/organization/projects.rb +4 -0
  56. data/lib/openai/resources/admin/organization/spend_limit.rb +86 -0
  57. data/lib/openai/resources/admin/organization.rb +4 -0
  58. data/lib/openai/resources/beta/responses.rb +4 -4
  59. data/lib/openai/resources/chat/completions.rb +4 -4
  60. data/lib/openai/resources/responses.rb +4 -4
  61. data/lib/openai/version.rb +1 -1
  62. data/lib/openai.rb +18 -0
  63. data/rbi/openai/client.rbi +17 -0
  64. data/rbi/openai/internal/provider.rbi +51 -0
  65. data/rbi/openai/internal/transport/base_client.rbi +32 -0
  66. data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +420 -0
  67. data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +420 -0
  68. data/rbi/openai/models/admin/organization/organization_spend_limit.rbi +278 -0
  69. data/rbi/openai/models/admin/organization/organization_spend_limit_deleted.rbi +48 -0
  70. data/rbi/openai/models/admin/organization/projects/project_service_account.rbi +8 -3
  71. data/rbi/openai/models/admin/organization/projects/project_spend_limit.rbi +280 -0
  72. data/rbi/openai/models/admin/organization/projects/project_spend_limit_deleted.rbi +49 -0
  73. data/rbi/openai/models/admin/organization/projects/service_account_create_params.rbi +8 -0
  74. data/rbi/openai/models/admin/organization/projects/service_account_create_response.rbi +52 -8
  75. data/rbi/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rbi +84 -0
  76. data/rbi/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rbi +80 -0
  77. data/rbi/openai/models/admin/organization/projects/spend_limit_delete_params.rbi +44 -0
  78. data/rbi/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbi +44 -0
  79. data/rbi/openai/models/admin/organization/projects/spend_limit_update_params.rbi +149 -0
  80. data/rbi/openai/models/admin/organization/spend_limit_delete_params.rbi +34 -0
  81. data/rbi/openai/models/admin/organization/spend_limit_retrieve_params.rbi +34 -0
  82. data/rbi/openai/models/admin/organization/spend_limit_update_params.rbi +141 -0
  83. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +121 -16
  84. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +121 -16
  85. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +121 -16
  86. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +121 -16
  87. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +121 -16
  88. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +121 -16
  89. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +121 -16
  90. data/rbi/openai/models/admin/organization/usage_images_response.rbi +121 -16
  91. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +121 -16
  92. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +121 -16
  93. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +121 -16
  94. data/rbi/openai/models/beta/beta_response.rbi +18 -15
  95. data/rbi/openai/models/beta/beta_response_error.rbi +5 -0
  96. data/rbi/openai/models/beta/beta_response_input_item.rbi +39 -46
  97. data/rbi/openai/models/beta/beta_response_text_config.rbi +6 -3
  98. data/rbi/openai/models/beta/beta_responses_client_event.rbi +18 -15
  99. data/rbi/openai/models/beta/response_create_params.rbi +18 -15
  100. data/rbi/openai/models/beta/responses/input_token_count_params.rbi +18 -6
  101. data/rbi/openai/models/chat/completion_create_params.rbi +12 -15
  102. data/rbi/openai/models/reasoning.rbi +12 -3
  103. data/rbi/openai/models/responses/input_token_count_params.rbi +6 -3
  104. data/rbi/openai/models/responses/response.rbi +6 -12
  105. data/rbi/openai/models/responses/response_create_params.rbi +6 -12
  106. data/rbi/openai/models/responses/response_error.rbi +5 -0
  107. data/rbi/openai/models/responses/response_text_config.rbi +6 -3
  108. data/rbi/openai/models/responses/responses_client_event.rbi +6 -12
  109. data/rbi/openai/provider.rbi +9 -0
  110. data/rbi/openai/providers.rbi +33 -0
  111. data/rbi/openai/resources/admin/organization/projects/service_accounts/api_keys.rbi +45 -0
  112. data/rbi/openai/resources/admin/organization/projects/service_accounts.rbi +12 -2
  113. data/rbi/openai/resources/admin/organization/projects/spend_limit.rbi +78 -0
  114. data/rbi/openai/resources/admin/organization/projects.rbi +7 -0
  115. data/rbi/openai/resources/admin/organization/spend_limit.rbi +57 -0
  116. data/rbi/openai/resources/admin/organization.rbi +3 -0
  117. data/rbi/openai/resources/beta/responses.rbi +4 -4
  118. data/rbi/openai/resources/chat/completions.rbi +8 -6
  119. data/rbi/openai/resources/responses.rbi +4 -4
  120. data/sig/openai/client.rbs +7 -0
  121. data/sig/openai/internal/provider.rbs +29 -0
  122. data/sig/openai/internal/transport/base_client.rbs +17 -1
  123. data/sig/openai/models/admin/organization/audit_log_list_params.rbs +168 -0
  124. data/sig/openai/models/admin/organization/audit_log_list_response.rbs +168 -0
  125. data/sig/openai/models/admin/organization/organization_spend_limit.rbs +94 -0
  126. data/sig/openai/models/admin/organization/organization_spend_limit_deleted.rbs +28 -0
  127. data/sig/openai/models/admin/organization/projects/project_service_account.rbs +2 -1
  128. data/sig/openai/models/admin/organization/projects/project_spend_limit.rbs +96 -0
  129. data/sig/openai/models/admin/organization/projects/project_spend_limit_deleted.rbs +30 -0
  130. data/sig/openai/models/admin/organization/projects/service_account_create_params.rbs +9 -1
  131. data/sig/openai/models/admin/organization/projects/service_account_create_response.rbs +16 -5
  132. data/sig/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rbs +53 -0
  133. data/sig/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rbs +48 -0
  134. data/sig/openai/models/admin/organization/projects/spend_limit_delete_params.rbs +29 -0
  135. data/sig/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbs +29 -0
  136. data/sig/openai/models/admin/organization/projects/spend_limit_update_params.rbs +67 -0
  137. data/sig/openai/models/admin/organization/spend_limit_delete_params.rbs +19 -0
  138. data/sig/openai/models/admin/organization/spend_limit_retrieve_params.rbs +19 -0
  139. data/sig/openai/models/admin/organization/spend_limit_update_params.rbs +60 -0
  140. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +63 -0
  141. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +63 -0
  142. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +63 -0
  143. data/sig/openai/models/admin/organization/usage_completions_response.rbs +63 -0
  144. data/sig/openai/models/admin/organization/usage_costs_response.rbs +63 -0
  145. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +63 -0
  146. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +63 -0
  147. data/sig/openai/models/admin/organization/usage_images_response.rbs +63 -0
  148. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +63 -0
  149. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +63 -0
  150. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +63 -0
  151. data/sig/openai/models/beta/beta_response.rbs +8 -12
  152. data/sig/openai/models/beta/beta_response_error.rbs +2 -0
  153. data/sig/openai/models/beta/beta_response_input_item.rbs +18 -24
  154. data/sig/openai/models/beta/beta_responses_client_event.rbs +8 -12
  155. data/sig/openai/models/beta/response_create_params.rbs +8 -12
  156. data/sig/openai/models/chat/completion_create_params.rbs +8 -12
  157. data/sig/openai/models/responses/response.rbs +8 -12
  158. data/sig/openai/models/responses/response_create_params.rbs +8 -12
  159. data/sig/openai/models/responses/response_error.rbs +2 -0
  160. data/sig/openai/models/responses/responses_client_event.rbs +8 -12
  161. data/sig/openai/provider.rbs +5 -0
  162. data/sig/openai/providers.rbs +15 -0
  163. data/sig/openai/resources/admin/organization/projects/service_accounts/api_keys.rbs +23 -0
  164. data/sig/openai/resources/admin/organization/projects/service_accounts.rbs +3 -0
  165. data/sig/openai/resources/admin/organization/projects/spend_limit.rbs +31 -0
  166. data/sig/openai/resources/admin/organization/projects.rbs +2 -0
  167. data/sig/openai/resources/admin/organization/spend_limit.rbs +26 -0
  168. data/sig/openai/resources/admin/organization.rbs +2 -0
  169. data/sig/openai/resources/beta/responses.rbs +4 -4
  170. data/sig/openai/resources/chat/completions.rbs +4 -4
  171. data/sig/openai/resources/responses.rbs +4 -4
  172. metadata +56 -2
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Admin
6
+ module Organization
7
+ module Projects
8
+ # @see OpenAI::Resources::Admin::Organization::Projects::SpendLimit#update
9
+ class SpendLimitUpdateParams < OpenAI::Internal::Type::BaseModel
10
+ extend OpenAI::Internal::Type::RequestParameters::Converter
11
+ include OpenAI::Internal::Type::RequestParameters
12
+
13
+ # @!attribute project_id
14
+ #
15
+ # @return [String]
16
+ required :project_id, String
17
+
18
+ # @!attribute currency
19
+ # The currency for the threshold amount. Currently, only `USD` is supported.
20
+ #
21
+ # @return [Symbol, OpenAI::Models::Admin::Organization::Projects::SpendLimitUpdateParams::Currency]
22
+ required :currency, enum: -> { OpenAI::Admin::Organization::Projects::SpendLimitUpdateParams::Currency }
23
+
24
+ # @!attribute interval
25
+ # The time interval for evaluating spend against the threshold. Currently, only
26
+ # `month` is supported.
27
+ #
28
+ # @return [Symbol, OpenAI::Models::Admin::Organization::Projects::SpendLimitUpdateParams::Interval]
29
+ required :interval, enum: -> { OpenAI::Admin::Organization::Projects::SpendLimitUpdateParams::Interval }
30
+
31
+ # @!attribute threshold_amount
32
+ # The hard spend limit amount, in cents.
33
+ #
34
+ # @return [Integer]
35
+ required :threshold_amount, Integer
36
+
37
+ # @!method initialize(project_id:, currency:, interval:, threshold_amount:, request_options: {})
38
+ # Some parameter documentations has been truncated, see
39
+ # {OpenAI::Models::Admin::Organization::Projects::SpendLimitUpdateParams} for more
40
+ # details.
41
+ #
42
+ # @param project_id [String]
43
+ #
44
+ # @param currency [Symbol, OpenAI::Models::Admin::Organization::Projects::SpendLimitUpdateParams::Currency] The currency for the threshold amount. Currently, only `USD` is supported.
45
+ #
46
+ # @param interval [Symbol, OpenAI::Models::Admin::Organization::Projects::SpendLimitUpdateParams::Interval] The time interval for evaluating spend against the threshold. Currently, only `m
47
+ #
48
+ # @param threshold_amount [Integer] The hard spend limit amount, in cents.
49
+ #
50
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
51
+
52
+ # The currency for the threshold amount. Currently, only `USD` is supported.
53
+ module Currency
54
+ extend OpenAI::Internal::Type::Enum
55
+
56
+ USD = :USD
57
+
58
+ # @!method self.values
59
+ # @return [Array<Symbol>]
60
+ end
61
+
62
+ # The time interval for evaluating spend against the threshold. Currently, only
63
+ # `month` is supported.
64
+ module Interval
65
+ extend OpenAI::Internal::Type::Enum
66
+
67
+ MONTH = :month
68
+
69
+ # @!method self.values
70
+ # @return [Array<Symbol>]
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Admin
6
+ module Organization
7
+ # @see OpenAI::Resources::Admin::Organization::SpendLimit#delete
8
+ class SpendLimitDeleteParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ # @!method initialize(request_options: {})
13
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Admin
6
+ module Organization
7
+ # @see OpenAI::Resources::Admin::Organization::SpendLimit#retrieve
8
+ class SpendLimitRetrieveParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ # @!method initialize(request_options: {})
13
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Admin
6
+ module Organization
7
+ # @see OpenAI::Resources::Admin::Organization::SpendLimit#update
8
+ class SpendLimitUpdateParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ # @!attribute currency
13
+ # The currency for the threshold amount. Currently, only `USD` is supported.
14
+ #
15
+ # @return [Symbol, OpenAI::Models::Admin::Organization::SpendLimitUpdateParams::Currency]
16
+ required :currency, enum: -> { OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency }
17
+
18
+ # @!attribute interval
19
+ # The time interval for evaluating spend against the threshold. Currently, only
20
+ # `month` is supported.
21
+ #
22
+ # @return [Symbol, OpenAI::Models::Admin::Organization::SpendLimitUpdateParams::Interval]
23
+ required :interval, enum: -> { OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval }
24
+
25
+ # @!attribute threshold_amount
26
+ # The hard spend limit amount, in cents.
27
+ #
28
+ # @return [Integer]
29
+ required :threshold_amount, Integer
30
+
31
+ # @!method initialize(currency:, interval:, threshold_amount:, request_options: {})
32
+ # Some parameter documentations has been truncated, see
33
+ # {OpenAI::Models::Admin::Organization::SpendLimitUpdateParams} for more details.
34
+ #
35
+ # @param currency [Symbol, OpenAI::Models::Admin::Organization::SpendLimitUpdateParams::Currency] The currency for the threshold amount. Currently, only `USD` is supported.
36
+ #
37
+ # @param interval [Symbol, OpenAI::Models::Admin::Organization::SpendLimitUpdateParams::Interval] The time interval for evaluating spend against the threshold. Currently, only `m
38
+ #
39
+ # @param threshold_amount [Integer] The hard spend limit amount, in cents.
40
+ #
41
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
42
+
43
+ # The currency for the threshold amount. Currently, only `USD` is supported.
44
+ module Currency
45
+ extend OpenAI::Internal::Type::Enum
46
+
47
+ USD = :USD
48
+
49
+ # @!method self.values
50
+ # @return [Array<Symbol>]
51
+ end
52
+
53
+ # The time interval for evaluating spend against the threshold. Currently, only
54
+ # `month` is supported.
55
+ module Interval
56
+ extend OpenAI::Internal::Type::Enum
57
+
58
+ MONTH = :month
59
+
60
+ # @!method self.values
61
+ # @return [Array<Symbol>]
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -113,8 +113,9 @@ module OpenAI
113
113
 
114
114
  class OrganizationUsageCompletionsResult < OpenAI::Internal::Type::BaseModel
115
115
  # @!attribute input_tokens
116
- # The aggregated number of text input tokens used, including cached tokens. For
117
- # customers subscribe to scale tier, this includes scale tier tokens.
116
+ # The aggregated number of input tokens used, including cached and cache-write
117
+ # tokens. This includes text, audio, and image tokens. For customers subscribed to
118
+ # Scale Tier, this includes Scale Tier tokens.
118
119
  #
119
120
  # @return [Integer]
120
121
  required :input_tokens, Integer
@@ -131,8 +132,9 @@ module OpenAI
131
132
  required :object, const: :"organization.usage.completions.result"
132
133
 
133
134
  # @!attribute output_tokens
134
- # The aggregated number of text output tokens used. For customers subscribe to
135
- # scale tier, this includes scale tier tokens.
135
+ # The aggregated number of output tokens used across text, audio, and image
136
+ # outputs. For customers subscribed to Scale Tier, this includes Scale Tier
137
+ # tokens.
136
138
  #
137
139
  # @return [Integer]
138
140
  required :output_tokens, Integer
@@ -152,19 +154,62 @@ module OpenAI
152
154
  optional :batch, OpenAI::Internal::Type::Boolean, nil?: true
153
155
 
154
156
  # @!attribute input_audio_tokens
155
- # The aggregated number of audio input tokens used, including cached tokens.
157
+ # The aggregated number of uncached audio input tokens used.
156
158
  #
157
159
  # @return [Integer, nil]
158
160
  optional :input_audio_tokens, Integer
159
161
 
162
+ # @!attribute input_cache_write_tokens
163
+ # The aggregated number of input tokens written to the cache.
164
+ #
165
+ # @return [Integer, nil]
166
+ optional :input_cache_write_tokens, Integer
167
+
168
+ # @!attribute input_cached_audio_tokens
169
+ # The aggregated number of cached audio input tokens used.
170
+ #
171
+ # @return [Integer, nil]
172
+ optional :input_cached_audio_tokens, Integer
173
+
174
+ # @!attribute input_cached_image_tokens
175
+ # The aggregated number of cached image input tokens used.
176
+ #
177
+ # @return [Integer, nil]
178
+ optional :input_cached_image_tokens, Integer
179
+
180
+ # @!attribute input_cached_text_tokens
181
+ # The aggregated number of cached text input tokens used.
182
+ #
183
+ # @return [Integer, nil]
184
+ optional :input_cached_text_tokens, Integer
185
+
160
186
  # @!attribute input_cached_tokens
161
- # The aggregated number of text input tokens that has been cached from previous
162
- # requests. For customers subscribe to scale tier, this includes scale tier
163
- # tokens.
187
+ # The aggregated number of cached input tokens used across text, audio, and image
188
+ # inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
164
189
  #
165
190
  # @return [Integer, nil]
166
191
  optional :input_cached_tokens, Integer
167
192
 
193
+ # @!attribute input_image_tokens
194
+ # The aggregated number of uncached image input tokens used.
195
+ #
196
+ # @return [Integer, nil]
197
+ optional :input_image_tokens, Integer
198
+
199
+ # @!attribute input_text_tokens
200
+ # The aggregated number of uncached text input tokens used, excluding cache-write
201
+ # tokens.
202
+ #
203
+ # @return [Integer, nil]
204
+ optional :input_text_tokens, Integer
205
+
206
+ # @!attribute input_uncached_tokens
207
+ # The aggregated number of uncached input tokens used across text, audio, and
208
+ # image inputs, excluding cache-write tokens.
209
+ #
210
+ # @return [Integer, nil]
211
+ optional :input_uncached_tokens, Integer
212
+
168
213
  # @!attribute model
169
214
  # When `group_by=model`, this field provides the model name of the grouped usage
170
215
  # result.
@@ -178,6 +223,18 @@ module OpenAI
178
223
  # @return [Integer, nil]
179
224
  optional :output_audio_tokens, Integer
180
225
 
226
+ # @!attribute output_image_tokens
227
+ # The aggregated number of image output tokens used.
228
+ #
229
+ # @return [Integer, nil]
230
+ optional :output_image_tokens, Integer
231
+
232
+ # @!attribute output_text_tokens
233
+ # The aggregated number of text output tokens used.
234
+ #
235
+ # @return [Integer, nil]
236
+ optional :output_text_tokens, Integer
237
+
181
238
  # @!attribute project_id
182
239
  # When `group_by=project_id`, this field provides the project ID of the grouped
183
240
  # usage result.
@@ -199,31 +256,49 @@ module OpenAI
199
256
  # @return [String, nil]
200
257
  optional :user_id, String, nil?: true
201
258
 
202
- # @!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")
259
+ # @!method initialize(input_tokens:, num_model_requests:, output_tokens:, api_key_id: nil, batch: nil, input_audio_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")
203
260
  # Some parameter documentations has been truncated, see
204
261
  # {OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult}
205
262
  # for more details.
206
263
  #
207
264
  # The aggregated completions usage details of the specific time bucket.
208
265
  #
209
- # @param input_tokens [Integer] The aggregated number of text input tokens used, including cached tokens. For cu
266
+ # @param input_tokens [Integer] The aggregated number of input tokens used, including cached and cache-write tok
210
267
  #
211
268
  # @param num_model_requests [Integer] The count of requests made to the model.
212
269
  #
213
- # @param output_tokens [Integer] The aggregated number of text output tokens used. For customers subscribe to sca
270
+ # @param output_tokens [Integer] The aggregated number of output tokens used across text, audio, and image output
214
271
  #
215
272
  # @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
216
273
  #
217
274
  # @param batch [Boolean, nil] When `group_by=batch`, this field tells whether the grouped usage result is batc
218
275
  #
219
- # @param input_audio_tokens [Integer] The aggregated number of audio input tokens used, including cached tokens.
276
+ # @param input_audio_tokens [Integer] The aggregated number of uncached audio input tokens used.
220
277
  #
221
- # @param input_cached_tokens [Integer] The aggregated number of text input tokens that has been cached from previous re
278
+ # @param input_cache_write_tokens [Integer] The aggregated number of input tokens written to the cache.
279
+ #
280
+ # @param input_cached_audio_tokens [Integer] The aggregated number of cached audio input tokens used.
281
+ #
282
+ # @param input_cached_image_tokens [Integer] The aggregated number of cached image input tokens used.
283
+ #
284
+ # @param input_cached_text_tokens [Integer] The aggregated number of cached text input tokens used.
285
+ #
286
+ # @param input_cached_tokens [Integer] The aggregated number of cached input tokens used across text, audio, and image
287
+ #
288
+ # @param input_image_tokens [Integer] The aggregated number of uncached image input tokens used.
289
+ #
290
+ # @param input_text_tokens [Integer] The aggregated number of uncached text input tokens used, excluding cache-write
291
+ #
292
+ # @param input_uncached_tokens [Integer] The aggregated number of uncached input tokens used across text, audio, and imag
222
293
  #
223
294
  # @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
224
295
  #
225
296
  # @param output_audio_tokens [Integer] The aggregated number of audio output tokens used.
226
297
  #
298
+ # @param output_image_tokens [Integer] The aggregated number of image output tokens used.
299
+ #
300
+ # @param output_text_tokens [Integer] The aggregated number of text output tokens used.
301
+ #
227
302
  # @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
228
303
  #
229
304
  # @param service_tier [String, nil] When `group_by=service_tier`, this field provides the service tier of the groupe
@@ -113,8 +113,9 @@ module OpenAI
113
113
 
114
114
  class OrganizationUsageCompletionsResult < OpenAI::Internal::Type::BaseModel
115
115
  # @!attribute input_tokens
116
- # The aggregated number of text input tokens used, including cached tokens. For
117
- # customers subscribe to scale tier, this includes scale tier tokens.
116
+ # The aggregated number of input tokens used, including cached and cache-write
117
+ # tokens. This includes text, audio, and image tokens. For customers subscribed to
118
+ # Scale Tier, this includes Scale Tier tokens.
118
119
  #
119
120
  # @return [Integer]
120
121
  required :input_tokens, Integer
@@ -131,8 +132,9 @@ module OpenAI
131
132
  required :object, const: :"organization.usage.completions.result"
132
133
 
133
134
  # @!attribute output_tokens
134
- # The aggregated number of text output tokens used. For customers subscribe to
135
- # scale tier, this includes scale tier tokens.
135
+ # The aggregated number of output tokens used across text, audio, and image
136
+ # outputs. For customers subscribed to Scale Tier, this includes Scale Tier
137
+ # tokens.
136
138
  #
137
139
  # @return [Integer]
138
140
  required :output_tokens, Integer
@@ -152,19 +154,62 @@ module OpenAI
152
154
  optional :batch, OpenAI::Internal::Type::Boolean, nil?: true
153
155
 
154
156
  # @!attribute input_audio_tokens
155
- # The aggregated number of audio input tokens used, including cached tokens.
157
+ # The aggregated number of uncached audio input tokens used.
156
158
  #
157
159
  # @return [Integer, nil]
158
160
  optional :input_audio_tokens, Integer
159
161
 
162
+ # @!attribute input_cache_write_tokens
163
+ # The aggregated number of input tokens written to the cache.
164
+ #
165
+ # @return [Integer, nil]
166
+ optional :input_cache_write_tokens, Integer
167
+
168
+ # @!attribute input_cached_audio_tokens
169
+ # The aggregated number of cached audio input tokens used.
170
+ #
171
+ # @return [Integer, nil]
172
+ optional :input_cached_audio_tokens, Integer
173
+
174
+ # @!attribute input_cached_image_tokens
175
+ # The aggregated number of cached image input tokens used.
176
+ #
177
+ # @return [Integer, nil]
178
+ optional :input_cached_image_tokens, Integer
179
+
180
+ # @!attribute input_cached_text_tokens
181
+ # The aggregated number of cached text input tokens used.
182
+ #
183
+ # @return [Integer, nil]
184
+ optional :input_cached_text_tokens, Integer
185
+
160
186
  # @!attribute input_cached_tokens
161
- # The aggregated number of text input tokens that has been cached from previous
162
- # requests. For customers subscribe to scale tier, this includes scale tier
163
- # tokens.
187
+ # The aggregated number of cached input tokens used across text, audio, and image
188
+ # inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
164
189
  #
165
190
  # @return [Integer, nil]
166
191
  optional :input_cached_tokens, Integer
167
192
 
193
+ # @!attribute input_image_tokens
194
+ # The aggregated number of uncached image input tokens used.
195
+ #
196
+ # @return [Integer, nil]
197
+ optional :input_image_tokens, Integer
198
+
199
+ # @!attribute input_text_tokens
200
+ # The aggregated number of uncached text input tokens used, excluding cache-write
201
+ # tokens.
202
+ #
203
+ # @return [Integer, nil]
204
+ optional :input_text_tokens, Integer
205
+
206
+ # @!attribute input_uncached_tokens
207
+ # The aggregated number of uncached input tokens used across text, audio, and
208
+ # image inputs, excluding cache-write tokens.
209
+ #
210
+ # @return [Integer, nil]
211
+ optional :input_uncached_tokens, Integer
212
+
168
213
  # @!attribute model
169
214
  # When `group_by=model`, this field provides the model name of the grouped usage
170
215
  # result.
@@ -178,6 +223,18 @@ module OpenAI
178
223
  # @return [Integer, nil]
179
224
  optional :output_audio_tokens, Integer
180
225
 
226
+ # @!attribute output_image_tokens
227
+ # The aggregated number of image output tokens used.
228
+ #
229
+ # @return [Integer, nil]
230
+ optional :output_image_tokens, Integer
231
+
232
+ # @!attribute output_text_tokens
233
+ # The aggregated number of text output tokens used.
234
+ #
235
+ # @return [Integer, nil]
236
+ optional :output_text_tokens, Integer
237
+
181
238
  # @!attribute project_id
182
239
  # When `group_by=project_id`, this field provides the project ID of the grouped
183
240
  # usage result.
@@ -199,31 +256,49 @@ module OpenAI
199
256
  # @return [String, nil]
200
257
  optional :user_id, String, nil?: true
201
258
 
202
- # @!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")
259
+ # @!method initialize(input_tokens:, num_model_requests:, output_tokens:, api_key_id: nil, batch: nil, input_audio_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")
203
260
  # Some parameter documentations has been truncated, see
204
261
  # {OpenAI::Models::Admin::Organization::UsageAudioTranscriptionsResponse::Data::Result::OrganizationUsageCompletionsResult}
205
262
  # for more details.
206
263
  #
207
264
  # The aggregated completions usage details of the specific time bucket.
208
265
  #
209
- # @param input_tokens [Integer] The aggregated number of text input tokens used, including cached tokens. For cu
266
+ # @param input_tokens [Integer] The aggregated number of input tokens used, including cached and cache-write tok
210
267
  #
211
268
  # @param num_model_requests [Integer] The count of requests made to the model.
212
269
  #
213
- # @param output_tokens [Integer] The aggregated number of text output tokens used. For customers subscribe to sca
270
+ # @param output_tokens [Integer] The aggregated number of output tokens used across text, audio, and image output
214
271
  #
215
272
  # @param api_key_id [String, nil] When `group_by=api_key_id`, this field provides the API key ID of the grouped us
216
273
  #
217
274
  # @param batch [Boolean, nil] When `group_by=batch`, this field tells whether the grouped usage result is batc
218
275
  #
219
- # @param input_audio_tokens [Integer] The aggregated number of audio input tokens used, including cached tokens.
276
+ # @param input_audio_tokens [Integer] The aggregated number of uncached audio input tokens used.
220
277
  #
221
- # @param input_cached_tokens [Integer] The aggregated number of text input tokens that has been cached from previous re
278
+ # @param input_cache_write_tokens [Integer] The aggregated number of input tokens written to the cache.
279
+ #
280
+ # @param input_cached_audio_tokens [Integer] The aggregated number of cached audio input tokens used.
281
+ #
282
+ # @param input_cached_image_tokens [Integer] The aggregated number of cached image input tokens used.
283
+ #
284
+ # @param input_cached_text_tokens [Integer] The aggregated number of cached text input tokens used.
285
+ #
286
+ # @param input_cached_tokens [Integer] The aggregated number of cached input tokens used across text, audio, and image
287
+ #
288
+ # @param input_image_tokens [Integer] The aggregated number of uncached image input tokens used.
289
+ #
290
+ # @param input_text_tokens [Integer] The aggregated number of uncached text input tokens used, excluding cache-write
291
+ #
292
+ # @param input_uncached_tokens [Integer] The aggregated number of uncached input tokens used across text, audio, and imag
222
293
  #
223
294
  # @param model [String, nil] When `group_by=model`, this field provides the model name of the grouped usage r
224
295
  #
225
296
  # @param output_audio_tokens [Integer] The aggregated number of audio output tokens used.
226
297
  #
298
+ # @param output_image_tokens [Integer] The aggregated number of image output tokens used.
299
+ #
300
+ # @param output_text_tokens [Integer] The aggregated number of text output tokens used.
301
+ #
227
302
  # @param project_id [String, nil] When `group_by=project_id`, this field provides the project ID of the grouped us
228
303
  #
229
304
  # @param service_tier [String, nil] When `group_by=service_tier`, this field provides the service tier of the groupe