cli/resources/containers/subresources/files/index.md +0 −304 deleted
File Deleted View Diff
1# Files
2
3## List container files
4
5`$ openai containers:files list`
6
7**get** `/containers/{container_id}/files`
8
9List Container files
10
11### Parameters
12
13- `--container-id: string`
14
15- `--after: optional string`
16
17 A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
18
19- `--limit: optional number`
20
21 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
22
23- `--order: optional "asc" or "desc"`
24
25 Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
26
27### Returns
28
29- `ContainerFileListResource: object { data, first_id, has_more, 2 more }`
30
31 - `data: array of object { id, bytes, container_id, 4 more }`
32
33 A list of container files.
34
35 - `id: string`
36
37 Unique identifier for the file.
38
39 - `bytes: number`
40
41 Size of the file in bytes.
42
43 - `container_id: string`
44
45 The container this file belongs to.
46
47 - `created_at: number`
48
49 Unix timestamp (in seconds) when the file was created.
50
51 - `object: "container.file"`
52
53 The type of this object (`container.file`).
54
55 - `path: string`
56
57 Path of the file in the container.
58
59 - `source: string`
60
61 Source of the file (e.g., `user`, `assistant`).
62
63 - `first_id: string`
64
65 The ID of the first file in the list.
66
67 - `has_more: boolean`
68
69 Whether there are more files available.
70
71 - `last_id: string`
72
73 The ID of the last file in the list.
74
75 - `object: "list"`
76
77 The type of object returned, must be 'list'.
78
79### Example
80
81```cli
82openai containers:files list \
83 --api-key 'My API Key' \
84 --container-id container_id
85```
86
87#### Response
88
89```json
90{
91 "data": [
92 {
93 "id": "id",
94 "bytes": 0,
95 "container_id": "container_id",
96 "created_at": 0,
97 "object": "container.file",
98 "path": "path",
99 "source": "source"
100 }
101 ],
102 "first_id": "first_id",
103 "has_more": true,
104 "last_id": "last_id",
105 "object": "list"
106}
107```
108
109## Create container file
110
111`$ openai containers:files create`
112
113**post** `/containers/{container_id}/files`
114
115Create a Container File
116
117You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.
118
119### Parameters
120
121- `--container-id: string`
122
123- `--file: optional string`
124
125 The File object (not file name) to be uploaded.
126
127- `--file-id: optional string`
128
129 Name of the file to create.
130
131### Returns
132
133- `ContainerFileNewResponse: object { id, bytes, container_id, 4 more }`
134
135 - `id: string`
136
137 Unique identifier for the file.
138
139 - `bytes: number`
140
141 Size of the file in bytes.
142
143 - `container_id: string`
144
145 The container this file belongs to.
146
147 - `created_at: number`
148
149 Unix timestamp (in seconds) when the file was created.
150
151 - `object: "container.file"`
152
153 The type of this object (`container.file`).
154
155 - `path: string`
156
157 Path of the file in the container.
158
159 - `source: string`
160
161 Source of the file (e.g., `user`, `assistant`).
162
163### Example
164
165```cli
166openai containers:files create \
167 --api-key 'My API Key' \
168 --container-id container_id
169```
170
171#### Response
172
173```json
174{
175 "id": "id",
176 "bytes": 0,
177 "container_id": "container_id",
178 "created_at": 0,
179 "object": "container.file",
180 "path": "path",
181 "source": "source"
182}
183```
184
185## Retrieve container file
186
187`$ openai containers:files retrieve`
188
189**get** `/containers/{container_id}/files/{file_id}`
190
191Retrieve Container File
192
193### Parameters
194
195- `--container-id: string`
196
197- `--file-id: string`
198
199### Returns
200
201- `ContainerFileGetResponse: object { id, bytes, container_id, 4 more }`
202
203 - `id: string`
204
205 Unique identifier for the file.
206
207 - `bytes: number`
208
209 Size of the file in bytes.
210
211 - `container_id: string`
212
213 The container this file belongs to.
214
215 - `created_at: number`
216
217 Unix timestamp (in seconds) when the file was created.
218
219 - `object: "container.file"`
220
221 The type of this object (`container.file`).
222
223 - `path: string`
224
225 Path of the file in the container.
226
227 - `source: string`
228
229 Source of the file (e.g., `user`, `assistant`).
230
231### Example
232
233```cli
234openai containers:files retrieve \
235 --api-key 'My API Key' \
236 --container-id container_id \
237 --file-id file_id
238```
239
240#### Response
241
242```json
243{
244 "id": "id",
245 "bytes": 0,
246 "container_id": "container_id",
247 "created_at": 0,
248 "object": "container.file",
249 "path": "path",
250 "source": "source"
251}
252```
253
254## Delete a container file
255
256`$ openai containers:files delete`
257
258**delete** `/containers/{container_id}/files/{file_id}`
259
260Delete Container File
261
262### Parameters
263
264- `--container-id: string`
265
266- `--file-id: string`
267
268### Example
269
270```cli
271openai containers:files delete \
272 --api-key 'My API Key' \
273 --container-id container_id \
274 --file-id file_id
275```
276
277# Content
278
279## Retrieve container file content
280
281`$ openai containers:files:content retrieve`
282
283**get** `/containers/{container_id}/files/{file_id}/content`
284
285Retrieve Container File Content
286
287### Parameters
288
289- `--container-id: string`
290
291- `--file-id: string`
292
293### Returns
294
295- `unnamed_schema_3: file path`
296
297### Example
298
299```cli
300openai containers:files:content retrieve \
301 --api-key 'My API Key' \
302 --container-id container_id \
303 --file-id file_id
304```