Class: LiteLLMClient::CustomerManagementApi
- Inherits:
-
Object
- Object
- LiteLLMClient::CustomerManagementApi
- Defined in:
- lib/litellm_client/api/customer_management_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#block_user_customer_block_post(block_users, opts = {}) ⇒ Object
Block User [BETA] Reject calls with this end-user id Parameters: - user_ids (List, required): The unique ‘user_id`s for the users to block (any /chat/completion call with this user=end-user-id param, will be rejected.) “` curl -X POST "0.0.0.0:8000/user/block" -H "Authorization: Bearer sk-1234" -d ’{ "user_ids": [<user_id>, …] }‘ “`.
-
#block_user_customer_block_post_with_http_info(block_users, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Block User [BETA] Reject calls with this end-user id Parameters: - user_ids (List, required): The unique `user_id`s for the users to block (any /chat/completion call with this user=end-user-id param, will be rejected.) ``` curl -X POST "0.0.0.0:8000/user/block" -H "Authorization: Bearer sk-1234" -d '{ "user_ids": [<user_id>, …] }' ```.
-
#delete_end_user_customer_delete_post(delete_customer_request, opts = {}) ⇒ Object
Delete End User Delete multiple end-users.
-
#delete_end_user_customer_delete_post_with_http_info(delete_customer_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Delete End User Delete multiple end-users.
-
#end_user_info_customer_info_get(end_user_id, opts = {}) ⇒ LiteLLMEndUserTable
End User Info Get information about an end-user.
-
#end_user_info_customer_info_get_with_http_info(end_user_id, opts = {}) ⇒ Array<(LiteLLMEndUserTable, Integer, Hash)>
End User Info Get information about an end-user.
-
#initialize(api_client = ApiClient.default) ⇒ CustomerManagementApi
constructor
A new instance of CustomerManagementApi.
-
#list_end_user_customer_list_get(opts = {}) ⇒ Array<LiteLLMEndUserTable>
List End User [Admin-only] List all available customers Example curl: “‘ curl –location –request GET ’0.0.0.0:4000/customer/list’ –header ‘Authorization: Bearer sk-1234’ “‘.
-
#list_end_user_customer_list_get_with_http_info(opts = {}) ⇒ Array<(Array<LiteLLMEndUserTable>, Integer, Hash)>
List End User [Admin-only] List all available customers Example curl: ``` curl –location –request GET '0.0.0.0:4000/customer/list' –header 'Authorization: Bearer sk-1234' ```.
-
#new_end_user_customer_new_post(new_customer_request, opts = {}) ⇒ Object
New End User Allow creating a new Customer Parameters: - user_id: str - The unique identifier for the user.
-
#new_end_user_customer_new_post_with_http_info(new_customer_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>
New End User Allow creating a new Customer Parameters: - user_id: str - The unique identifier for the user.
-
#unblock_user_customer_unblock_post(block_users, opts = {}) ⇒ Object
Unblock User [BETA] Unblock calls with this user id Example “‘ curl -X POST "0.0.0.0:8000/user/unblock" -H "Authorization: Bearer sk-1234" -d ’{ "user_ids": [<user_id>, …] }‘ “`.
-
#unblock_user_customer_unblock_post_with_http_info(block_users, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Unblock User [BETA] Unblock calls with this user id Example ``` curl -X POST "0.0.0.0:8000/user/unblock" -H "Authorization: Bearer sk-1234" -d '{ "user_ids": [<user_id>, …] }' ```.
-
#update_end_user_customer_update_post(update_customer_request, opts = {}) ⇒ Object
Update End User Example curl Parameters: - user_id: str - alias: Optional = None # human-friendly alias - blocked: bool = False # allow/disallow requests for this end-user - max_budget: Optional = None - budget_id: Optional = None # give either a budget_id or max_budget - allowed_model_region: Optional = ( None # require all user requests to use models in this specific region ) - default_model: Optional = ( None # if no equivalent model in allowed region - default all requests to this model ) Example curl: “‘ curl –location ’0.0.0.0:4000/customer/update’ –header ‘Authorization: Bearer sk-1234’ –header ‘Content-Type: application/json’ –data ‘{ "user_id": "test-litellm-user-4", "budget_id": "paid_tier" }’ See below for all params “‘.
-
#update_end_user_customer_update_post_with_http_info(update_customer_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Update End User Example curl Parameters: - user_id: str - alias: Optional = None # human-friendly alias - blocked: bool = False # allow/disallow requests for this end-user - max_budget: Optional = None - budget_id: Optional = None # give either a budget_id or max_budget - allowed_model_region: Optional = ( None # require all user requests to use models in this specific region ) - default_model: Optional = ( None # if no equivalent model in allowed region - default all requests to this model ) Example curl: ``` curl –location '0.0.0.0:4000/customer/update' –header 'Authorization: Bearer sk-1234' –header 'Content-Type: application/json' –data '{ "user_id": "test-litellm-user-4", "budget_id": "paid_tier" }' See below for all params ```.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CustomerManagementApi
Returns a new instance of CustomerManagementApi.
19 20 21 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#block_user_customer_block_post(block_users, opts = {}) ⇒ Object
Block User
- BETA
-
Reject calls with this end-user id Parameters: - user_ids (List, required): The unique ‘user_id`s for the users to block (any /chat/completion call with this user=end-user-id param, will be rejected.) “` curl -X POST "0.0.0.0:8000/user/block" -H "Authorization: Bearer sk-1234" -d ’{ "user_ids": [<user_id>, …] }‘ “`
27 28 29 30 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 27 def block_user_customer_block_post(block_users, opts = {}) data, _status_code, _headers = block_user_customer_block_post_with_http_info(block_users, opts) data end |
#block_user_customer_block_post_with_http_info(block_users, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Block User
- BETA
-
Reject calls with this end-user id Parameters: - user_ids (List, required): The unique `user_id`s for the users to block (any /chat/completion call with this user=end-user-id param, will be rejected.) ``` curl -X POST "0.0.0.0:8000/user/block" -H "Authorization: Bearer sk-1234" -d '{ "user_ids": [<user_id>, …] }' ```
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 37 def block_user_customer_block_post_with_http_info(block_users, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.block_user_customer_block_post ...' end # verify the required parameter 'block_users' is set if @api_client.config.client_side_validation && block_users.nil? fail ArgumentError, "Missing the required parameter 'block_users' when calling CustomerManagementApi.block_user_customer_block_post" end # resource path local_var_path = '/customer/block' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(block_users) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.block_user_customer_block_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#block_user_customer_block_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_end_user_customer_delete_post(delete_customer_request, opts = {}) ⇒ Object
Delete End User Delete multiple end-users. Parameters: - user_ids (List, required): The unique ‘user_id`s for the users to delete Example curl: “` curl –location ’0.0.0.0:4000/customer/delete’ –header ‘Authorization: Bearer sk-1234’ –header ‘Content-Type: application/json’ –data ‘{ "user_ids" :["ishaan-jaff-5"] }’ See below for all params “‘
95 96 97 98 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 95 def delete_end_user_customer_delete_post(delete_customer_request, opts = {}) data, _status_code, _headers = delete_end_user_customer_delete_post_with_http_info(delete_customer_request, opts) data end |
#delete_end_user_customer_delete_post_with_http_info(delete_customer_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Delete End User Delete multiple end-users. Parameters: - user_ids (List, required): The unique `user_id`s for the users to delete Example curl: ``` curl –location '0.0.0.0:4000/customer/delete' –header 'Authorization: Bearer sk-1234' –header 'Content-Type: application/json' –data '{ "user_ids" :["ishaan-jaff-5"] }' See below for all params ```
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 105 def delete_end_user_customer_delete_post_with_http_info(delete_customer_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.delete_end_user_customer_delete_post ...' end # verify the required parameter 'delete_customer_request' is set if @api_client.config.client_side_validation && delete_customer_request.nil? fail ArgumentError, "Missing the required parameter 'delete_customer_request' when calling CustomerManagementApi.delete_end_user_customer_delete_post" end # resource path local_var_path = '/customer/delete' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_customer_request) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.delete_end_user_customer_delete_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#delete_end_user_customer_delete_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#end_user_info_customer_info_get(end_user_id, opts = {}) ⇒ LiteLLMEndUserTable
End User Info Get information about an end-user. An ‘end_user` is a customer (external user) of the proxy. Parameters: - end_user_id (str, required): The unique identifier for the end-user Example curl: “` curl -X GET ’localhost:4000/customer/info?end_user_id=test-litellm-user-4’ -H ‘Authorization: Bearer sk-1234’ “‘
163 164 165 166 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 163 def end_user_info_customer_info_get(end_user_id, opts = {}) data, _status_code, _headers = end_user_info_customer_info_get_with_http_info(end_user_id, opts) data end |
#end_user_info_customer_info_get_with_http_info(end_user_id, opts = {}) ⇒ Array<(LiteLLMEndUserTable, Integer, Hash)>
End User Info Get information about an end-user. An `end_user` is a customer (external user) of the proxy. Parameters: - end_user_id (str, required): The unique identifier for the end-user Example curl: ``` curl -X GET 'localhost:4000/customer/info?end_user_id=test-litellm-user-4' -H 'Authorization: Bearer sk-1234' ```
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 173 def end_user_info_customer_info_get_with_http_info(end_user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.end_user_info_customer_info_get ...' end # verify the required parameter 'end_user_id' is set if @api_client.config.client_side_validation && end_user_id.nil? fail ArgumentError, "Missing the required parameter 'end_user_id' when calling CustomerManagementApi.end_user_info_customer_info_get" end # resource path local_var_path = '/customer/info' # query parameters query_params = opts[:query_params] || {} query_params[:'end_user_id'] = end_user_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'LiteLLMEndUserTable' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.end_user_info_customer_info_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#end_user_info_customer_info_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_end_user_customer_list_get(opts = {}) ⇒ Array<LiteLLMEndUserTable>
List End User
- Admin-only
-
List all available customers Example curl: “‘ curl –location –request GET ’0.0.0.0:4000/customer/list’ –header ‘Authorization: Bearer sk-1234’ “‘
226 227 228 229 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 226 def list_end_user_customer_list_get(opts = {}) data, _status_code, _headers = list_end_user_customer_list_get_with_http_info(opts) data end |
#list_end_user_customer_list_get_with_http_info(opts = {}) ⇒ Array<(Array<LiteLLMEndUserTable>, Integer, Hash)>
List End User
- Admin-only
-
List all available customers Example curl: ``` curl –location –request GET '0.0.0.0:4000/customer/list' –header 'Authorization: Bearer sk-1234' ```
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 235 def list_end_user_customer_list_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.list_end_user_customer_list_get ...' end # resource path local_var_path = '/customer/list' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<LiteLLMEndUserTable>' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.list_end_user_customer_list_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#list_end_user_customer_list_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#new_end_user_customer_new_post(new_customer_request, opts = {}) ⇒ Object
New End User Allow creating a new Customer Parameters: - user_id: str - The unique identifier for the user. - alias: Optional - A human-friendly alias for the user. - blocked: bool - Flag to allow or disallow requests for this end-user. Default is False. - max_budget: Optional - The maximum budget allocated to the user. Either ‘max_budget’ or ‘budget_id’ should be provided, not both. - budget_id: Optional - The identifier for an existing budget allocated to the user. Either ‘max_budget’ or ‘budget_id’ should be provided, not both. - allowed_model_region: Optional[Union[Literal, Literal]] - Require all user requests to use models in this specific region. - default_model: Optional - If no equivalent model in the allowed region, default all requests to this model. - metadata: Optional = Metadata for customer, store information for customer. Example metadata = True - budget_duration: Optional - Budget is reset at the end of specified duration. If not set, budget is never reset. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d"). - tpm_limit: Optional - [Not Implemented Yet] Specify tpm limit for a given customer (Tokens per minute) - rpm_limit: Optional - [Not Implemented Yet] Specify rpm limit for a given customer (Requests per minute) - model_max_budget: Optional - [Not Implemented Yet] Specify max budget for a given model. Example: {"max_budget": 100.0, "budget_duration": "1d"} - max_parallel_requests: Optional - [Not Implemented Yet] Specify max parallel requests for a given customer. - soft_budget: Optional - [Not Implemented Yet] Get alerts when customer crosses given budget, doesn’t block requests. - spend: Optional - Specify initial spend for a given customer. - budget_reset_at: Optional - Specify the date and time when the budget should be reset. - Allow specifying allowed regions - Allow specifying default model Example curl: “‘ curl –location ’0.0.0.0:4000/customer/new’ –header ‘Authorization: Bearer sk-1234’ –header ‘Content-Type: application/json’ –data ‘{ "user_id" : "ishaan-jaff-3", "allowed_region": "eu", "budget_id": "free_tier", "default_model": "azure/gpt-3.5-turbo-eu" <- all calls from this user, use this model? }’ # return end-user object “‘ NOTE: This used to be called `/end_user/new`, we will still be maintaining compatibility for /end_user/XXX for these endpoints
284 285 286 287 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 284 def new_end_user_customer_new_post(new_customer_request, opts = {}) data, _status_code, _headers = new_end_user_customer_new_post_with_http_info(new_customer_request, opts) data end |
#new_end_user_customer_new_post_with_http_info(new_customer_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>
New End User Allow creating a new Customer Parameters: - user_id: str - The unique identifier for the user. - alias: Optional - A human-friendly alias for the user. - blocked: bool - Flag to allow or disallow requests for this end-user. Default is False. - max_budget: Optional - The maximum budget allocated to the user. Either 'max_budget' or 'budget_id' should be provided, not both. - budget_id: Optional - The identifier for an existing budget allocated to the user. Either 'max_budget' or 'budget_id' should be provided, not both. - allowed_model_region: Optional[Union[Literal, Literal]] - Require all user requests to use models in this specific region. - default_model: Optional - If no equivalent model in the allowed region, default all requests to this model. - metadata: Optional = Metadata for customer, store information for customer. Example metadata = True - budget_duration: Optional - Budget is reset at the end of specified duration. If not set, budget is never reset. You can set duration as seconds ("30s"), minutes ("30m"), hours ("30h"), days ("30d"). - tpm_limit: Optional - [Not Implemented Yet] Specify tpm limit for a given customer (Tokens per minute) - rpm_limit: Optional - [Not Implemented Yet] Specify rpm limit for a given customer (Requests per minute) - model_max_budget: Optional - [Not Implemented Yet] Specify max budget for a given model. Example: {"max_budget": 100.0, "budget_duration": "1d"} - max_parallel_requests: Optional - [Not Implemented Yet] Specify max parallel requests for a given customer. - soft_budget: Optional - [Not Implemented Yet] Get alerts when customer crosses given budget, doesn't block requests. - spend: Optional - Specify initial spend for a given customer. - budget_reset_at: Optional - Specify the date and time when the budget should be reset. - Allow specifying allowed regions - Allow specifying default model Example curl: ``` curl –location '0.0.0.0:4000/customer/new' –header 'Authorization: Bearer sk-1234' –header 'Content-Type: application/json' –data '{ "user_id" : "ishaan-jaff-3", "allowed_region": "eu", "budget_id": "free_tier", "default_model": "azure/gpt-3.5-turbo-eu" <- all calls from this user, use this model? }' # return end-user object ``` NOTE: This used to be called `/end_user/new`, we will still be maintaining compatibility for /end_user/XXX for these endpoints
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 294 def new_end_user_customer_new_post_with_http_info(new_customer_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.new_end_user_customer_new_post ...' end # verify the required parameter 'new_customer_request' is set if @api_client.config.client_side_validation && new_customer_request.nil? fail ArgumentError, "Missing the required parameter 'new_customer_request' when calling CustomerManagementApi.new_end_user_customer_new_post" end # resource path local_var_path = '/customer/new' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(new_customer_request) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.new_end_user_customer_new_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#new_end_user_customer_new_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#unblock_user_customer_unblock_post(block_users, opts = {}) ⇒ Object
Unblock User
- BETA
-
Unblock calls with this user id Example “‘ curl -X POST "0.0.0.0:8000/user/unblock" -H "Authorization: Bearer sk-1234" -d ’{ "user_ids": [<user_id>, …] }‘ “`
352 353 354 355 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 352 def unblock_user_customer_unblock_post(block_users, opts = {}) data, _status_code, _headers = unblock_user_customer_unblock_post_with_http_info(block_users, opts) data end |
#unblock_user_customer_unblock_post_with_http_info(block_users, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Unblock User
- BETA
-
Unblock calls with this user id Example ``` curl -X POST "0.0.0.0:8000/user/unblock" -H "Authorization: Bearer sk-1234" -d '{ "user_ids": [<user_id>, …] }' ```
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 362 def unblock_user_customer_unblock_post_with_http_info(block_users, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.unblock_user_customer_unblock_post ...' end # verify the required parameter 'block_users' is set if @api_client.config.client_side_validation && block_users.nil? fail ArgumentError, "Missing the required parameter 'block_users' when calling CustomerManagementApi.unblock_user_customer_unblock_post" end # resource path local_var_path = '/customer/unblock' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(block_users) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.unblock_user_customer_unblock_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#unblock_user_customer_unblock_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_end_user_customer_update_post(update_customer_request, opts = {}) ⇒ Object
Update End User Example curl Parameters: - user_id: str - alias: Optional = None # human-friendly alias - blocked: bool = False # allow/disallow requests for this end-user - max_budget: Optional = None - budget_id: Optional = None # give either a budget_id or max_budget - allowed_model_region: Optional = ( None # require all user requests to use models in this specific region ) - default_model: Optional = ( None # if no equivalent model in allowed region - default all requests to this model ) Example curl: “‘ curl –location ’0.0.0.0:4000/customer/update’ –header ‘Authorization: Bearer sk-1234’ –header ‘Content-Type: application/json’ –data ‘{ "user_id": "test-litellm-user-4", "budget_id": "paid_tier" }’ See below for all params “‘
420 421 422 423 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 420 def update_end_user_customer_update_post(update_customer_request, opts = {}) data, _status_code, _headers = update_end_user_customer_update_post_with_http_info(update_customer_request, opts) data end |
#update_end_user_customer_update_post_with_http_info(update_customer_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Update End User Example curl Parameters: - user_id: str - alias: Optional = None # human-friendly alias - blocked: bool = False # allow/disallow requests for this end-user - max_budget: Optional = None - budget_id: Optional = None # give either a budget_id or max_budget - allowed_model_region: Optional = ( None # require all user requests to use models in this specific region ) - default_model: Optional = ( None # if no equivalent model in allowed region - default all requests to this model ) Example curl: ``` curl –location '0.0.0.0:4000/customer/update' –header 'Authorization: Bearer sk-1234' –header 'Content-Type: application/json' –data '{ "user_id": "test-litellm-user-4", "budget_id": "paid_tier" }' See below for all params ```
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'lib/litellm_client/api/customer_management_api.rb', line 430 def update_end_user_customer_update_post_with_http_info(update_customer_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerManagementApi.update_end_user_customer_update_post ...' end # verify the required parameter 'update_customer_request' is set if @api_client.config.client_side_validation && update_customer_request.nil? fail ArgumentError, "Missing the required parameter 'update_customer_request' when calling CustomerManagementApi.update_end_user_customer_update_post" end # resource path local_var_path = '/customer/update' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_customer_request) # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['APIKeyHeader'] = opts.merge( :operation => :"CustomerManagementApi.update_end_user_customer_update_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerManagementApi#update_end_user_customer_update_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |