TsgcHTTP_API_OpenAI › Methods › DeleteResponse
Deletes a stored response from the OpenAI Responses API
function DeleteResponse(const aResponseId: string) : TsgcOpenAIClass_Response_Delete_Status;
| Name | Type | Description |
|---|---|---|
aResponseId | const string | Unique identifier of the response to remove from OpenAI storage. |
Status object that reports whether the response was deleted and echoes back the id and object type. (TsgcOpenAIClass_Response_Delete_Status)
Issues a DELETE against /v1/responses/{response_id}, permanently removing the stored response and its associated input items from OpenAI servers. Call this when a conversation has ended and you want to comply with a retention or privacy policy. Deleting a response also invalidates any subsequent attempt to chain new requests with that PreviousResponseId.
oStatus := oAPI.DeleteResponse('resp_abc123');
if oStatus.Deleted then
ShowMessage('Response ' + oStatus.Id + ' deleted');