BerriAI/litellm · error · HTTPException
No token passed in. Token={token}
Error message
No token passed in. Token={token} What it means
Defensive guard in the PrismaClient find_unique path for key verification: the query type was resolved to 'key' but the token value itself is None, so there is no credential to look up. Indicates a malformed internal call rather than a bad key; the Token=None is echoed in the message.
Source
Thrown at litellm/proxy/utils.py:3596
parent_otel_span: Span | None = None,
proxy_logging_obj: ProxyLogging | None = None,
budget_id_list: list[str] | None = None,
check_deprecated: bool = True,
):
args_passed_in: Final = locals()
start_time: Final = time.time()
hashed_token: str | None = None
try:
response: Any = None
if (token is not None and table_name is None) or (table_name is not None and table_name == "key"):
# check if plain text or hash
if token is not None:
if isinstance(token, str):
hashed_token = _hash_token_if_needed(token=token)
verbose_proxy_logger.debug("PrismaClient: find_unique for token: %s", hashed_token)
if query_type == "find_unique" and hashed_token is not None:
if token is None:
raise HTTPException(
status_code=400,
detail={"error": f"No token passed in. Token={token}"},
)
response = await VerificationTokenRepository(self).table.find_unique(
where={"token": hashed_token},
include={"litellm_budget_table": True},
)
if response is not None:
# for prisma we need to cast the expires time to str
if response.expires is not None and isinstance(response.expires, datetime):
response.expires = response.expires.isoformat()
else:
# Token does not exist.
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=f"Authentication Error: invalid user key - user key does not exist in db. User Key={token}",
)
elif query_type == "find_all" and user_id is not None:View on GitHub (pinned to 77b7c6c40c)
Solutions
- Include an API key in the Authorization header (Bearer <key>) of the request.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/utils.py:3596 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/1ceeb303409c1593.
Report an issue: GitHub.