{"record":{"id":"d54ff6118a248cc6","repo":"BerriAI/litellm","slug":"bfl-initial-request-failed-initial-response-text","errorCode":null,"errorMessage":"BFL initial request failed: {initial_response.text}","messagePattern":"BFL initial request failed: (.+?)","errorType":"exception","errorClass":"BlackForestLabsError","httpStatus":null,"severity":"error","filePath":"litellm/llms/black_forest_labs/image_edit/handler.py","lineNumber":307,"sourceCode":"        timeout: float | httpx.Timeout | None = None,\n    ) -> httpx.Response:\n        \"\"\"\n        Poll BFL API until result is ready (sync version).\n\n        Args:\n            initial_response: The initial response containing polling_url\n            headers: Headers to use for polling (must include x-key)\n            sync_client: HTTP client\n            max_wait: Maximum time to wait in seconds\n            interval: Polling interval in seconds\n            timeout: Timeout for each individual polling request\n\n        Returns:\n            Final response with completed result\n        \"\"\"\n        # Validate initial response status code\n        if initial_response.status_code >= 400:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"BFL initial request failed: {initial_response.text}\",\n            )\n\n        # Parse initial response to get polling URL\n        try:\n            response_data: Final = initial_response.json()\n        except Exception as e:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"Error parsing initial response: {e}\",\n            )\n\n        # Check for immediate errors\n        if \"errors\" in response_data:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"BFL error: {response_data['errors']}\",","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/black_forest_labs/image_edit/handler.py#L289-L325","documentation":"Error \"BFL initial request failed: {initial_response.text}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the BFL error response text; check API key and request parameters."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}