{"record":{"id":"6437cf7d809e0c91","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-response-id-but-r","errorCode":null,"errorMessage":"Expected a non-empty value for `response_id` but received {response_id!r}","messagePattern":"Expected a non-empty value for `response_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/beta/responses/input_items.py","lineNumber":87,"sourceCode":"\n          limit: A limit on the number of objects to be returned. Limit can range between 1 and\n              100, and the default is 20.\n\n          order: The order to return the input items in. Default is `desc`.\n\n              - `asc`: Return the input items in ascending order.\n              - `desc`: Return the input items in descending order.\n\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not response_id:\n            raise ValueError(f\"Expected a non-empty value for `response_id` but received {response_id!r}\")\n        extra_headers = {\n            **strip_not_given({\"openai-beta\": \",\".join(str(e) for e in betas) if is_given(betas) else not_given}),\n            **(extra_headers or {}),\n        }\n        return self._get_api_list(\n            path_template(\"/responses/{response_id}/input_items?beta=true\", response_id=response_id),\n            page=SyncCursorPage[BetaResponseItem],\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                query=maybe_transform(\n                    {\n                        \"after\": after,\n                        \"include\": include,\n                        \"limit\": limit,\n                        \"order\": order,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/beta/responses/input_items.py#L69-L105","documentation":"The sync beta Responses input_items list method requires a non-empty `response_id` for the URL `/responses/{response_id}/input_items?beta=true`. The guard raises ValueError locally for falsy values.","triggerScenarios":"Calling `client.beta.responses.input_items.list(response_id=\"\")` or None on the sync client (input_items.py:87).","commonSituations":"Inspecting input items for a response whose ID wasn't captured from the create/stream result; passing a model name instead of a response ID.","solutions":["Use the `id` field from the response object returned by create","Validate response_id is a non-empty 'resp_...' string before calling","Store response IDs when created if you need to list items later"],"exampleFix":"// before\nitems = client.beta.responses.input_items.list(response_id=\"\")\n// after\nitems = client.beta.responses.input_items.list(response_id=response.id)","handlingStrategy":"validation","validationCode":"if not response_id:\n    raise ValueError(\"response_id required to list input items\")","typeGuard":"def is_valid_response_id(v: object) -> bool:\n    return isinstance(v, str) and bool(v.strip()) and v.startswith(\"resp_\")","tryCatchPattern":"try:\n    items = client.beta.responses.input_items.list(response_id=rid)\nexcept ValueError:\n    raise","preventionTips":["Capture response.id from create results","Don't pass model names or thread IDs where response IDs are expected"],"tags":["python","validation","responses","path-parameter","pagination"],"backgroundTag":"empty-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}