Complete upload
uploads.complete(upload_id, **kwargs) -> Upload { id, bytes, created_at, 6 more }
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.
Parameters
upload_id: String
part_ids: Array[String]
The ordered list of Part IDs.
md5: String
The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
Returns
Complete upload
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
upload = openai.uploads.complete("upload_abc123", part_ids: ["string"])
puts(upload){
"id": "id",
"bytes": 0,
"created_at": 0,
"expires_at": 0,
"filename": "filename",
"object": "upload",
"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"
}
}Returns Examples
{
"id": "id",
"bytes": 0,
"created_at": 0,
"expires_at": 0,
"filename": "filename",
"object": "upload",
"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"
}
}