BerriAI/litellm · error · ValueError

POST {start_url} returned HTTP {response.status_code}. Eithe

Error message

POST {start_url} returned HTTP {response.status_code}. Either --base-url is wrong, or the proxy is older than this CLI and does not support the CLI SSO login flow; upgrade the proxy or use a CLI version that matches it.

What it means

POST /sso/cli/start returned 404 or 405, which the CLI interprets as either a wrong --base-url or a proxy too old to implement the CLI SSO endpoints; the user is told to upgrade whichever side is older.

Source

Thrown at litellm/proxy/client/cli/commands/auth.py:432

            if isinstance(i, dict) and (i.get("team_id") or i.get("id"))
        ]
    if isinstance(teams, list):
        return [{"team_id": str(t), "team_alias": None} for t in teams]
    return []


def _start_cli_sso_flow(base_url: str) -> CliSsoStartData:
    start_url: Final = f"{base_url}/sso/cli/start"
    try:
        response: Final = requests.post(start_url, timeout=10)
    except requests.RequestException as e:
        raise ValueError(
            f"Could not reach the proxy at {start_url}: {e}. "
            "Check that the proxy is running and that --base-url points at it."
        ) from e

    if response.status_code in (404, 405):
        raise ValueError(
            f"POST {start_url} returned HTTP {response.status_code}. "
            "Either --base-url is wrong, or the proxy is older than this CLI and does not support "
            "the CLI SSO login flow; upgrade the proxy or use a CLI version that matches it."
        )
    if response.status_code != 200:
        detail: Final = _response_error_detail(response)
        raise ValueError(
            f"Starting CLI login failed: HTTP {response.status_code} from {start_url}"
            + (f": {detail}" if detail else "")
        )

    try:
        data: Final[CliSsoStartData] = response.json()
    except ValueError:
        content_type: Final = response.headers.get("content-type", "unknown")
        raise ValueError(
            f"The proxy returned a non-JSON response from {start_url} (content-type: {content_type}). "
            "A proxy, load balancer, or auth gateway in front of LiteLLM may be intercepting the request. "

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify --base-url is correct.
  2. Upgrade the proxy to a version supporting the CLI SSO login flow, or use a matching CLI version.

Example fix

pip install -U 'litellm[proxy]' and retry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/client/cli/commands/auth.py:432 when the library encounters an invalid state.

Common situations: The login start endpoint returned an error status (wrong URL or proxy too old).


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/5f3b33ec6417f7dc. Report an issue: GitHub.