BerriAI/litellm · error · BlackForestLabsError

Polling failed: {response.text}

Error message

Polling failed: {response.text}

What it means

Error "Polling failed: {response.text}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:354

        # BFL uses regional subdomains (e.g. gateway.bfl.ai) that differ from the
        # submission host (api.bfl.ai), so we validate against the registered
        # domain rather than doing a strict same-origin check. VERIA-51.
        assert_bfl_polling_url(polling_url)

        # Get just the auth header for polling
        polling_headers: Final = {"x-key": headers.get("x-key", "")}

        start_time: Final = time.time()
        verbose_logger.debug("BFL starting sync polling at %s", polling_url)

        while time.time() - start_time < max_wait:
            response = sync_client.get(
                url=polling_url,
                headers=polling_headers,
            )

            if response.status_code != 200:
                raise BlackForestLabsError(
                    status_code=response.status_code,
                    message=f"Polling failed: {response.text}",
                )

            data = response.json()
            status = data.get("status")

            verbose_logger.debug("BFL poll status: %s", status)

            if status == "Ready":
                return response
            elif status in [
                "Error",
                "Failed",
                "Content Moderated",
                "Request Moderated",
            ]:
                raise BlackForestLabsError(

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the BFL polling response text; the job may have failed.

When it happens

Trigger: Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:354 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/639f69986b12564a. Report an issue: GitHub.