Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

List input items

client.responses.inputItems.list(stringresponseID, InputItemListParams { after, include, limit, order } query?, RequestOptionsoptions?): CursorPage<ResponseItem>
GET/responses/{response_id}/input_items

Returns a list of input items for a given response.

ParametersExpand Collapse
responseID: string
query: InputItemListParams { after, include, limit, order }
ReturnsExpand Collapse
ResponseItem = ResponseInputMessageItem { id, content, role, 2 more } | ResponseOutputMessage { id, content, role, 3 more } | ResponseFileSearchToolCall { id, queries, status, 2 more } | 26 more

Content item used to generate a response.

One of the following:
ResponseInputMessageItem { id, content, role, 2 more }
ResponseOutputMessage { id, content, role, 3 more }

An output message from the model.

ResponseFileSearchToolCall { id, queries, status, 2 more }

The results of a file search tool call. See the file search guide for more information.

ResponseComputerToolCall { id, call_id, pending_safety_checks, 4 more }

A tool call to a computer use tool. See the computer use guide for more information.

ResponseComputerToolCallOutputItem { id, call_id, output, 4 more }
ResponseFunctionToolCallItem extends ResponseFunctionToolCall { arguments, call_id, name, 5 more } { id, status, created_by }

A tool call to run a function. See the function calling guide for more information.

ResponseFunctionToolCallOutputItem { id, call_id, output, 6 more }
ResponseToolSearchCall { id, arguments, call_id, 4 more }
ResponseToolSearchOutputItem { id, call_id, execution, 4 more }
AdditionalTools { id, role, tools, type }
ResponseReasoningItem { id, summary, type, 3 more }

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.

Program { id, call_id, code, 2 more }
ProgramOutput { id, call_id, result, 2 more }
ResponseCompactionItem { id, encrypted_content, type, created_by }

A compaction item generated by the v1/responses/compact API.

ImageGenerationCall { id, result, status, type }

An image generation request made by the model.

ResponseCodeInterpreterToolCall { id, code, container_id, 3 more }

A tool call to run code.

LocalShellCall { id, action, call_id, 2 more }

A tool call to run a command on the local shell.

LocalShellCallOutput { id, output, type, status }

The output of a local shell tool call.

ResponseFunctionShellToolCall { id, action, call_id, 5 more }

A tool call that executes one or more shell commands in a managed environment.

ResponseFunctionShellToolCallOutput { id, call_id, max_output_length, 5 more }

The output of a shell tool call that was emitted.

ResponseApplyPatchToolCall { id, call_id, operation, 4 more }

A tool call that applies file diffs by creating, deleting, or updating files.

ResponseApplyPatchToolCallOutput { id, call_id, status, 4 more }

The output emitted by an apply patch tool call.

McpListTools { id, server_label, tools, 2 more }

A list of tools available on an MCP server.

McpApprovalRequest { id, arguments, name, 2 more }

A request for human approval of a tool invocation.

McpApprovalResponse { id, approval_request_id, approve, 2 more }

A response to an MCP approval request.

McpCall { id, arguments, name, 6 more }

An invocation of a tool on an MCP server.

ResponseCustomToolCallItem extends ResponseCustomToolCall { call_id, input, name, 4 more } { id, status, created_by }

A call to a custom tool created by the model.

ResponseCustomToolCallOutputItem extends ResponseCustomToolCallOutput { call_id, output, type, 2 more } { id, status, created_by }

The output of a custom tool call from your code, being sent back to the model.

List input items

import OpenAI from "openai";
const client = new OpenAI();

const response = await client.responses.inputItems.list("resp_123");
console.log(response.data);
{
  "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
}
Returns Examples
{
  "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
}