{"record":{"id":"dafe1c53619ab67f","repo":"BerriAI/litellm","slug":"unknown-items-in-responses-api-response-output-i","errorCode":null,"errorMessage":"Unknown items in responses API response: {output_items}","messagePattern":"Unknown items in responses API response: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/completion_extras/litellm_responses_transformation/transformation.py","lineNumber":768,"sourceCode":"            if recovered_output_items:\n                output_items = cast(Any, recovered_output_items)\n                raw_response.output = cast(Any, recovered_output_items)\n                verbose_logger.warning(\n                    \"Recovered empty Responses API output from raw SSE for model=%s\",\n                    model,\n                )\n\n        # Convert response output to choices using the static helper\n        choices: Final = self._convert_response_output_to_choices(\n            output_items=output_items,\n            handle_raw_dict_callback=self._handle_raw_dict_response_item,\n        )\n\n        if len(choices) == 0:\n            if raw_response.incomplete_details is not None and raw_response.incomplete_details.reason is not None:\n                raise ValueError(f\"{model} unable to complete request: {raw_response.incomplete_details.reason}\")\n            else:\n                raise ValueError(f\"Unknown items in responses API response: {output_items}\")\n\n        setattr(model_response, \"choices\", choices)\n\n        model_response.model = model\n\n        setattr(\n            model_response,\n            \"usage\",\n            ResponseAPILoggingUtils._transform_response_api_usage_to_chat_usage(raw_response.usage),\n        )\n\n        # Preserve hidden params from the ResponsesAPIResponse, especially the headers\n        # which contain important provider information like x-request-id\n        raw_response_hidden_params: Final = getattr(raw_response, \"_hidden_params\", {})\n        if raw_response_hidden_params:\n            if not hasattr(model_response, \"_hidden_params\") or model_response._hidden_params is None:\n                model_response._hidden_params = {}\n            # Merge the raw_response hidden params with model_response hidden params","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/completion_extras/litellm_responses_transformation/transformation.py#L750-L786","documentation":"Zero chat choices were produced from the Responses API output and there is no incomplete_details to explain why — the output array contained only item types the converter does not map to choices (e.g. only reasoning, web_search, file_search, or unknown item types, with no message/function_call). The error text dumps the unrecognized output items.","triggerScenarios":"A response whose output is exclusively non-message items (pure reasoning items with no final message, tool-only responses from non-standard providers, or new item types the installed litellm version does not recognize).","commonSituations":"Providers adding new Responses API output item types after your litellm version was released; reasoning models whose final message is dropped by a proxy; empty output after SSE recovery failed.","solutions":["Upgrade litellm — new output item types are added as providers ship them","Inspect the dumped output_items in the message to identify which item type is unmapped","If a proxy is involved, check it forwards the response.completed event with the full output","Capture the raw response (via callbacks) and report unmapped item types to litellm"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"def output_has convertible_items(parsed) -> bool:\n    types = {item.get(\"type\") for item in (parsed.output or [])}\n    return bool(types & {\"message\", \"function_call\", \"custom_tool_call\"})","typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.completion(**kwargs)\nexcept ValueError as e:\n    if \"Unknown items in responses API response\" in str(e):\n        log_unmapped_output(e)  # capture item types, file upstream\n        raise","preventionTips":["Keep litellm current so new Responses output item types are mapped","Log the dumped output_items when this fires to identify the unmapped type","Pin provider API versions in tests to catch new item types early"],"tags":["responses-api","transformation","output-items","version-drift"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}