Skip to main content
OpenAI-compatible Responses

List input items

Returns the input items used to generate the specified Response. For multi-turn conversations chained by previous_response_id , the returned list also includes user inputs and assistant replies from earlier turns. A Response ID can be queried only when the create request was sent with store=true .

Replace {WorkspaceId} with your actual workspace ID.
  • China (Beijing)
SDK base_url: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1HTTP request URL: GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/responses/{response_id}/input_items

Path parameters

response_id string (Required)The Response ID to query input items for, in the format resp_xxx. A Response ID can be queried only when the create request was sent with store=true.

Query parameters

after string (Optional)A cursor for pagination. Returns items that come after the specified item ID (in the format msg_xxx); the direction follows order. Sources of the item ID: output[].id from the Create a response API, or data[].id, first_id, or last_id from this API. To paginate, pass the last_id from the previous response as after in the next request.limit integer (Optional)The maximum number of items to return. Value range: [1, 100]. Default: 20.order string (Optional)Sort order. Supported values: asc (ascending) and desc (descending). Default: desc.
  • Default request
  • Filtered request
Python
import os
from openai import OpenAI

client = OpenAI(
    # If you have not configured the environment variable, replace the line below with your Model Studio API key: api_key="sk-xxx"
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

response = client.responses.input_items.list("resp_xxx")
print(response.data)

Returns

data arrayThe list of input items. Each element is a message object with the fields id, role, content, type, and status. role is either user or assistant. The type of each element in content is either input_text (user input) or output_text (assistant reply). For multi-turn conversations chained by previous_response_id, the list contains user messages and assistant replies from previous turns in chronological order.first_id stringThe ID of the first item in the list.last_id stringThe ID of the last item in the list.has_more booleanWhether more items are available. When true, pass the returned last_id as the after parameter in the next request to fetch more items.id stringThe Response ID that these input items belong to.model stringThe name of the model used to generate this Response.created_at integerThe Unix timestamp when the Response was created, in milliseconds. Note: this differs from the created_at field returned by the Create a response and Retrieve a response APIs, which is in seconds.previous_response_id stringReturned only for multi-turn conversations chained by previous_response_id. The value is the Response ID of the previous turn.
{
    "created_at": 1778674066000,
    "data": [
        {
            "content": [
                {
                    "text": "Hello",
                    "type": "input_text"
                }
            ],
            "id": "msg_8dac4972-fdba-42b5-bed9-280441ced8ea",
            "role": "user",
            "status": "completed",
            "type": "message"
        }
    ],
    "first_id": "msg_8dac4972-fdba-42b5-bed9-280441ced8ea",
    "has_more": false,
    "id": "resp_4ca7fa5e-6ff5-9787-bc18-af6ca5eff36c",
    "last_id": "msg_8dac4972-fdba-42b5-bed9-280441ced8ea",
    "model": "qwen3.8-max"
}

Error response

If the specified Response ID does not exist, the API returns the following error:
{
    "request_id": "xxx",
    "code": "InvalidParameter",
    "message": "Response with id 'resp_xxx' not found."
}