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

$ openai responses:input-items list
GET/responses/{response_id}/input_items

Returns a list of input items for a given response.

ParametersExpand Collapse
--response-id: string

The ID of the response to retrieve input items for.

--after: optional string

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

--include: optional array of ResponseIncludable

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

--limit: optional number

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

--order: optional "asc" or "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
responseItemList: object { data, first_id, has_more, 2 more }

A list of Response items.

data: array of ResponseItem

A list of items used to generate this response.

first_id: string

The ID of the first item in the list.

has_more: boolean

Whether there are more items available.

last_id: string

The ID of the last item in the list.

object: "list"

The type of object returned, must be list.

List input items

openai responses:input-items list \
  --api-key 'My API Key' \
  --response-id 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
}