BerriAI/litellm · error · AuthenticationError

{custom_llm_provider.capitalize()}Exception: Authentication

Error message

{custom_llm_provider.capitalize()}Exception: Authentication Error - {error_str}

What it means

Error "{custom_llm_provider.capitalize()}Exception: Authentication Error - {error_str}" thrown in BerriAI/litellm.

Source

Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:717

def _map_openai_like_exception(
    *,
    model: str,
    original_exception: _ProviderHTTPException,
    custom_llm_provider: str,
    error_str: str,
    exception_type: str,
    exception_provider: str,
    extra_information: str,
) -> None:
    if "authorization denied for" in error_str:
        # Predibase returns the raw API Key in the response - this block ensures it's not returned in the exception
        if error_str is not None and isinstance(error_str, str) and "bearer" in error_str.lower():
            # only keep the first 10 chars after the occurnence of "bearer"
            _bearer_token_start_index: Final = error_str.lower().find("bearer")
            error_str = error_str[: _bearer_token_start_index + 14]
            error_str += "XXXXXXX" + '"'

        raise AuthenticationError(
            message=f"{custom_llm_provider.capitalize()}Exception: Authentication Error - {error_str}",
            llm_provider=custom_llm_provider,
            model=model,
            response=getattr(original_exception, "response", None),
            litellm_debug_info=extra_information,
        )
    elif ExceptionCheckers.is_error_str_context_window_exceeded(error_str):
        raise ContextWindowExceededError(
            message=f"{custom_llm_provider.capitalize()}Exception: Context Window Error - {error_str}",
            model=model,
            llm_provider=custom_llm_provider,
            response=getattr(original_exception, "response", None),
            litellm_debug_info=extra_information,
        )
    elif "token_quota_reached" in error_str:
        raise RateLimitError(
            message=f"{custom_llm_provider.capitalize()}Exception: Rate Limit Errror - {error_str}",
            llm_provider=custom_llm_provider,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Check the API key/credentials for the provider.

When it happens

Trigger: Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:717 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/431693e5e53f7649. Report an issue: GitHub.