{"record":{"id":"cdf6ac851b8f1952","repo":"BerriAI/litellm","slug":"got-an-unexpected-none-response-from-the-responses","errorCode":null,"errorMessage":"Got an unexpected None response from the Responses API: {response}","messagePattern":"Got an unexpected None response from the Responses API: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/responses/main.py","lineNumber":549,"sourceCode":"\n        if asyncio.iscoroutine(init_response):\n            response = await init_response\n        else:\n            response = init_response\n\n        # Update the responses_api_response_id with the model_id\n        if isinstance(response, ResponsesAPIResponse):\n            response = ResponsesAPIRequestUtils._update_responses_api_response_id_with_model_id(\n                responses_api_response=response,\n                litellm_metadata=kwargs.get(\"litellm_metadata\", {}),\n                custom_llm_provider=custom_llm_provider,\n            )\n            # Stamp custom_llm_provider so callbacks can identify the provider\n            # (mirrors litellm/main.py:1371 for chat completions)\n            response._hidden_params[\"custom_llm_provider\"] = custom_llm_provider\n\n        if response is None:\n            raise ValueError(f\"Got an unexpected None response from the Responses API: {response}\")\n\n        return response\n    except Exception as e:\n        raise litellm.exception_type(\n            model=model,\n            custom_llm_provider=custom_llm_provider,\n            original_exception=e,\n            completion_kwargs=local_vars,\n            extra_kwargs=kwargs,\n        )\n\n\ndef _apply_prompt_management_to_responses_call(\n    input: str | ResponseInputParam,\n    model: str,\n    custom_llm_provider: str | None,\n    litellm_logging_obj: LiteLLMLoggingObj | None,\n    kwargs: dict[str, Any],","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/responses/main.py#L531-L567","documentation":"Sanity check after the Responses API call resolves: the provider returned None instead of a ResponsesAPIResponse, which the response-id stamping and logging code cannot process; indicates a broken provider response path.","triggerScenarios":"Thrown at litellm/responses/main.py:549 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request; if persistent, check the provider response and litellm debug logs for why None was returned."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}