TsgcHTTP_API_OpenAIMethods › ListInputItems

ListInputItems Method

Lists the input items that were provided when a response was created

Syntax

function ListInputItems(const aResponseId: string; const aLimit: Integer = 20; aOrder: string = ''; aAfter: string = ''; aBefore: string = '') : TsgcOpenAIClass_Response_List_InputItems;

Parameters

NameTypeDescription
aResponseIdconst stringIdentifier of the response whose input items should be listed.
aLimitconst IntegerMaximum number of items to return per page (1-100, default 20).
aOrderstringSort order of the result: asc for oldest first, desc for newest first.
aAfterstringCursor for pagination: return items created after the item with this id.
aBeforestringCursor for pagination: return items created before the item with this id.

Return Value

Paged list object containing the input items, together with cursor fields that allow further pagination. (TsgcOpenAIClass_Response_List_InputItems)

Remarks

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.

Example

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);

Back to Methods