{"record":{"id":"62366195cd59a0d9","repo":"BerriAI/litellm","slug":"error-get-message-unknown-perplexity-error","errorCode":null,"errorMessage":"error.get(\"message\", \"Unknown Perplexity error\")","messagePattern":"error\\.get\\(\"message\", \"Unknown Perplexity error\"\\)","errorType":"http","errorClass":"BaseLLMException","httpStatus":null,"severity":"error","filePath":"litellm/llms/perplexity/responses/transformation.py","lineNumber":112,"sourceCode":"            litellm_params=litellm_params,\n            headers=headers,\n        )\n\n    def transform_response_api_response(\n        self,\n        model: str,\n        raw_response: httpx.Response,\n        logging_obj: LiteLLMLoggingObj,\n    ) -> ResponsesAPIResponse:\n        \"\"\"Check for Perplexity's status:'failed' on HTTP 200 before delegating to base.\"\"\"\n        try:\n            raw_response_json = raw_response.json()\n        except Exception:\n            raw_response_json = None\n\n        if isinstance(raw_response_json, dict) and raw_response_json.get(\"status\") == \"failed\":\n            error: Final = raw_response_json.get(\"error\", {})\n            raise BaseLLMException(\n                status_code=raw_response.status_code,\n                message=error.get(\"message\", \"Unknown Perplexity error\"),\n            )\n\n        return super().transform_response_api_response(\n            model=model,\n            raw_response=raw_response,\n            logging_obj=logging_obj,\n        )\n\n    def supports_native_websocket(self) -> bool:\n        \"\"\"Perplexity does not support native WebSocket for Responses API\"\"\"\n        return False\n","sourceCodeStart":94,"sourceCodeEnd":126,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/perplexity/responses/transformation.py#L94-L126","documentation":"Perplexity's Responses API reports failures with HTTP 200 and a body carrying status:'failed' plus an error object. LiteLLM checks for this shape before delegating to the base Responses transformer and raises BaseLLMException with error.message (defaulting to 'Unknown Perplexity error' when absent) and the original 200 status code. Naive status-code monitoring misses these because the HTTP layer looks successful.","triggerScenarios":"Calling litellm.responses(model='perplexity/...') when Perplexity's server-side search or inference fails: upstream search backend errors, capacity issues, or invalid search parameters - all returned as status:'failed' on a 200.","commonSituations":"Perplexity incidents degrading search quality/failing queries; restrictive search-domain or search-mode parameters the backend rejects; intermittent upstream failures that mostly succeed on retry.","solutions":["Read the exception message - it carries Perplexity's error.message describing the failure","Retry with backoff; status:failed outcomes are frequently transient","Review search-related parameters (search_domain, search_mode) if the message references them","Check Perplexity's status page for ongoing incidents"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Catch BaseLLMException around litellm.responses() even on HTTP-200 paths; status:'failed' outcomes are frequently transient, so retry with short exponential backoff (2-3 attempts) before surfacing error.message to the caller.","preventionTips":["Never treat HTTP 200 as success for Perplexity - always parse for status:'failed'","Retry transient failed statuses a bounded number of times","Alert on failed-status rates to catch Perplexity incidents your status checks miss"],"tags":["perplexity","responses-api","http-200-error","upstream-error","litellm"],"backgroundTag":"upstream-api-error","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}