TsgcHTTP_API_OpenAIMethods › AddUploadPart

AddUploadPart Method

Uploads one part of a previously created multipart upload session

Syntax

function AddUploadPart(const aUploadId, aFilename: string) : TsgcOpenAIClass_Response_UploadPart;

Parameters

NameTypeDescription
aUploadIdconst stringIdentifier of the upload session returned by CreateUpload
aFilenameconst stringLocal file name containing the chunk bytes to send as this part

Return Value

Part metadata including the part id to be referenced on completion (TsgcOpenAIClass_Response_UploadPart)

Remarks

Calls the POST /v1/uploads/{upload_id}/parts endpoint with a multipart/form-data body. Each part may be up to 64MB and parts can be added in any order, but all parts must be uploaded before calling CompleteUpload. Keep each returned part id and pass them, in sequence, to CompleteUpload to assemble the final file.

Example

oResponse := oAPI.AddUploadPart(vUploadId, 'C:\chunks\part01.bin');
vPartIds.Add(oResponse.Id);

Back to Methods