BerriAI/litellm · error · BadRequestError

{exception_provider} - {error_str}

Error message

{exception_provider} - {error_str}

What it means

Error "{exception_provider} - {error_str}" thrown in BerriAI/litellm.

Source

Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:2082

            model=model,
            litellm_debug_info=extra_information,
            request=httpx.Request(method="POST", url="https://openai.com/"),
        )


def _map_openrouter_exception(
    *,
    model: str,
    original_exception: _ProviderHTTPException,
    custom_llm_provider: str,
    error_str: str,
    exception_type: str,
    exception_provider: str,
    extra_information: str,
) -> None:
    if hasattr(original_exception, "status_code"):
        if original_exception.status_code == 400:
            raise BadRequestError(
                message=f"{exception_provider} - {error_str}",
                llm_provider=custom_llm_provider,
                model=model,
                response=getattr(original_exception, "response", None),
                litellm_debug_info=extra_information,
            )
        elif original_exception.status_code == 401:
            raise AuthenticationError(
                message=f"AuthenticationError: {exception_provider} - {error_str}",
                llm_provider=custom_llm_provider,
                model=model,
                response=getattr(original_exception, "response", None),
                litellm_debug_info=extra_information,
            )
        elif original_exception.status_code == 404:
            raise NotFoundError(
                message=f"NotFoundError: {exception_provider} - {error_str}",
                model=model,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the provider error string and adjust the request or credentials.

When it happens

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

Common situations: See trigger scenarios.


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