openai 0.71.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/lib/openai/models/admin/organization/organization_spend_limit.rb +151 -0
- data/lib/openai/models/admin/organization/organization_spend_limit_deleted.rb +33 -0
- data/lib/openai/models/admin/organization/projects/project_spend_limit.rb +155 -0
- data/lib/openai/models/admin/organization/projects/project_spend_limit_deleted.rb +35 -0
- data/lib/openai/models/admin/organization/projects/spend_limit_delete_params.rb +26 -0
- data/lib/openai/models/admin/organization/projects/spend_limit_retrieve_params.rb +26 -0
- data/lib/openai/models/admin/organization/projects/spend_limit_update_params.rb +77 -0
- data/lib/openai/models/admin/organization/spend_limit_delete_params.rb +18 -0
- data/lib/openai/models/admin/organization/spend_limit_retrieve_params.rb +18 -0
- data/lib/openai/models/admin/organization/spend_limit_update_params.rb +67 -0
- data/lib/openai/models/beta/beta_response.rb +12 -6
- data/lib/openai/models/beta/beta_response_error.rb +1 -0
- data/lib/openai/models/beta/beta_response_text_config.rb +4 -2
- data/lib/openai/models/beta/beta_responses_client_event.rb +12 -6
- data/lib/openai/models/beta/response_create_params.rb +12 -6
- data/lib/openai/models/beta/responses/input_token_count_params.rb +12 -4
- data/lib/openai/models/chat/completion_create_params.rb +8 -6
- data/lib/openai/models/reasoning.rb +8 -2
- data/lib/openai/models/responses/input_token_count_params.rb +4 -2
- data/lib/openai/models/responses/response.rb +4 -4
- data/lib/openai/models/responses/response_create_params.rb +4 -4
- data/lib/openai/models/responses/response_error.rb +1 -0
- data/lib/openai/models/responses/response_text_config.rb +4 -2
- data/lib/openai/models/responses/responses_client_event.rb +4 -4
- data/lib/openai/resources/admin/organization/projects/spend_limit.rb +95 -0
- data/lib/openai/resources/admin/organization/projects.rb +4 -0
- data/lib/openai/resources/admin/organization/spend_limit.rb +86 -0
- data/lib/openai/resources/admin/organization.rb +4 -0
- data/lib/openai/resources/beta/responses.rb +4 -4
- data/lib/openai/resources/chat/completions.rb +4 -4
- data/lib/openai/resources/responses.rb +4 -4
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +12 -0
- data/rbi/openai/models/admin/organization/organization_spend_limit.rbi +278 -0
- data/rbi/openai/models/admin/organization/organization_spend_limit_deleted.rbi +48 -0
- data/rbi/openai/models/admin/organization/projects/project_spend_limit.rbi +280 -0
- data/rbi/openai/models/admin/organization/projects/project_spend_limit_deleted.rbi +49 -0
- data/rbi/openai/models/admin/organization/projects/spend_limit_delete_params.rbi +44 -0
- data/rbi/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbi +44 -0
- data/rbi/openai/models/admin/organization/projects/spend_limit_update_params.rbi +149 -0
- data/rbi/openai/models/admin/organization/spend_limit_delete_params.rbi +34 -0
- data/rbi/openai/models/admin/organization/spend_limit_retrieve_params.rbi +34 -0
- data/rbi/openai/models/admin/organization/spend_limit_update_params.rbi +141 -0
- data/rbi/openai/models/beta/beta_response.rbi +18 -15
- data/rbi/openai/models/beta/beta_response_error.rbi +5 -0
- data/rbi/openai/models/beta/beta_response_text_config.rbi +6 -3
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +18 -15
- data/rbi/openai/models/beta/response_create_params.rbi +18 -15
- data/rbi/openai/models/beta/responses/input_token_count_params.rbi +18 -6
- data/rbi/openai/models/chat/completion_create_params.rbi +12 -15
- data/rbi/openai/models/reasoning.rbi +12 -3
- data/rbi/openai/models/responses/input_token_count_params.rbi +6 -3
- data/rbi/openai/models/responses/response.rbi +6 -12
- data/rbi/openai/models/responses/response_create_params.rbi +6 -12
- data/rbi/openai/models/responses/response_error.rbi +5 -0
- data/rbi/openai/models/responses/response_text_config.rbi +6 -3
- data/rbi/openai/models/responses/responses_client_event.rbi +6 -12
- data/rbi/openai/resources/admin/organization/projects/spend_limit.rbi +78 -0
- data/rbi/openai/resources/admin/organization/projects.rbi +7 -0
- data/rbi/openai/resources/admin/organization/spend_limit.rbi +57 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -0
- data/rbi/openai/resources/beta/responses.rbi +4 -4
- data/rbi/openai/resources/chat/completions.rbi +8 -6
- data/rbi/openai/resources/responses.rbi +4 -4
- data/sig/openai/models/admin/organization/organization_spend_limit.rbs +94 -0
- data/sig/openai/models/admin/organization/organization_spend_limit_deleted.rbs +28 -0
- data/sig/openai/models/admin/organization/projects/project_spend_limit.rbs +96 -0
- data/sig/openai/models/admin/organization/projects/project_spend_limit_deleted.rbs +30 -0
- data/sig/openai/models/admin/organization/projects/spend_limit_delete_params.rbs +29 -0
- data/sig/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbs +29 -0
- data/sig/openai/models/admin/organization/projects/spend_limit_update_params.rbs +67 -0
- data/sig/openai/models/admin/organization/spend_limit_delete_params.rbs +19 -0
- data/sig/openai/models/admin/organization/spend_limit_retrieve_params.rbs +19 -0
- data/sig/openai/models/admin/organization/spend_limit_update_params.rbs +60 -0
- data/sig/openai/models/beta/beta_response.rbs +8 -12
- data/sig/openai/models/beta/beta_response_error.rbs +2 -0
- data/sig/openai/models/beta/beta_responses_client_event.rbs +8 -12
- data/sig/openai/models/beta/response_create_params.rbs +8 -12
- data/sig/openai/models/chat/completion_create_params.rbs +8 -12
- data/sig/openai/models/responses/response.rbs +8 -12
- data/sig/openai/models/responses/response_create_params.rbs +8 -12
- data/sig/openai/models/responses/response_error.rbs +2 -0
- data/sig/openai/models/responses/responses_client_event.rbs +8 -12
- data/sig/openai/resources/admin/organization/projects/spend_limit.rbs +31 -0
- data/sig/openai/resources/admin/organization/projects.rbs +2 -0
- data/sig/openai/resources/admin/organization/spend_limit.rbs +26 -0
- data/sig/openai/resources/admin/organization.rbs +2 -0
- data/sig/openai/resources/beta/responses.rbs +4 -4
- data/sig/openai/resources/chat/completions.rbs +4 -4
- data/sig/openai/resources/responses.rbs +4 -4
- metadata +38 -2
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Admin
|
|
6
|
+
class Organization
|
|
7
|
+
class SpendLimit
|
|
8
|
+
# Get the organization's hard spend limit.
|
|
9
|
+
#
|
|
10
|
+
# @overload retrieve(request_options: {})
|
|
11
|
+
#
|
|
12
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
13
|
+
#
|
|
14
|
+
# @return [OpenAI::Models::Admin::Organization::OrganizationSpendLimit]
|
|
15
|
+
#
|
|
16
|
+
# @see OpenAI::Models::Admin::Organization::SpendLimitRetrieveParams
|
|
17
|
+
def retrieve(params = {})
|
|
18
|
+
@client.request(
|
|
19
|
+
method: :get,
|
|
20
|
+
path: "organization/spend_limit",
|
|
21
|
+
model: OpenAI::Admin::Organization::OrganizationSpendLimit,
|
|
22
|
+
security: {admin_api_key_auth: true},
|
|
23
|
+
options: params[:request_options]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {OpenAI::Models::Admin::Organization::SpendLimitUpdateParams} for more details.
|
|
29
|
+
#
|
|
30
|
+
# Create or replace the organization's hard spend limit.
|
|
31
|
+
#
|
|
32
|
+
# @overload update(currency:, interval:, threshold_amount:, request_options: {})
|
|
33
|
+
#
|
|
34
|
+
# @param currency [Symbol, OpenAI::Models::Admin::Organization::SpendLimitUpdateParams::Currency] The currency for the threshold amount. Currently, only `USD` is supported.
|
|
35
|
+
#
|
|
36
|
+
# @param interval [Symbol, OpenAI::Models::Admin::Organization::SpendLimitUpdateParams::Interval] The time interval for evaluating spend against the threshold. Currently, only `m
|
|
37
|
+
#
|
|
38
|
+
# @param threshold_amount [Integer] The hard spend limit amount, in cents.
|
|
39
|
+
#
|
|
40
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
41
|
+
#
|
|
42
|
+
# @return [OpenAI::Models::Admin::Organization::OrganizationSpendLimit]
|
|
43
|
+
#
|
|
44
|
+
# @see OpenAI::Models::Admin::Organization::SpendLimitUpdateParams
|
|
45
|
+
def update(params)
|
|
46
|
+
parsed, options = OpenAI::Admin::Organization::SpendLimitUpdateParams.dump_request(params)
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :post,
|
|
49
|
+
path: "organization/spend_limit",
|
|
50
|
+
body: parsed,
|
|
51
|
+
model: OpenAI::Admin::Organization::OrganizationSpendLimit,
|
|
52
|
+
security: {admin_api_key_auth: true},
|
|
53
|
+
options: options
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Delete the organization's hard spend limit.
|
|
58
|
+
#
|
|
59
|
+
# @overload delete(request_options: {})
|
|
60
|
+
#
|
|
61
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
62
|
+
#
|
|
63
|
+
# @return [OpenAI::Models::Admin::Organization::OrganizationSpendLimitDeleted]
|
|
64
|
+
#
|
|
65
|
+
# @see OpenAI::Models::Admin::Organization::SpendLimitDeleteParams
|
|
66
|
+
def delete(params = {})
|
|
67
|
+
@client.request(
|
|
68
|
+
method: :delete,
|
|
69
|
+
path: "organization/spend_limit",
|
|
70
|
+
model: OpenAI::Admin::Organization::OrganizationSpendLimitDeleted,
|
|
71
|
+
security: {admin_api_key_auth: true},
|
|
72
|
+
options: params[:request_options]
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# @api private
|
|
77
|
+
#
|
|
78
|
+
# @param client [OpenAI::Client]
|
|
79
|
+
def initialize(client:)
|
|
80
|
+
@client = client
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -29,6 +29,9 @@ module OpenAI
|
|
|
29
29
|
# @return [OpenAI::Resources::Admin::Organization::DataRetention]
|
|
30
30
|
attr_reader :data_retention
|
|
31
31
|
|
|
32
|
+
# @return [OpenAI::Resources::Admin::Organization::SpendLimit]
|
|
33
|
+
attr_reader :spend_limit
|
|
34
|
+
|
|
32
35
|
# @return [OpenAI::Resources::Admin::Organization::SpendAlerts]
|
|
33
36
|
attr_reader :spend_alerts
|
|
34
37
|
|
|
@@ -51,6 +54,7 @@ module OpenAI
|
|
|
51
54
|
@groups = OpenAI::Resources::Admin::Organization::Groups.new(client: client)
|
|
52
55
|
@roles = OpenAI::Resources::Admin::Organization::Roles.new(client: client)
|
|
53
56
|
@data_retention = OpenAI::Resources::Admin::Organization::DataRetention.new(client: client)
|
|
57
|
+
@spend_limit = OpenAI::Resources::Admin::Organization::SpendLimit.new(client: client)
|
|
54
58
|
@spend_alerts = OpenAI::Resources::Admin::Organization::SpendAlerts.new(client: client)
|
|
55
59
|
@certificates = OpenAI::Resources::Admin::Organization::Certificates.new(client: client)
|
|
56
60
|
@projects = OpenAI::Resources::Admin::Organization::Projects.new(client: client)
|
|
@@ -59,7 +59,7 @@ module OpenAI
|
|
|
59
59
|
#
|
|
60
60
|
# @param prompt [OpenAI::Models::Beta::BetaResponsePrompt, nil] Body param: Reference to a prompt template and its variables.
|
|
61
61
|
#
|
|
62
|
-
# @param prompt_cache_key [String] Body param: Used by OpenAI to cache responses for similar requests to optimize y
|
|
62
|
+
# @param prompt_cache_key [String, nil] Body param: Used by OpenAI to cache responses for similar requests to optimize y
|
|
63
63
|
#
|
|
64
64
|
# @param prompt_cache_options [OpenAI::Models::Beta::ResponseCreateParams::PromptCacheOptions] Body param: Options for prompt caching. Supported for `gpt-5.6` and later models
|
|
65
65
|
#
|
|
@@ -67,7 +67,7 @@ module OpenAI
|
|
|
67
67
|
#
|
|
68
68
|
# @param reasoning [OpenAI::Models::Beta::ResponseCreateParams::Reasoning, nil] Body param: **gpt-5 and o-series models only**
|
|
69
69
|
#
|
|
70
|
-
# @param safety_identifier [String] Body param: A stable identifier used to help detect users of your application th
|
|
70
|
+
# @param safety_identifier [String, nil] Body param: A stable identifier used to help detect users of your application th
|
|
71
71
|
#
|
|
72
72
|
# @param service_tier [Symbol, OpenAI::Models::Beta::ResponseCreateParams::ServiceTier, nil] Body param: Specifies the processing type used for serving the request.
|
|
73
73
|
#
|
|
@@ -165,7 +165,7 @@ module OpenAI
|
|
|
165
165
|
#
|
|
166
166
|
# @param prompt [OpenAI::Models::Beta::BetaResponsePrompt, nil] Body param: Reference to a prompt template and its variables.
|
|
167
167
|
#
|
|
168
|
-
# @param prompt_cache_key [String] Body param: Used by OpenAI to cache responses for similar requests to optimize y
|
|
168
|
+
# @param prompt_cache_key [String, nil] Body param: Used by OpenAI to cache responses for similar requests to optimize y
|
|
169
169
|
#
|
|
170
170
|
# @param prompt_cache_options [OpenAI::Models::Beta::ResponseCreateParams::PromptCacheOptions] Body param: Options for prompt caching. Supported for `gpt-5.6` and later models
|
|
171
171
|
#
|
|
@@ -173,7 +173,7 @@ module OpenAI
|
|
|
173
173
|
#
|
|
174
174
|
# @param reasoning [OpenAI::Models::Beta::ResponseCreateParams::Reasoning, nil] Body param: **gpt-5 and o-series models only**
|
|
175
175
|
#
|
|
176
|
-
# @param safety_identifier [String] Body param: A stable identifier used to help detect users of your application th
|
|
176
|
+
# @param safety_identifier [String, nil] Body param: A stable identifier used to help detect users of your application th
|
|
177
177
|
#
|
|
178
178
|
# @param service_tier [Symbol, OpenAI::Models::Beta::ResponseCreateParams::ServiceTier, nil] Body param: Specifies the processing type used for serving the request.
|
|
179
179
|
#
|
|
@@ -73,7 +73,7 @@ module OpenAI
|
|
|
73
73
|
#
|
|
74
74
|
# @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
75
75
|
#
|
|
76
|
-
# @param prompt_cache_key [String] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
76
|
+
# @param prompt_cache_key [String, nil] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
77
77
|
#
|
|
78
78
|
# @param prompt_cache_options [OpenAI::Models::Chat::CompletionCreateParams::PromptCacheOptions] Options for prompt caching. Supported for `gpt-5.6` and later models. By default
|
|
79
79
|
#
|
|
@@ -83,7 +83,7 @@ module OpenAI
|
|
|
83
83
|
#
|
|
84
84
|
# @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output.
|
|
85
85
|
#
|
|
86
|
-
# @param safety_identifier [String] A stable identifier used to help detect users of your application that may be vi
|
|
86
|
+
# @param safety_identifier [String, nil] A stable identifier used to help detect users of your application that may be vi
|
|
87
87
|
#
|
|
88
88
|
# @param seed [Integer, nil] This feature is in Beta.
|
|
89
89
|
#
|
|
@@ -329,7 +329,7 @@ module OpenAI
|
|
|
329
329
|
#
|
|
330
330
|
# @param presence_penalty [Float, nil] Number between -2.0 and 2.0. Positive values penalize new tokens based on
|
|
331
331
|
#
|
|
332
|
-
# @param prompt_cache_key [String] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
332
|
+
# @param prompt_cache_key [String, nil] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
333
333
|
#
|
|
334
334
|
# @param prompt_cache_options [OpenAI::Models::Chat::CompletionCreateParams::PromptCacheOptions] Options for prompt caching. Supported for `gpt-5.6` and later models. By default
|
|
335
335
|
#
|
|
@@ -339,7 +339,7 @@ module OpenAI
|
|
|
339
339
|
#
|
|
340
340
|
# @param response_format [OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject] An object specifying the format that the model must output.
|
|
341
341
|
#
|
|
342
|
-
# @param safety_identifier [String] A stable identifier used to help detect users of your application that may be vi
|
|
342
|
+
# @param safety_identifier [String, nil] A stable identifier used to help detect users of your application that may be vi
|
|
343
343
|
#
|
|
344
344
|
# @param seed [Integer, nil] This feature is in Beta.
|
|
345
345
|
#
|
|
@@ -56,7 +56,7 @@ module OpenAI
|
|
|
56
56
|
#
|
|
57
57
|
# @param prompt [OpenAI::Models::Responses::ResponsePrompt, nil] Reference to a prompt template and its variables.
|
|
58
58
|
#
|
|
59
|
-
# @param prompt_cache_key [String] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
59
|
+
# @param prompt_cache_key [String, nil] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
60
60
|
#
|
|
61
61
|
# @param prompt_cache_options [OpenAI::Models::Responses::ResponseCreateParams::PromptCacheOptions] Options for prompt caching. Supported for `gpt-5.6` and later models. By default
|
|
62
62
|
#
|
|
@@ -64,7 +64,7 @@ module OpenAI
|
|
|
64
64
|
#
|
|
65
65
|
# @param reasoning [OpenAI::Models::Reasoning, nil] **gpt-5 and o-series models only**
|
|
66
66
|
#
|
|
67
|
-
# @param safety_identifier [String] A stable identifier used to help detect users of your application that may be vi
|
|
67
|
+
# @param safety_identifier [String, nil] A stable identifier used to help detect users of your application that may be vi
|
|
68
68
|
#
|
|
69
69
|
# @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] Specifies the processing type used for serving the request.
|
|
70
70
|
#
|
|
@@ -287,7 +287,7 @@ module OpenAI
|
|
|
287
287
|
#
|
|
288
288
|
# @param prompt [OpenAI::Models::Responses::ResponsePrompt, nil] Reference to a prompt template and its variables.
|
|
289
289
|
#
|
|
290
|
-
# @param prompt_cache_key [String] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
290
|
+
# @param prompt_cache_key [String, nil] Used by OpenAI to cache responses for similar requests to optimize your cache hi
|
|
291
291
|
#
|
|
292
292
|
# @param prompt_cache_options [OpenAI::Models::Responses::ResponseCreateParams::PromptCacheOptions] Options for prompt caching. Supported for `gpt-5.6` and later models. By default
|
|
293
293
|
#
|
|
@@ -295,7 +295,7 @@ module OpenAI
|
|
|
295
295
|
#
|
|
296
296
|
# @param reasoning [OpenAI::Models::Reasoning, nil] **gpt-5 and o-series models only**
|
|
297
297
|
#
|
|
298
|
-
# @param safety_identifier [String] A stable identifier used to help detect users of your application that may be vi
|
|
298
|
+
# @param safety_identifier [String, nil] A stable identifier used to help detect users of your application that may be vi
|
|
299
299
|
#
|
|
300
300
|
# @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCreateParams::ServiceTier, nil] Specifies the processing type used for serving the request.
|
|
301
301
|
#
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -147,6 +147,8 @@ require_relative "openai/models/admin/organization/invite_retrieve_params"
|
|
|
147
147
|
require_relative "openai/models/admin/organization/organization_data_retention"
|
|
148
148
|
require_relative "openai/models/admin/organization/organization_spend_alert"
|
|
149
149
|
require_relative "openai/models/admin/organization/organization_spend_alert_deleted"
|
|
150
|
+
require_relative "openai/models/admin/organization/organization_spend_limit"
|
|
151
|
+
require_relative "openai/models/admin/organization/organization_spend_limit_deleted"
|
|
150
152
|
require_relative "openai/models/admin/organization/organization_user"
|
|
151
153
|
require_relative "openai/models/admin/organization/project"
|
|
152
154
|
require_relative "openai/models/admin/organization/project_archive_params"
|
|
@@ -193,6 +195,8 @@ require_relative "openai/models/admin/organization/projects/project_rate_limit"
|
|
|
193
195
|
require_relative "openai/models/admin/organization/projects/project_service_account"
|
|
194
196
|
require_relative "openai/models/admin/organization/projects/project_spend_alert"
|
|
195
197
|
require_relative "openai/models/admin/organization/projects/project_spend_alert_deleted"
|
|
198
|
+
require_relative "openai/models/admin/organization/projects/project_spend_limit"
|
|
199
|
+
require_relative "openai/models/admin/organization/projects/project_spend_limit_deleted"
|
|
196
200
|
require_relative "openai/models/admin/organization/projects/project_user"
|
|
197
201
|
require_relative "openai/models/admin/organization/projects/rate_limit_list_rate_limits_params"
|
|
198
202
|
require_relative "openai/models/admin/organization/projects/rate_limit_update_rate_limit_params"
|
|
@@ -216,6 +220,9 @@ require_relative "openai/models/admin/organization/projects/spend_alert_delete_p
|
|
|
216
220
|
require_relative "openai/models/admin/organization/projects/spend_alert_list_params"
|
|
217
221
|
require_relative "openai/models/admin/organization/projects/spend_alert_retrieve_params"
|
|
218
222
|
require_relative "openai/models/admin/organization/projects/spend_alert_update_params"
|
|
223
|
+
require_relative "openai/models/admin/organization/projects/spend_limit_delete_params"
|
|
224
|
+
require_relative "openai/models/admin/organization/projects/spend_limit_retrieve_params"
|
|
225
|
+
require_relative "openai/models/admin/organization/projects/spend_limit_update_params"
|
|
219
226
|
require_relative "openai/models/admin/organization/projects/user_create_params"
|
|
220
227
|
require_relative "openai/models/admin/organization/projects/user_delete_params"
|
|
221
228
|
require_relative "openai/models/admin/organization/projects/user_delete_response"
|
|
@@ -243,6 +250,9 @@ require_relative "openai/models/admin/organization/spend_alert_delete_params"
|
|
|
243
250
|
require_relative "openai/models/admin/organization/spend_alert_list_params"
|
|
244
251
|
require_relative "openai/models/admin/organization/spend_alert_retrieve_params"
|
|
245
252
|
require_relative "openai/models/admin/organization/spend_alert_update_params"
|
|
253
|
+
require_relative "openai/models/admin/organization/spend_limit_delete_params"
|
|
254
|
+
require_relative "openai/models/admin/organization/spend_limit_retrieve_params"
|
|
255
|
+
require_relative "openai/models/admin/organization/spend_limit_update_params"
|
|
246
256
|
require_relative "openai/models/admin/organization/usage_audio_speeches_params"
|
|
247
257
|
require_relative "openai/models/admin/organization/usage_audio_speeches_response"
|
|
248
258
|
require_relative "openai/models/admin/organization/usage_audio_transcriptions_params"
|
|
@@ -1169,10 +1179,12 @@ require_relative "openai/resources/admin/organization/projects/roles"
|
|
|
1169
1179
|
require_relative "openai/resources/admin/organization/projects/service_accounts"
|
|
1170
1180
|
require_relative "openai/resources/admin/organization/projects/service_accounts/api_keys"
|
|
1171
1181
|
require_relative "openai/resources/admin/organization/projects/spend_alerts"
|
|
1182
|
+
require_relative "openai/resources/admin/organization/projects/spend_limit"
|
|
1172
1183
|
require_relative "openai/resources/admin/organization/projects/users"
|
|
1173
1184
|
require_relative "openai/resources/admin/organization/projects/users/roles"
|
|
1174
1185
|
require_relative "openai/resources/admin/organization/roles"
|
|
1175
1186
|
require_relative "openai/resources/admin/organization/spend_alerts"
|
|
1187
|
+
require_relative "openai/resources/admin/organization/spend_limit"
|
|
1176
1188
|
require_relative "openai/resources/admin/organization/usage"
|
|
1177
1189
|
require_relative "openai/resources/admin/organization/users"
|
|
1178
1190
|
require_relative "openai/resources/admin/organization/users/roles"
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Admin
|
|
6
|
+
OrganizationSpendLimit = Organization::OrganizationSpendLimit
|
|
7
|
+
|
|
8
|
+
module Organization
|
|
9
|
+
class OrganizationSpendLimit < OpenAI::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit,
|
|
14
|
+
OpenAI::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# The currency for the threshold amount. Currently, only `USD` is supported.
|
|
19
|
+
sig do
|
|
20
|
+
returns(
|
|
21
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::Variants
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
attr_accessor :currency
|
|
25
|
+
|
|
26
|
+
# The current enforcement state of the hard spend limit.
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
attr_reader :enforcement
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
enforcement:
|
|
37
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::OrHash
|
|
38
|
+
).void
|
|
39
|
+
end
|
|
40
|
+
attr_writer :enforcement
|
|
41
|
+
|
|
42
|
+
# The time interval for evaluating spend against the threshold. Currently, only
|
|
43
|
+
# `month` is supported.
|
|
44
|
+
sig do
|
|
45
|
+
returns(
|
|
46
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::Variants
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
attr_accessor :interval
|
|
50
|
+
|
|
51
|
+
# The object type, which is always `organization.spend_limit`.
|
|
52
|
+
sig { returns(Symbol) }
|
|
53
|
+
attr_accessor :object
|
|
54
|
+
|
|
55
|
+
# The hard spend limit amount, in cents.
|
|
56
|
+
sig { returns(Integer) }
|
|
57
|
+
attr_accessor :threshold_amount
|
|
58
|
+
|
|
59
|
+
# Represents a hard spend limit configured at the organization level.
|
|
60
|
+
sig do
|
|
61
|
+
params(
|
|
62
|
+
currency:
|
|
63
|
+
T.any(
|
|
64
|
+
String,
|
|
65
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::OrSymbol
|
|
66
|
+
),
|
|
67
|
+
enforcement:
|
|
68
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::OrHash,
|
|
69
|
+
interval:
|
|
70
|
+
T.any(
|
|
71
|
+
String,
|
|
72
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::OrSymbol
|
|
73
|
+
),
|
|
74
|
+
threshold_amount: Integer,
|
|
75
|
+
object: Symbol
|
|
76
|
+
).returns(T.attached_class)
|
|
77
|
+
end
|
|
78
|
+
def self.new(
|
|
79
|
+
# The currency for the threshold amount. Currently, only `USD` is supported.
|
|
80
|
+
currency:,
|
|
81
|
+
# The current enforcement state of the hard spend limit.
|
|
82
|
+
enforcement:,
|
|
83
|
+
# The time interval for evaluating spend against the threshold. Currently, only
|
|
84
|
+
# `month` is supported.
|
|
85
|
+
interval:,
|
|
86
|
+
# The hard spend limit amount, in cents.
|
|
87
|
+
threshold_amount:,
|
|
88
|
+
# The object type, which is always `organization.spend_limit`.
|
|
89
|
+
object: :"organization.spend_limit"
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
sig do
|
|
94
|
+
override.returns(
|
|
95
|
+
{
|
|
96
|
+
currency:
|
|
97
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::Variants,
|
|
98
|
+
enforcement:
|
|
99
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement,
|
|
100
|
+
interval:
|
|
101
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::Variants,
|
|
102
|
+
object: Symbol,
|
|
103
|
+
threshold_amount: Integer
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
def to_hash
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# The currency for the threshold amount. Currently, only `USD` is supported.
|
|
111
|
+
module Currency
|
|
112
|
+
extend OpenAI::Internal::Type::Union
|
|
113
|
+
|
|
114
|
+
Variants =
|
|
115
|
+
T.type_alias do
|
|
116
|
+
T.any(
|
|
117
|
+
String,
|
|
118
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::TaggedSymbol
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
sig do
|
|
123
|
+
override.returns(
|
|
124
|
+
T::Array[
|
|
125
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::Variants
|
|
126
|
+
]
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
def self.variants
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
TaggedSymbol =
|
|
133
|
+
T.type_alias do
|
|
134
|
+
T.all(
|
|
135
|
+
Symbol,
|
|
136
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
140
|
+
|
|
141
|
+
USD =
|
|
142
|
+
T.let(
|
|
143
|
+
:USD,
|
|
144
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::TaggedSymbol
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
class Enforcement < OpenAI::Internal::Type::BaseModel
|
|
149
|
+
OrHash =
|
|
150
|
+
T.type_alias do
|
|
151
|
+
T.any(
|
|
152
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement,
|
|
153
|
+
OpenAI::Internal::AnyHash
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Whether the hard spend limit is currently enforcing.
|
|
158
|
+
sig do
|
|
159
|
+
returns(
|
|
160
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::Variants
|
|
161
|
+
)
|
|
162
|
+
end
|
|
163
|
+
attr_accessor :status
|
|
164
|
+
|
|
165
|
+
# The current enforcement state of the hard spend limit.
|
|
166
|
+
sig do
|
|
167
|
+
params(
|
|
168
|
+
status:
|
|
169
|
+
T.any(
|
|
170
|
+
String,
|
|
171
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::OrSymbol
|
|
172
|
+
)
|
|
173
|
+
).returns(T.attached_class)
|
|
174
|
+
end
|
|
175
|
+
def self.new(
|
|
176
|
+
# Whether the hard spend limit is currently enforcing.
|
|
177
|
+
status:
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
sig do
|
|
182
|
+
override.returns(
|
|
183
|
+
{
|
|
184
|
+
status:
|
|
185
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::Variants
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
end
|
|
189
|
+
def to_hash
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Whether the hard spend limit is currently enforcing.
|
|
193
|
+
module Status
|
|
194
|
+
extend OpenAI::Internal::Type::Union
|
|
195
|
+
|
|
196
|
+
Variants =
|
|
197
|
+
T.type_alias do
|
|
198
|
+
T.any(
|
|
199
|
+
String,
|
|
200
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::TaggedSymbol
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
sig do
|
|
205
|
+
override.returns(
|
|
206
|
+
T::Array[
|
|
207
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::Variants
|
|
208
|
+
]
|
|
209
|
+
)
|
|
210
|
+
end
|
|
211
|
+
def self.variants
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
TaggedSymbol =
|
|
215
|
+
T.type_alias do
|
|
216
|
+
T.all(
|
|
217
|
+
Symbol,
|
|
218
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
222
|
+
|
|
223
|
+
INACTIVE =
|
|
224
|
+
T.let(
|
|
225
|
+
:inactive,
|
|
226
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::TaggedSymbol
|
|
227
|
+
)
|
|
228
|
+
ENFORCING =
|
|
229
|
+
T.let(
|
|
230
|
+
:enforcing,
|
|
231
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::TaggedSymbol
|
|
232
|
+
)
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# The time interval for evaluating spend against the threshold. Currently, only
|
|
237
|
+
# `month` is supported.
|
|
238
|
+
module Interval
|
|
239
|
+
extend OpenAI::Internal::Type::Union
|
|
240
|
+
|
|
241
|
+
Variants =
|
|
242
|
+
T.type_alias do
|
|
243
|
+
T.any(
|
|
244
|
+
String,
|
|
245
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::TaggedSymbol
|
|
246
|
+
)
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
sig do
|
|
250
|
+
override.returns(
|
|
251
|
+
T::Array[
|
|
252
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::Variants
|
|
253
|
+
]
|
|
254
|
+
)
|
|
255
|
+
end
|
|
256
|
+
def self.variants
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
TaggedSymbol =
|
|
260
|
+
T.type_alias do
|
|
261
|
+
T.all(
|
|
262
|
+
Symbol,
|
|
263
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval
|
|
264
|
+
)
|
|
265
|
+
end
|
|
266
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
267
|
+
|
|
268
|
+
MONTH =
|
|
269
|
+
T.let(
|
|
270
|
+
:month,
|
|
271
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::TaggedSymbol
|
|
272
|
+
)
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Admin
|
|
6
|
+
OrganizationSpendLimitDeleted =
|
|
7
|
+
Organization::OrganizationSpendLimitDeleted
|
|
8
|
+
|
|
9
|
+
module Organization
|
|
10
|
+
class OrganizationSpendLimitDeleted < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
OrHash =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
OpenAI::Admin::Organization::OrganizationSpendLimitDeleted,
|
|
15
|
+
OpenAI::Internal::AnyHash
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Whether the hard spend limit was deleted.
|
|
20
|
+
sig { returns(T::Boolean) }
|
|
21
|
+
attr_accessor :deleted
|
|
22
|
+
|
|
23
|
+
# The object type, which is always `organization.spend_limit.deleted`.
|
|
24
|
+
sig { returns(Symbol) }
|
|
25
|
+
attr_accessor :object
|
|
26
|
+
|
|
27
|
+
# Confirmation payload returned after deleting an organization hard spend limit.
|
|
28
|
+
sig do
|
|
29
|
+
params(deleted: T::Boolean, object: Symbol).returns(
|
|
30
|
+
T.attached_class
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
def self.new(
|
|
34
|
+
# Whether the hard spend limit was deleted.
|
|
35
|
+
deleted:,
|
|
36
|
+
# The object type, which is always `organization.spend_limit.deleted`.
|
|
37
|
+
object: :"organization.spend_limit.deleted"
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
sig { override.returns({ deleted: T::Boolean, object: Symbol }) }
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|