TsgcHTTP_API_OpenAIMethods › ListRunSteps

ListRunSteps Method

Lists the execution steps that make up a Run

Syntax

function ListRunSteps(const aThreadId, aRunId: string; const aLimit: Integer = 20; aOrder: string = ''; aAfter: string = ''; aBefore: string = ''): TsgcOpenAIClass_Response_List_RunSteps;

Parameters

NameTypeDescription
aThreadIdconst stringThe identifier of the Thread that owns the Run.
aRunIdconst stringThe identifier of the Run whose steps are being listed.
aLimitconst IntegerMaximum number of steps to return (1-100, defaults to 20).
aOrderstringSort order by created_at: asc or desc.
aAfterstringCursor for forward pagination; pass the last step id from the previous page.
aBeforestringCursor for backward pagination; pass the first step id from the previous page.

Return Value

Paginated list of RunStep objects describing message creation and tool calls performed by the Run (TsgcOpenAIClass_Response_List_RunSteps)

Remarks

Calls GET /v1/threads/{thread_id}/runs/{run_id}/steps. Each step describes one action taken during the Run, such as creating a message or invoking a tool. Useful for auditing or debugging Assistant behaviour.

Example

var oList: TsgcOpenAIClass_Response_List_RunSteps;
    i: Integer;
begin
  oList := oAPI.ListRunSteps('thread_abc123', 'run_abc123', 20, 'asc');
  for i := 0 to oList.Data.Count - 1 do
    Memo1.Lines.Add(oList.Data[i].Id + ' - ' + oList.Data[i].StepType);
end;

Back to Methods