BerriAI/litellm · error · Exception

Trying to use ENTERPRISE BlockedUserYou must be a LiteLLM En

Error message

Trying to use ENTERPRISE BlockedUserYou must be a LiteLLM Enterprise user to use this feature. If you have a license please set `LITELLM_LICENSE` in your env. Get a 7 day trial key here: https://www.litellm.ai/enterprise#trial. 
Pricing: https://www.litellm.ai/#pricing

What it means

The 'blocked_user_check' callback found the enterprise module (the import succeeded), but the license check failed: premium_user is not True. The proxy appends CommonProxyErrors.not_premium_user to 'Trying to use ENTERPRISE BlockedUser' and stops config loading. The license state is read from LITELLM_LICENSE at startup.

Source

Thrown at litellm/proxy/common_utils/callback_utils.py:290

                    raise Exception("Trying to use Llm Guard" + CommonProxyErrors.missing_enterprise_package.value)

                if premium_user is not True:
                    raise Exception("Trying to use Llm Guard" + CommonProxyErrors.not_premium_user.value)

                llm_guard_moderation_obj = _ENTERPRISE_LLMGuard()
                imported_list.append(llm_guard_moderation_obj)
            elif isinstance(callback, str) and callback == "blocked_user_check":
                try:
                    from enterprise.enterprise_hooks.blocked_user_list import (
                        _ENTERPRISE_BlockedUserList,
                    )
                except ImportError:
                    raise Exception(
                        "Trying to use Blocked User List" + CommonProxyErrors.missing_enterprise_package_docker.value
                    )

                if premium_user is not True:
                    raise Exception("Trying to use ENTERPRISE BlockedUser" + CommonProxyErrors.not_premium_user.value)

                blocked_user_list = _ENTERPRISE_BlockedUserList(prisma_client=prisma_client)
                imported_list.append(blocked_user_list)
            elif isinstance(callback, str) and callback == "banned_keywords":
                try:
                    from enterprise.enterprise_hooks.banned_keywords import (
                        _ENTERPRISE_BannedKeywords,
                    )
                except ImportError:
                    raise Exception(
                        "Trying to use Banned Keywords" + CommonProxyErrors.missing_enterprise_package_docker.value
                    )

                if premium_user is not True:
                    raise Exception("Trying to use ENTERPRISE BannedKeyword" + CommonProxyErrors.not_premium_user.value)

                banned_keywords_obj = _ENTERPRISE_BannedKeywords()
                imported_list.append(banned_keywords_obj)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set a valid LITELLM_LICENSE env var on the proxy process and restart it.
  2. Or remove 'blocked_user_check' from the callbacks list.
  3. Check startup logs for the license verification call to confirm the key was sent and accepted.

Example fix

# before
docker run litellm/litellm-enterprise --config config.yaml

# after
docker run -e LITELLM_LICENSE="sk-..." litellm/litellm-enterprise --config config.yaml
Defensive patterns

Strategy: validation

Validate before calling

import os

def startup_env_ok(callbacks: list[str]) -> list[str]:
    errs = []
    if "blocked_user_check" in callbacks and not os.environ.get("LITELLM_LICENSE"):
        errs.append("LITELLM_LICENSE missing for blocked_user_check")
    return errs

Try / catch

try:
    start_proxy(cfg)
except Exception as e:
    if "ENTERPRISE BlockedUser" in str(e):
        log.error("set LITELLM_LICENSE or remove blocked_user_check")
        raise SystemExit(2)
    raise

Prevention

When it happens

Trigger: The proxy runs on the enterprise Docker image with callbacks: ['blocked_user_check'], but LITELLM_LICENSE is unset, expired, or rejected by the license check.

Common situations: The Docker image is correct but the -e LITELLM_LICENSE flag was dropped from the run command. The trial ended. The license key was rotated and the old one is still in the deployment manifest.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/7439b4aef9fda5b7. Report an issue: GitHub.