List input items
GEThttps:/api.openai.com/v1/responses/{response_id}/input_items
Returns a list of input items for a given response.
Path parameters
response_id
string
Required
The ID of the response to retrieve input items for.
Query parameters
limit
integer
Defaults: 20
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order
string
The order to return the input items in. Default is
asc
.asc
: Return the input items in ascending order.desc
: Return the input items in descending order.
after
string
An item ID to list items after, used in pagination.before
string
An item ID to list items before, used in pagination.include
array
Additional fields to include in the response. See the
include
parameter for Response creation above for more information.
Response
A list of input item objects.
Example request
1 curl https://api.openai.com/v1/responses/resp_abc123/input_items \2 -H "Content-Type: application/json" \3 -H "Authorization: Bearer $OPENAI_API_KEY"
Example response
1 {2 "object": "list",3 "data": [4 {5 "id": "msg_abc123",6 "type": "message",7 "role": "user",8 "content": [9 {10 "type": "input_text",11 "text": "Tell me a three sentence bedtime story about a unicorn."12 }13 ]14 }15 ],16 "first_id": "msg_abc123",17 "last_id": "msg_abc123",18 "has_more": false19 }
Built with