From 05542d9b60243ea8bf0024718b956494444e695b Mon Sep 17 00:00:00 2001 From: PRABHU KIRAN VANDRANKI <72809214+VANDRANKI@users.noreply.github.com> Date: Tue, 19 May 2026 19:17:15 -0400 Subject: [PATCH] fix(proxy): clear budget_duration and budget_reset_at when set to null on key update --- .../proxy/management_endpoints/key_management_endpoints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.py index 7ff706eb91e..6b63bebee8f 100644 --- a/litellm/proxy/management_endpoints/key_management_endpoints.py +++ b/litellm/proxy/management_endpoints/key_management_endpoints.py @@ -1842,6 +1842,10 @@ async def prepare_key_update_data( key_reset_at = get_budget_reset_time(budget_duration=budget_duration) non_default_values["budget_reset_at"] = key_reset_at non_default_values["budget_duration"] = budget_duration + else: + # budget_duration explicitly set to null: clear the field and reset time + non_default_values["budget_duration"] = None + non_default_values["budget_reset_at"] = None if "budget_limits" in non_default_values and non_default_values["budget_limits"]: from litellm.proxy.common_utils.timezone_utils import get_budget_reset_time