TsgcHTTP_API_OpenAIMethods › CompleteUpload

CompleteUpload Method

Completes a multipart upload by assembling the specified parts into the final file

Syntax

function CompleteUpload(const aUploadId, aPartIds: string) : TsgcOpenAIClass_Response_Upload;

Parameters

NameTypeDescription
aUploadIdconst stringIdentifier of the upload session to complete
aPartIdsconst stringComma-separated list of part ids in the order they should be concatenated

Return Value

Upload descriptor with status "completed" and the created File object (TsgcOpenAIClass_Response_Upload)

Remarks

Calls the POST /v1/uploads/{upload_id}/complete endpoint. Once completed, the session produces a regular File object whose id can be used with assistants, batch, fine-tuning and other endpoints. The list of part ids must cover the full file in the correct order; missing or out-of-order parts cause the server to reject completion.

Example

vPartIds := 'part_aaa,part_bbb,part_ccc';
oResponse := oAPI.CompleteUpload(vUploadId, vPartIds);
ShowMessage('File id: ' + oResponse.FileId);

Back to Methods