cli/resources/uploads/methods/complete/index.md +0 −171 deleted
File Deleted View Diff
1## Complete upload
2
3`$ openai uploads complete`
4
5**post** `/uploads/{upload_id}/complete`
6
7Completes the [Upload](https://platform.openai.com/docs/api-reference/uploads/object).
8
9Within the returned Upload object, there is a nested [File](https://platform.openai.com/docs/api-reference/files/object) object that is ready to use in the rest of the platform.
10
11You can specify the order of the Parts by passing in an ordered list of the Part IDs.
12
13The 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.
14Returns the Upload object with status `completed`, including an additional `file` property containing the created usable File object.
15
16### Parameters
17
18- `--upload-id: string`
19
20 The ID of the Upload.
21
22- `--part-id: array of string`
23
24 The ordered list of Part IDs.
25
26- `--md5: optional string`
27
28 The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
29
30### Returns
31
32- `upload: object { id, bytes, created_at, 6 more }`
33
34 The Upload object can accept byte chunks in the form of Parts.
35
36 - `id: string`
37
38 The Upload unique identifier, which can be referenced in API endpoints.
39
40 - `bytes: number`
41
42 The intended number of bytes to be uploaded.
43
44 - `created_at: number`
45
46 The Unix timestamp (in seconds) for when the Upload was created.
47
48 - `expires_at: number`
49
50 The Unix timestamp (in seconds) for when the Upload will expire.
51
52 - `filename: string`
53
54 The name of the file to be uploaded.
55
56 - `object: "upload"`
57
58 The object type, which is always "upload".
59
60 - `purpose: string`
61
62 The intended purpose of the file. [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) for acceptable values.
63
64 - `status: "pending" or "completed" or "cancelled" or "expired"`
65
66 The status of the Upload.
67
68 - `"pending"`
69
70 - `"completed"`
71
72 - `"cancelled"`
73
74 - `"expired"`
75
76 - `file: optional object { id, bytes, created_at, 6 more }`
77
78 The `File` object represents a document that has been uploaded to OpenAI.
79
80 - `id: string`
81
82 The file identifier, which can be referenced in the API endpoints.
83
84 - `bytes: number`
85
86 The size of the file, in bytes.
87
88 - `created_at: number`
89
90 The Unix timestamp (in seconds) for when the file was created.
91
92 - `filename: string`
93
94 The name of the file.
95
96 - `object: "file"`
97
98 The object type, which is always `file`.
99
100 - `purpose: "assistants" or "assistants_output" or "batch" or 5 more`
101
102 The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
103
104 - `"assistants"`
105
106 - `"assistants_output"`
107
108 - `"batch"`
109
110 - `"batch_output"`
111
112 - `"fine-tune"`
113
114 - `"fine-tune-results"`
115
116 - `"vision"`
117
118 - `"user_data"`
119
120 - `status: "uploaded" or "processed" or "error"`
121
122 Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
123
124 - `"uploaded"`
125
126 - `"processed"`
127
128 - `"error"`
129
130 - `expires_at: optional number`
131
132 The Unix timestamp (in seconds) for when the file will expire.
133
134 - `status_details: optional string`
135
136 Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
137
138### Example
139
140```cli
141openai uploads complete \
142 --api-key 'My API Key' \
143 --upload-id upload_abc123 \
144 --part-id string
145```
146
147#### Response
148
149```json
150{
151 "id": "id",
152 "bytes": 0,
153 "created_at": 0,
154 "expires_at": 0,
155 "filename": "filename",
156 "object": "upload",
157 "purpose": "purpose",
158 "status": "pending",
159 "file": {
160 "id": "id",
161 "bytes": 0,
162 "created_at": 0,
163 "filename": "filename",
164 "object": "file",
165 "purpose": "assistants",
166 "status": "uploaded",
167 "expires_at": 0,
168 "status_details": "status_details"
169 }
170}
171```