BerriAI/litellm · error · BlackForestLabsError
Rejected polling URL: scheme must be https
Error message
Rejected polling URL: scheme must be https
What it means
Error "Rejected polling URL: scheme must be https" thrown in BerriAI/litellm.
Source
Thrown at litellm/llms/black_forest_labs/common_utils.py:42
def assert_bfl_polling_url(polling_url: str) -> None:
"""Validate that a polling URL points to a BFL-controlled host.
BFL returns polling URLs on subdomains like ``gateway.bfl.ai`` that differ
from the submission host ``api.bfl.ai``. A strict same-origin check would
reject these legitimate URLs. Instead we verify the host is ``bfl.ai`` or
any subdomain of it, which keeps the SSRF guarantee (credentials only go
to BFL-controlled infrastructure) without false-positives on regional hosts.
Raises:
BlackForestLabsError: If the polling URL scheme or host is not trusted.
"""
parsed: Final = urlparse(polling_url)
host: Final = (parsed.hostname or "").lower()
if parsed.scheme != "https":
raise BlackForestLabsError(
status_code=502,
message="Rejected polling URL: scheme must be https",
)
if host != _BFL_REGISTERED_DOMAIN and not host.endswith("." + _BFL_REGISTERED_DOMAIN):
raise BlackForestLabsError(
status_code=502,
message="Rejected polling URL: host is not within the bfl.ai domain",
)
# Polling configuration
DEFAULT_POLLING_INTERVAL: Final = 1.5 # seconds
DEFAULT_MAX_POLLING_TIME: Final = 300 # 5 minutes
# Model to endpoint mapping for image edit
IMAGE_EDIT_MODELS: Final[dict[str, str]] = {
"flux-kontext-pro": "/v1/flux-kontext-pro",View on GitHub (pinned to 6c2dcb801b)
Solutions
- Use an https polling URL.
When it happens
Trigger: Thrown at litellm/llms/black_forest_labs/common_utils.py:42 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/6c578e538f58973d.
Report an issue: GitHub.