cli/resources/containers/index.md +0 −739 deleted
File Deleted View Diff
1# Containers
2
3## List containers
4
5`$ openai containers list`
6
7**get** `/containers`
8
9List Containers
10
11### Parameters
12
13- `--after: optional string`
14
15 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.
16
17- `--limit: optional number`
18
19 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
20
21- `--name: optional string`
22
23 Filter results by container name.
24
25- `--order: optional "asc" or "desc"`
26
27 Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
28
29### Returns
30
31- `ContainerListResource: object { data, first_id, has_more, 2 more }`
32
33 - `data: array of object { id, created_at, name, 6 more }`
34
35 A list of containers.
36
37 - `id: string`
38
39 Unique identifier for the container.
40
41 - `created_at: number`
42
43 Unix timestamp (in seconds) when the container was created.
44
45 - `name: string`
46
47 Name of the container.
48
49 - `object: string`
50
51 The type of this object.
52
53 - `status: string`
54
55 Status of the container (e.g., active, deleted).
56
57 - `expires_after: optional object { anchor, minutes }`
58
59 The container will expire after this time period.
60 The anchor is the reference point for the expiration.
61 The minutes is the number of minutes after the anchor before the container expires.
62
63 - `anchor: optional "last_active_at"`
64
65 The reference point for the expiration.
66
67 - `"last_active_at"`
68
69 - `minutes: optional number`
70
71 The number of minutes after the anchor before the container expires.
72
73 - `last_active_at: optional number`
74
75 Unix timestamp (in seconds) when the container was last active.
76
77 - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`
78
79 The memory limit configured for the container.
80
81 - `"1g"`
82
83 - `"4g"`
84
85 - `"16g"`
86
87 - `"64g"`
88
89 - `network_policy: optional object { type, allowed_domains }`
90
91 Network access policy for the container.
92
93 - `type: "allowlist" or "disabled"`
94
95 The network policy mode.
96
97 - `"allowlist"`
98
99 - `"disabled"`
100
101 - `allowed_domains: optional array of string`
102
103 Allowed outbound domains when `type` is `allowlist`.
104
105 - `first_id: string`
106
107 The ID of the first container in the list.
108
109 - `has_more: boolean`
110
111 Whether there are more containers available.
112
113 - `last_id: string`
114
115 The ID of the last container in the list.
116
117 - `object: "list"`
118
119 The type of object returned, must be 'list'.
120
121### Example
122
123```cli
124openai containers list \
125 --api-key 'My API Key'
126```
127
128#### Response
129
130```json
131{
132 "data": [
133 {
134 "id": "id",
135 "created_at": 0,
136 "name": "name",
137 "object": "object",
138 "status": "status",
139 "expires_after": {
140 "anchor": "last_active_at",
141 "minutes": 0
142 },
143 "last_active_at": 0,
144 "memory_limit": "1g",
145 "network_policy": {
146 "type": "allowlist",
147 "allowed_domains": [
148 "string"
149 ]
150 }
151 }
152 ],
153 "first_id": "first_id",
154 "has_more": true,
155 "last_id": "last_id",
156 "object": "list"
157}
158```
159
160## Create container
161
162`$ openai containers create`
163
164**post** `/containers`
165
166Create Container
167
168### Parameters
169
170- `--name: string`
171
172 Name of the container to create.
173
174- `--expires-after: optional object { anchor, minutes }`
175
176 Container expiration time in seconds relative to the 'anchor' time.
177
178- `--file-id: optional array of string`
179
180 IDs of files to copy to the container.
181
182- `--memory-limit: optional "1g" or "4g" or "16g" or "64g"`
183
184 Optional memory limit for the container. Defaults to "1g".
185
186- `--network-policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist`
187
188 Network access policy for the container.
189
190- `--skill: optional array of SkillReference or InlineSkill`
191
192 An optional list of skills referenced by id or inline data.
193
194### Returns
195
196- `ContainerNewResponse: object { id, created_at, name, 6 more }`
197
198 - `id: string`
199
200 Unique identifier for the container.
201
202 - `created_at: number`
203
204 Unix timestamp (in seconds) when the container was created.
205
206 - `name: string`
207
208 Name of the container.
209
210 - `object: string`
211
212 The type of this object.
213
214 - `status: string`
215
216 Status of the container (e.g., active, deleted).
217
218 - `expires_after: optional object { anchor, minutes }`
219
220 The container will expire after this time period.
221 The anchor is the reference point for the expiration.
222 The minutes is the number of minutes after the anchor before the container expires.
223
224 - `anchor: optional "last_active_at"`
225
226 The reference point for the expiration.
227
228 - `"last_active_at"`
229
230 - `minutes: optional number`
231
232 The number of minutes after the anchor before the container expires.
233
234 - `last_active_at: optional number`
235
236 Unix timestamp (in seconds) when the container was last active.
237
238 - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`
239
240 The memory limit configured for the container.
241
242 - `"1g"`
243
244 - `"4g"`
245
246 - `"16g"`
247
248 - `"64g"`
249
250 - `network_policy: optional object { type, allowed_domains }`
251
252 Network access policy for the container.
253
254 - `type: "allowlist" or "disabled"`
255
256 The network policy mode.
257
258 - `"allowlist"`
259
260 - `"disabled"`
261
262 - `allowed_domains: optional array of string`
263
264 Allowed outbound domains when `type` is `allowlist`.
265
266### Example
267
268```cli
269openai containers create \
270 --api-key 'My API Key' \
271 --name name
272```
273
274#### Response
275
276```json
277{
278 "id": "id",
279 "created_at": 0,
280 "name": "name",
281 "object": "object",
282 "status": "status",
283 "expires_after": {
284 "anchor": "last_active_at",
285 "minutes": 0
286 },
287 "last_active_at": 0,
288 "memory_limit": "1g",
289 "network_policy": {
290 "type": "allowlist",
291 "allowed_domains": [
292 "string"
293 ]
294 }
295}
296```
297
298## Retrieve container
299
300`$ openai containers retrieve`
301
302**get** `/containers/{container_id}`
303
304Retrieve Container
305
306### Parameters
307
308- `--container-id: string`
309
310### Returns
311
312- `ContainerGetResponse: object { id, created_at, name, 6 more }`
313
314 - `id: string`
315
316 Unique identifier for the container.
317
318 - `created_at: number`
319
320 Unix timestamp (in seconds) when the container was created.
321
322 - `name: string`
323
324 Name of the container.
325
326 - `object: string`
327
328 The type of this object.
329
330 - `status: string`
331
332 Status of the container (e.g., active, deleted).
333
334 - `expires_after: optional object { anchor, minutes }`
335
336 The container will expire after this time period.
337 The anchor is the reference point for the expiration.
338 The minutes is the number of minutes after the anchor before the container expires.
339
340 - `anchor: optional "last_active_at"`
341
342 The reference point for the expiration.
343
344 - `"last_active_at"`
345
346 - `minutes: optional number`
347
348 The number of minutes after the anchor before the container expires.
349
350 - `last_active_at: optional number`
351
352 Unix timestamp (in seconds) when the container was last active.
353
354 - `memory_limit: optional "1g" or "4g" or "16g" or "64g"`
355
356 The memory limit configured for the container.
357
358 - `"1g"`
359
360 - `"4g"`
361
362 - `"16g"`
363
364 - `"64g"`
365
366 - `network_policy: optional object { type, allowed_domains }`
367
368 Network access policy for the container.
369
370 - `type: "allowlist" or "disabled"`
371
372 The network policy mode.
373
374 - `"allowlist"`
375
376 - `"disabled"`
377
378 - `allowed_domains: optional array of string`
379
380 Allowed outbound domains when `type` is `allowlist`.
381
382### Example
383
384```cli
385openai containers retrieve \
386 --api-key 'My API Key' \
387 --container-id container_id
388```
389
390#### Response
391
392```json
393{
394 "id": "id",
395 "created_at": 0,
396 "name": "name",
397 "object": "object",
398 "status": "status",
399 "expires_after": {
400 "anchor": "last_active_at",
401 "minutes": 0
402 },
403 "last_active_at": 0,
404 "memory_limit": "1g",
405 "network_policy": {
406 "type": "allowlist",
407 "allowed_domains": [
408 "string"
409 ]
410 }
411}
412```
413
414## Delete a container
415
416`$ openai containers delete`
417
418**delete** `/containers/{container_id}`
419
420Delete Container
421
422### Parameters
423
424- `--container-id: string`
425
426 The ID of the container to delete.
427
428### Example
429
430```cli
431openai containers delete \
432 --api-key 'My API Key' \
433 --container-id container_id
434```
435
436# Files
437
438## List container files
439
440`$ openai containers:files list`
441
442**get** `/containers/{container_id}/files`
443
444List Container files
445
446### Parameters
447
448- `--container-id: string`
449
450- `--after: optional string`
451
452 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.
453
454- `--limit: optional number`
455
456 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
457
458- `--order: optional "asc" or "desc"`
459
460 Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
461
462### Returns
463
464- `ContainerFileListResource: object { data, first_id, has_more, 2 more }`
465
466 - `data: array of object { id, bytes, container_id, 4 more }`
467
468 A list of container files.
469
470 - `id: string`
471
472 Unique identifier for the file.
473
474 - `bytes: number`
475
476 Size of the file in bytes.
477
478 - `container_id: string`
479
480 The container this file belongs to.
481
482 - `created_at: number`
483
484 Unix timestamp (in seconds) when the file was created.
485
486 - `object: "container.file"`
487
488 The type of this object (`container.file`).
489
490 - `path: string`
491
492 Path of the file in the container.
493
494 - `source: string`
495
496 Source of the file (e.g., `user`, `assistant`).
497
498 - `first_id: string`
499
500 The ID of the first file in the list.
501
502 - `has_more: boolean`
503
504 Whether there are more files available.
505
506 - `last_id: string`
507
508 The ID of the last file in the list.
509
510 - `object: "list"`
511
512 The type of object returned, must be 'list'.
513
514### Example
515
516```cli
517openai containers:files list \
518 --api-key 'My API Key' \
519 --container-id container_id
520```
521
522#### Response
523
524```json
525{
526 "data": [
527 {
528 "id": "id",
529 "bytes": 0,
530 "container_id": "container_id",
531 "created_at": 0,
532 "object": "container.file",
533 "path": "path",
534 "source": "source"
535 }
536 ],
537 "first_id": "first_id",
538 "has_more": true,
539 "last_id": "last_id",
540 "object": "list"
541}
542```
543
544## Create container file
545
546`$ openai containers:files create`
547
548**post** `/containers/{container_id}/files`
549
550Create a Container File
551
552You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.
553
554### Parameters
555
556- `--container-id: string`
557
558- `--file: optional string`
559
560 The File object (not file name) to be uploaded.
561
562- `--file-id: optional string`
563
564 Name of the file to create.
565
566### Returns
567
568- `ContainerFileNewResponse: object { id, bytes, container_id, 4 more }`
569
570 - `id: string`
571
572 Unique identifier for the file.
573
574 - `bytes: number`
575
576 Size of the file in bytes.
577
578 - `container_id: string`
579
580 The container this file belongs to.
581
582 - `created_at: number`
583
584 Unix timestamp (in seconds) when the file was created.
585
586 - `object: "container.file"`
587
588 The type of this object (`container.file`).
589
590 - `path: string`
591
592 Path of the file in the container.
593
594 - `source: string`
595
596 Source of the file (e.g., `user`, `assistant`).
597
598### Example
599
600```cli
601openai containers:files create \
602 --api-key 'My API Key' \
603 --container-id container_id
604```
605
606#### Response
607
608```json
609{
610 "id": "id",
611 "bytes": 0,
612 "container_id": "container_id",
613 "created_at": 0,
614 "object": "container.file",
615 "path": "path",
616 "source": "source"
617}
618```
619
620## Retrieve container file
621
622`$ openai containers:files retrieve`
623
624**get** `/containers/{container_id}/files/{file_id}`
625
626Retrieve Container File
627
628### Parameters
629
630- `--container-id: string`
631
632- `--file-id: string`
633
634### Returns
635
636- `ContainerFileGetResponse: object { id, bytes, container_id, 4 more }`
637
638 - `id: string`
639
640 Unique identifier for the file.
641
642 - `bytes: number`
643
644 Size of the file in bytes.
645
646 - `container_id: string`
647
648 The container this file belongs to.
649
650 - `created_at: number`
651
652 Unix timestamp (in seconds) when the file was created.
653
654 - `object: "container.file"`
655
656 The type of this object (`container.file`).
657
658 - `path: string`
659
660 Path of the file in the container.
661
662 - `source: string`
663
664 Source of the file (e.g., `user`, `assistant`).
665
666### Example
667
668```cli
669openai containers:files retrieve \
670 --api-key 'My API Key' \
671 --container-id container_id \
672 --file-id file_id
673```
674
675#### Response
676
677```json
678{
679 "id": "id",
680 "bytes": 0,
681 "container_id": "container_id",
682 "created_at": 0,
683 "object": "container.file",
684 "path": "path",
685 "source": "source"
686}
687```
688
689## Delete a container file
690
691`$ openai containers:files delete`
692
693**delete** `/containers/{container_id}/files/{file_id}`
694
695Delete Container File
696
697### Parameters
698
699- `--container-id: string`
700
701- `--file-id: string`
702
703### Example
704
705```cli
706openai containers:files delete \
707 --api-key 'My API Key' \
708 --container-id container_id \
709 --file-id file_id
710```
711
712# Content
713
714## Retrieve container file content
715
716`$ openai containers:files:content retrieve`
717
718**get** `/containers/{container_id}/files/{file_id}/content`
719
720Retrieve Container File Content
721
722### Parameters
723
724- `--container-id: string`
725
726- `--file-id: string`
727
728### Returns
729
730- `unnamed_schema_3: file path`
731
732### Example
733
734```cli
735openai containers:files:content retrieve \
736 --api-key 'My API Key' \
737 --container-id container_id \
738 --file-id file_id
739```