Complete upload

post https://api.openai.com/v1/uploads/{upload_id}/complete

Completes the Upload.source

Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform.source

You can specify the order of the Parts by passing in an ordered list of the Part IDs.source

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.source

Path parameters

The ID of the Upload.source

Request body

The ordered list of Part IDs.source

The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.source

Returns

The Upload object with status completed with an additional file property containing the created usable File object.source

Example request
1
2
3
4
curl https://api.openai.com/v1/uploads/upload_abc123/complete
  -d '{
    "part_ids": ["part_def456", "part_ghi789"]
  }'
Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "id": "upload_abc123",
  "object": "upload",
  "bytes": 2147483648,
  "created_at": 1719184911,
  "filename": "training_examples.jsonl",
  "purpose": "fine-tune",
  "status": "completed",
  "expires_at": 1719127296,
  "file": {
    "id": "file-xyz321",
    "object": "file",
    "bytes": 2147483648,
    "created_at": 1719186911,
    "filename": "training_examples.jsonl",
    "purpose": "fine-tune",
  }
}