Refactor tag validation for premium users

This commit is contained in:
Yash Rathod 2026-10-28 13:58:59 +05:30 • committed by GitHub
parent 2292b6530c
commit ae13dc6f6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1666,12 +1666,10 @@ async def _common_key_generation_helper(
# Set tags on the new key
if "tags" in data_json:
from litellm.proxy.proxy_server import premium_user
tags = data_json.get("tags")
if premium_user is not True and isinstance(tags, list) and len(tags) > 0:
raise ValueError(
f"Only premium users can add tags to keys. {CommonProxyErrors.not_premium_user.value}"
)
raise ValueError(f"Only premium users can add tags to keys. {CommonProxyErrors.not_premium_user.value}")
_metadata: Final = data_json.get("metadata")
if tags is None: