TsgcHTTP_API_OpenAI › Methods › ListInputItems
Lists the input items that were provided when a response was created
function ListInputItems(const aResponseId: string; const aLimit: Integer = 20; aOrder: string = ''; aAfter: string = ''; aBefore: string = '') : TsgcOpenAIClass_Response_List_InputItems;
| Name | Type | Description |
|---|---|---|
aResponseId | const string | Identifier of the response whose input items should be listed. |
aLimit | const Integer | Maximum number of items to return per page (1-100, default 20). |
aOrder | string | Sort order of the result: asc for oldest first, desc for newest first. |
aAfter | string | Cursor for pagination: return items created after the item with this id. |
aBefore | string | Cursor for pagination: return items created before the item with this id. |
Paged list object containing the input items, together with cursor fields that allow further pagination. (TsgcOpenAIClass_Response_List_InputItems)
Issues a GET to /v1/responses/{response_id}/input_items and returns the ordered list of inputs that produced the response: user messages, tool outputs, file references and multimodal parts. The result is paginated; use the aAfter/aBefore cursors together with aLimit to walk large histories. Useful for auditing agent runs, rebuilding a conversation thread in the UI or migrating a Responses-based session to another backend.
oList := oAPI.ListInputItems('resp_abc123', 50, 'asc');
for i := 0 to oList.Data.Count - 1 do
Memo1.Lines.Add(oList.Data[i].Id + ' -> ' + oList.Data[i].Role);