Complete upload
POST/uploads/{upload_id}/complete
Completes the Upload.
Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform.
You can specify the order of the Parts by passing in an ordered list of the Part IDs.
The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.
Path Parameters
upload_id: string
Body ParametersJSON
part_ids: array of string
The ordered list of Part IDs.
md5: optional string
The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
Returns
Complete upload
curl https://api.openai.com/v1/uploads/$UPLOAD_ID/complete \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"part_ids": [
"string"
]
}'{
"id": "id",
"bytes": 0,
"created_at": 0,
"expires_at": 0,
"filename": "filename",
"purpose": "purpose",
"status": "pending",
"file": {
"id": "id",
"bytes": 0,
"created_at": 0,
"filename": "filename",
"object": "file",
"purpose": "assistants",
"status": "uploaded",
"expires_at": 0,
"status_details": "status_details"
},
"object": "upload"
}Returns Examples
{
"id": "id",
"bytes": 0,
"created_at": 0,
"expires_at": 0,
"filename": "filename",
"purpose": "purpose",
"status": "pending",
"file": {
"id": "id",
"bytes": 0,
"created_at": 0,
"filename": "filename",
"object": "file",
"purpose": "assistants",
"status": "uploaded",
"expires_at": 0,
"status_details": "status_details"
},
"object": "upload"
}