diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.py index ec02e490e81..9762c40e6f1 100644 --- a/litellm/proxy/management_endpoints/key_management_endpoints.py +++ b/litellm/proxy/management_endpoints/key_management_endpoints.py @@ -2884,13 +2884,8 @@ async def _validate_update_key_data( # one in the key's metadata still applies (it is added on top of # max_budget at request time by _update_key_budget_with_temp_budget_increase). _effective_temp_increase: float | None = data.temp_budget_increase - if ( - _effective_temp_increase is None - and existing_key_row.metadata is not None - ): - _persisted_increase: Final = existing_key_row.metadata.get( - "temp_budget_increase" - ) + if _effective_temp_increase is None and existing_key_row.metadata is not None: + _persisted_increase: Final = existing_key_row.metadata.get("temp_budget_increase") if _persisted_increase is not None: try: _persisted_expiry: Final = datetime.fromisoformat( @@ -2906,10 +2901,7 @@ async def _validate_update_key_data( raise HTTPException( status_code=400, detail={ - "error": ( - f"temp_budget_increase must be a finite number. " - f"Received: {_effective_temp_increase}" - ) + "error": (f"temp_budget_increase must be a finite number. Received: {_effective_temp_increase}") }, ) # temp_budget_increase is applied on top of the key's max_budget at