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
Theme

List input items

GET
/responses/{response_id}/input_items

Returns a list of input items for a given response.

List input items

curl https://api.openai.com/v1/responses/resp_abc123/input_items \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY"
Response example
{
  "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
}
Path Parameters
response_id: string

The ID of the response to retrieve input items for.

Query Parameters
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 integer (default: 20)

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.
One of the following:
"asc"
"desc"
Returns
ResponseItemList object { data, first_id, has_more, 2 more }

A list of Response items.

Returns Examples
Response example
{
  "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
}