Skip to main content
Responses

List input items for a response

GET
/openai/v1/responses/{response_id}/input_items

Retrieves the input items associated with the specified response.

Path Parameters
response_idstringrequired
The response id path parameter.
Query Parameters
limitintegeroptionaldefault: 20
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
orderstringoptional
Sort order by the created_at timestamp of the objects. asc for ascending order anddesc for descending order.
ascdesc
afterstringoptional
A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforestringoptional
A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Header Parameters
x-ms-user-identitystringoptional
Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the agents/endpoints/UserIdentityImpersonation/action RBAC permission.
Responses
data(message | output_message | file_search_call | computer_call | computer_call_output | web_search_call | function_call | function_call_output | tool_search_call | tool_search_output | additional_tools | reasoning | compaction | image_generation_call | code_interpreter_call | local_shell_call | local_shell_call_output | shell_call | shell_call_output | apply_patch_call | apply_patch_call_output | mcp_list_tools | mcp_approval_request | mcp_approval_response | mcp_call | custom_tool_call | custom_tool_call_output)[]required
The requested list of items.
One of the following:
messageOpenAI.ItemResourceInputMessage
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role.
output_messageOpenAI.ItemResourceOutputMessage
An output message from the model.
file_search_callOpenAI.ItemResourceFileSearchToolCall
The results of a file search tool call. See the file search guide for more information.
computer_callOpenAI.ItemResourceComputerToolCall
A tool call to a computer use tool. See the computer use guide for more information.
computer_call_outputOpenAI.ItemResourceComputerToolCallOutput
The output of a computer tool call.
web_search_callOpenAI.ItemResourceWebSearchToolCall
The results of a web search tool call. See the web search guide for more information.
function_callOpenAI.ItemResourceFunctionToolCall
A tool call to run a function. See the function calling guide for more information.
function_call_outputOpenAI.ItemResourceFunctionToolCallOutput
The output of a function tool call.
tool_search_callOpenAI.ItemResourceToolSearchCall
Content item used to generate a response.
tool_search_outputOpenAI.ItemResourceToolSearchOutput
Content item used to generate a response.
additional_toolsOpenAI.ItemResourceAdditionalTools
Content item used to generate a response.
reasoningOpenAI.ItemResourceReasoningItem
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.
compactionOpenAI.ItemResourceCompactionBody
A compaction item generated by the v1/responses/compact API.
image_generation_callOpenAI.ItemResourceImageGenToolCall
An image generation request made by the model.
code_interpreter_callOpenAI.ItemResourceCodeInterpreterToolCall
A tool call to run code.
local_shell_callOpenAI.ItemResourceLocalShellToolCall
A tool call to run a command on the local shell.
local_shell_call_outputOpenAI.ItemResourceLocalShellToolCallOutput
The output of a local shell tool call.
shell_callOpenAI.ItemResourceFunctionShellCall
A tool call that executes one or more shell commands in a managed environment.
shell_call_outputOpenAI.ItemResourceFunctionShellCallOutput
The output of a shell tool call that was emitted.
apply_patch_callOpenAI.ItemResourceApplyPatchToolCall
A tool call that applies file diffs by creating, deleting, or updating files.
apply_patch_call_outputOpenAI.ItemResourceApplyPatchToolCallOutput
The output emitted by an apply patch tool call.
mcp_list_toolsOpenAI.ItemResourceMcpListTools
A list of tools available on an MCP server.
mcp_approval_requestOpenAI.ItemResourceMcpApprovalRequest
A request for human approval of a tool invocation.
mcp_approval_responseOpenAI.ItemResourceMcpApprovalResponseResource
A response to an MCP approval request.
mcp_callOpenAI.ItemResourceMcpToolCall
An invocation of a tool on an MCP server.
custom_tool_callOpenAI.ItemResourceCustomToolCallResource
Content item used to generate a response.
custom_tool_call_outputOpenAI.ItemResourceCustomToolCallOutputResource
Content item used to generate a response.
first_idstring
The first ID represented in this list.
last_idstring
The last ID represented in this list.
has_morebooleanrequired
A value indicating whether there are additional values available not captured in this list.
Request
curl https://api.openai.com/v1/responses/resp_abc123/input_items \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY"
Response
{
  "object": "list",
  "data": [
    {
      "id": "msg_abc123",
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Tell me a three sentence bedtime story about a unicorn."
        }
      ]
    }
  ],
  "first_id": "msg_abc123",
  "last_id": "msg_abc123",
  "has_more": false
}