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

InputItemListPage beta().responses().inputItems().list(InputItemListParamsparams = InputItemListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/responses/{response_id}/input_items

Returns a list of input items for a given response.

ParametersExpand Collapse
InputItemListParams params
Optional<String> responseId
Optional<String> after

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

Optional<List<BetaResponseIncludable>> include

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

Optional<Long> limit

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

Optional<Order> order

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.
Optional<List<Beta>> betas
ReturnsExpand Collapse
class BetaResponseItem: A class that can be one of several variants.union

Content item used to generate a response.

class BetaResponseInputMessageItem:
class BetaResponseOutputMessage:

An output message from the model.

class BetaResponseFileSearchToolCall:

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

class BetaResponseComputerToolCall:

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

class BetaResponseComputerToolCallOutputItem:
class BetaResponseFunctionToolCallItem:

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

class BetaResponseFunctionToolCallOutputItem:
MultiAgentCall
MultiAgentCallOutput
class BetaResponseToolSearchCall:
class BetaResponseToolSearchOutputItem:
AdditionalTools
class BetaResponseReasoningItem:

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.

ProgramOutput
class BetaResponseCompactionItem:

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

ImageGenerationCall
class BetaResponseCodeInterpreterToolCall:

A tool call to run code.

LocalShellCall
LocalShellCallOutput
class BetaResponseFunctionShellToolCall:

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

class BetaResponseFunctionShellToolCallOutput:

The output of a shell tool call that was emitted.

class BetaResponseApplyPatchToolCall:

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

class BetaResponseApplyPatchToolCallOutput:

The output emitted by an apply patch tool call.

McpApprovalRequest
McpApprovalResponse
class BetaResponseCustomToolCallItem:

A call to a custom tool created by the model.

class BetaResponseCustomToolCallOutputItem:

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

List input items

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.responses.inputitems.InputItemListPage;
import com.openai.models.beta.responses.inputitems.InputItemListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        InputItemListPage page = client.beta().responses().inputItems().list("response_id");
    }
}
{
  "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
}