TsgcHTTP_API_OpenAI › Methods › RetrieveResponse
Retrieves a previously created response from the OpenAI Responses API by its identifier
function RetrieveResponse(const aResponseId: string) : TsgcOpenAIClass_Response_Response;
| Name | Type | Description |
|---|---|---|
aResponseId | const string | Unique identifier of the response to load (the id value returned by a previous CreateResponse call). |
Parsed response object with the current status, output items and token usage for the requested response id. (TsgcOpenAIClass_Response_Response)
Issues a GET to /v1/responses/{response_id} and returns the stored object. Useful for resuming a conversation thread across sessions, polling a long running response that was created in background mode, or inspecting tool call outputs after the fact. Responses are retained by OpenAI for a limited time; once expired the endpoint returns an error which is surfaced as an exception.
oResponse := oAPI.RetrieveResponse('resp_abc123');
ShowMessage('Status: ' + oResponse.Status + sLineBreak +
'Output: ' + oResponse.OutputText);