resources/uploads/subresources/parts/index.md +0 −103 deleted
File Deleted View Diff
1# Parts
2
3## Add upload part
4
5**post** `/uploads/{upload_id}/parts`
6
7Adds a [Part](/docs/api-reference/uploads/part-object) to an [Upload](/docs/api-reference/uploads/object) object. A Part represents a chunk of bytes from the file you are trying to upload.
8
9Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB.
10
11It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](/docs/api-reference/uploads/complete).
12
13### Path Parameters
14
15- `upload_id: string`
16
17### Returns
18
19- `UploadPart object { id, created_at, object, upload_id }`
20
21 The upload Part represents a chunk of bytes we can add to an Upload object.
22
23 - `id: string`
24
25 The upload Part unique identifier, which can be referenced in API endpoints.
26
27 - `created_at: number`
28
29 The Unix timestamp (in seconds) for when the Part was created.
30
31 - `object: "upload.part"`
32
33 The object type, which is always `upload.part`.
34
35 - `"upload.part"`
36
37 - `upload_id: string`
38
39 The ID of the Upload object that this Part was added to.
40
41### Example
42
43```http
44curl https://api.openai.com/v1/uploads/$UPLOAD_ID/parts \
45 -H 'Content-Type: multipart/form-data' \
46 -H "Authorization: Bearer $OPENAI_API_KEY" \
47 -F 'data=@/path/to/data'
48```
49
50#### Response
51
52```json
53{
54 "id": "id",
55 "created_at": 0,
56 "object": "upload.part",
57 "upload_id": "upload_id"
58}
59```
60
61### Example
62
63```http
64curl https://api.openai.com/v1/uploads/upload_abc123/parts
65 -F data="aHR0cHM6Ly9hcGkub3BlbmFpLmNvbS92MS91cGxvYWRz..."
66```
67
68#### Response
69
70```json
71{
72 "id": "part_def456",
73 "object": "upload.part",
74 "created_at": 1719185911,
75 "upload_id": "upload_abc123"
76}
77```
78
79## Domain Types
80
81### Upload Part
82
83- `UploadPart object { id, created_at, object, upload_id }`
84
85 The upload Part represents a chunk of bytes we can add to an Upload object.
86
87 - `id: string`
88
89 The upload Part unique identifier, which can be referenced in API endpoints.
90
91 - `created_at: number`
92
93 The Unix timestamp (in seconds) for when the Part was created.
94
95 - `object: "upload.part"`
96
97 The object type, which is always `upload.part`.
98
99 - `"upload.part"`
100
101 - `upload_id: string`
102
103 The ID of the Upload object that this Part was added to.