{"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":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/completion_extras/litellm_responses_transformation/transformation.py","lineNumber":770,"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":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/completion_extras/litellm_responses_transformation/transformation.py#L752-L788","documentation":"The response contained output items, but none of them could be converted into chat-completion choices, and incomplete_details gave no reason. The bridge's converter recognizes a fixed set of output item types (message, function_call, custom_tool_call, reasoning via specific paths); any other item type in output yields zero choices and triggers this error, listing the unrecognized output_items. It usually means a newer Responses API feature the installed litellm does not map.","triggerScenarios":"Responses API output containing item types like web_search_call, file_search_call, computer_call, mcp_tool_call, code_interpreter_call, or new provider-specific items; built-in tools (web search, file search) enabled on a model routed through the chat bridge; a litellm version predating support for a newly added output type.","commonSituations":"Enabling Responses-API built-in tools and then calling the model via litellm.completion (which forces chat-format translation); a provider shipping a new output item type before litellm adds a mapper; guardrails/filters rewriting output into unusual shapes; staying on an old litellm while the provider API evolves.","solutions":["Upgrade litellm to the latest version — new output item types get mappers quickly","Read the output_items in the error text to identify which type is unmapped, then disable the feature producing it (e.g. drop tools=[{\"type\":\"web_search\"}] style built-ins) for chat-bridged calls","Call litellm.responses(...) directly for responses-native features instead of bridging them into chat format","If you control the tool, restructure output as message or function_call items"],"exampleFix":"// before\nresp = litellm.completion(model=\"openai/gpt-5\", messages=msgs,\n                          tools=[{\"type\": \"web_search_preview\"}])  # ValueError: Unknown items in responses API response: [{'type': 'web_search_call', ...}]\n\n// after\nresp = litellm.responses(model=\"openai/gpt-5\", input=msgs,\n                         tools=[{\"type\": \"web_search_preview\"}])  # consume native Responses API output","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.completion(model=m, messages=msgs, tools=tools)\nexcept ValueError as e:\n    if \"Unknown items in responses API response\" in str(e):\n        # output contains unmapped item types: use the native Responses API instead\n        return litellm.responses(model=m, input=msgs, tools=tools)\n    raise","preventionTips":["Keep litellm current when providers add new Responses API output item types","Route responses-native features (web_search, file_search, computer use) through litellm.responses, not the chat bridge","Inspect the output_items list in the error text to identify the unmapped type before retrying","Pin known-good litellm versions in production and test upgrades against your tool set"],"tags":["responses-api","output-items","version-mismatch","schema"],"backgroundTag":"unhandled-response-schema","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}