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

responses.input_items.list(strresponse_id, InputItemListParams**kwargs) -> SyncCursorPage[ResponseItem]
GET/responses/{response_id}/input_items

Returns a list of input items for a given response.

ParametersExpand Collapse
response_id: str
after: Optional[str]

An item ID to list items after, used in pagination.

include: Optional[List[ResponseIncludable]]

Additional fields to include in the response. See the include parameter for Response creation above for more information.

limit: Optional[int]

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

order: Optional[Literal["asc", "desc"]]

The order to return the input items in. Default is desc.

  • asc: Return the input items in ascending order.
  • desc: Return the input items in descending order.
ReturnsExpand Collapse

Content item used to generate a response.

One of the following:
class ResponseInputMessageItem: …
class ResponseOutputMessage: …

An output message from the model.

class ResponseFileSearchToolCall: …

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

class ResponseComputerToolCall: …

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

class ResponseComputerToolCallOutputItem: …
class ResponseFunctionToolCallItem: …

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

class ResponseFunctionToolCallOutputItem: …
class ResponseToolSearchCall: …
class ResponseToolSearchOutputItem: …
class AdditionalTools: …
class ResponseReasoningItem: …

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.

class Program: …
class ProgramOutput: …
class ResponseCompactionItem: …

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

class ImageGenerationCall: …

An image generation request made by the model.

class ResponseCodeInterpreterToolCall: …

A tool call to run code.

class LocalShellCall: …

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

class LocalShellCallOutput: …

The output of a local shell tool call.

class ResponseFunctionShellToolCall: …

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

class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

class ResponseApplyPatchToolCall: …

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

class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

class McpListTools: …

A list of tools available on an MCP server.

class McpApprovalRequest: …

A request for human approval of a tool invocation.

class McpApprovalResponse: …

A response to an MCP approval request.

class McpCall: …

An invocation of a tool on an MCP server.

class ResponseCustomToolCallItem: …

A call to a custom tool created by the model.

class ResponseCustomToolCallOutputItem: …

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

List input items

from openai import OpenAI
client = OpenAI()

response = client.responses.input_items.list("resp_123")
print(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
}