BerriAI/litellm · error · ValueError

Path is required for pass-through endpoint

Error message

Path is required for pass-through endpoint

What it means

Config validation while registering a pass-through endpoint: the endpoint entry has no 'path', so the proxy cannot bind a route for it. The target alone is not enough — an incoming path to match is required.

Source

Thrown at litellm/proxy/pass_through_endpoints/pass_through_endpoints.py:2798

    app: FastAPI,
    premium_user: bool,
    visited_endpoints: set[str],
    config_file_path: str | None = None,
) -> None:
    endpoint_data: dict[str, Any]
    if isinstance(endpoint, PassThroughGenericEndpoint):
        endpoint_data = endpoint.model_dump()
    else:
        endpoint_data = endpoint

    if endpoint_data.get("id") is None:
        endpoint_data["id"] = str(uuid.uuid4())
    endpoint_id: Final = cast(str, endpoint_data["id"])

    target: Final[str | None] = endpoint_data.get("target")
    path: Final[str | None] = endpoint_data.get("path")
    if path is None:
        raise ValueError("Path is required for pass-through endpoint")

    custom_headers: Final = await set_env_variables_in_header(custom_headers=endpoint_data.get("headers"))
    forward_headers: Final = endpoint_data.get("forward_headers")
    merge_query_params: Final = endpoint_data.get("merge_query_params")
    default_query_params: Final = endpoint_data.get("default_query_params")
    auth: Final[bool | str | None] = endpoint_data.get("auth")
    dependencies = None
    auth_enforced: Final = auth is not None and str(auth).lower() == "true"

    if auth_enforced:
        # Authentication on a pass-through endpoint used to be enterprise-only.
        # That left OSS with no safe configuration: auth=True raised at startup
        # unless the operator had a license. The safe option must always be free,
        # and unauthenticated forwarding should require explicit opt-in.
        dependencies = [Depends(user_api_key_auth)]
        if path not in LiteLLMRoutes.openai_routes.value:
            LiteLLMRoutes.openai_routes.value.append(path)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Include the path field in the pass-through endpoint creation request body.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/pass_through_endpoints/pass_through_endpoints.py:2798 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/340ac69066352be9. Report an issue: GitHub.