BerriAI/litellm · error · AuthenticationError
AuthenticationError: {exception_provider} - {message}
Error message
AuthenticationError: {exception_provider} - {message} What it means
Error "AuthenticationError: {exception_provider} - {message}" thrown in BerriAI/litellm.
Source
Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:382
):
raise litellm.InternalServerError(
message=f"{exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
)
elif "Request too large" in error_str:
raise RateLimitError(
message=f"RateLimitError: {exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
response=getattr(original_exception, "response", None),
litellm_debug_info=extra_information,
)
elif (
"The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable"
in error_str
):
raise AuthenticationError(
message=f"AuthenticationError: {exception_provider} - {message}",
llm_provider=custom_llm_provider,
model=model,
response=getattr(original_exception, "response", None),
litellm_debug_info=extra_information,
)
elif "Mistral API raised a streaming error" in error_str:
_request: Final = httpx.Request(method="POST", url="https://api.openai.com/v1")
raise APIError(
status_code=500,
message=f"{exception_provider} - {message}",
llm_provider=custom_llm_provider,
model=model,
request=_request,
litellm_debug_info=extra_information,
)
elif hasattr(original_exception, "status_code"):
if original_exception.status_code == 400:View on GitHub (pinned to 6c2dcb801b)
Solutions
- Check the API key/credentials for the provider and retry.
When it happens
Trigger: Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:382 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/2dbda7fea394c108.
Report an issue: GitHub.