BerriAI/litellm · error · APIConnectionError

APIConnectionError: {exception_provider} - {message}

Error message

APIConnectionError: {exception_provider} - {message}

What it means

Error "APIConnectionError: {exception_provider} - {message}" thrown in BerriAI/litellm.

Source

Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:492

                message=f"Timeout Error: {exception_provider} - {message}",
                model=model,
                llm_provider=custom_llm_provider,
                litellm_debug_info=extra_information,
                exception_status_code=original_exception.status_code,
            )
        else:
            raise APIError(
                status_code=original_exception.status_code,
                message=f"APIError: {exception_provider} - {message}",
                llm_provider=custom_llm_provider,
                model=model,
                request=getattr(original_exception, "request", None),
                litellm_debug_info=extra_information,
            )
    else:
        # if no status code then it is an APIConnectionError: https://github.com/openai/openai-python#handling-errors
        # exception_mapping_worked = True
        raise APIConnectionError(
            message=f"APIConnectionError: {exception_provider} - {message}",
            llm_provider=custom_llm_provider,
            model=model,
            litellm_debug_info=extra_information,
            request=httpx.Request(method="POST", url="https://api.openai.com/v1/"),
        )


def _map_anthropic_exception(
    *,
    model: str,
    original_exception: _ProviderHTTPException,
    custom_llm_provider: str,
    error_str: str,
    exception_type: str,
    exception_provider: str,
    extra_information: str,
) -> None:

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Check network connectivity to the provider endpoint and api_base.

When it happens

Trigger: Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:492 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/ed5a0197e360d6dd. Report an issue: GitHub.