BerriAI/litellm · error · HTTPException

Dynamic Langfuse hosts must include dynamic Langfuse credent

Error message

Dynamic Langfuse hosts must include dynamic Langfuse credentials

What it means

Consistency guard for dynamic Langfuse routing: the request supplied a dynamic Langfuse host but omitted the dynamic public or secret key. A per-request host points at a tenant-specific Langfuse instance whose credentials cannot be inferred, so both dynamic keys must accompany a dynamic host.

Source

Thrown at litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py:112

    endpoint_path: Final = "/" + decoded_endpoint.lstrip("/")
    if any(segment in (".", "..") for segment in endpoint_path.split("/")):
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Invalid Langfuse endpoint path"},
        )
    return endpoint_path


def _get_langfuse_proxy_credentials(
    *,
    dynamic_host_supplied: bool,
    dynamic_langfuse_public_key: str | None,
    dynamic_langfuse_secret_key: str | None,
):
    if dynamic_host_supplied:
        if not dynamic_langfuse_public_key or not dynamic_langfuse_secret_key:
            raise HTTPException(
                status_code=status.HTTP_400_BAD_REQUEST,
                detail={"error": "Dynamic Langfuse hosts must include dynamic Langfuse credentials"},
            )
        return dynamic_langfuse_public_key, dynamic_langfuse_secret_key

    return (
        dynamic_langfuse_public_key or litellm.utils.get_secret(secret_name="LANGFUSE_PUBLIC_KEY"),
        dynamic_langfuse_secret_key or litellm.utils.get_secret(secret_name="LANGFUSE_SECRET_KEY"),
    )


def _build_langfuse_proxy_target(
    *,
    endpoint: str,
    base_target_url: str,
    dynamic_host_supplied: bool,
):
    endpoint_path: Final = _validate_langfuse_proxy_path(endpoint)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide the dynamic Langfuse credentials along with the dynamic Langfuse host.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py:112 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/bcd1d3c66eca7295. Report an issue: GitHub.