python/resources/containers/index.md +0 −1201 deleted
File Deleted View Diff
1# Containers
2
3## List containers
4
5`containers.list(ContainerListParams**kwargs) -> SyncCursorPage[ContainerListResponse]`
6
7**get** `/containers`
8
9List Containers
10
11### Parameters
12
13- `after: Optional[str]`
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[int]`
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[str]`
22
23 Filter results by container name.
24
25- `order: Optional[Literal["asc", "desc"]]`
26
27 Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
28
29 - `"asc"`
30
31 - `"desc"`
32
33### Returns
34
35- `class ContainerListResponse: …`
36
37 - `id: str`
38
39 Unique identifier for the container.
40
41 - `created_at: int`
42
43 Unix timestamp (in seconds) when the container was created.
44
45 - `name: str`
46
47 Name of the container.
48
49 - `object: str`
50
51 The type of this object.
52
53 - `status: str`
54
55 Status of the container (e.g., active, deleted).
56
57 - `expires_after: Optional[ExpiresAfter]`
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[Literal["last_active_at"]]`
64
65 The reference point for the expiration.
66
67 - `"last_active_at"`
68
69 - `minutes: Optional[int]`
70
71 The number of minutes after the anchor before the container expires.
72
73 - `last_active_at: Optional[int]`
74
75 Unix timestamp (in seconds) when the container was last active.
76
77 - `memory_limit: Optional[Literal["1g", "4g", "16g", "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[NetworkPolicy]`
90
91 Network access policy for the container.
92
93 - `type: Literal["allowlist", "disabled"]`
94
95 The network policy mode.
96
97 - `"allowlist"`
98
99 - `"disabled"`
100
101 - `allowed_domains: Optional[List[str]]`
102
103 Allowed outbound domains when `type` is `allowlist`.
104
105### Example
106
107```python
108import os
109from openai import OpenAI
110
111client = OpenAI(
112 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
113)
114page = client.containers.list()
115page = page.data[0]
116print(page.id)
117```
118
119#### Response
120
121```json
122{
123 "data": [
124 {
125 "id": "id",
126 "created_at": 0,
127 "name": "name",
128 "object": "object",
129 "status": "status",
130 "expires_after": {
131 "anchor": "last_active_at",
132 "minutes": 0
133 },
134 "last_active_at": 0,
135 "memory_limit": "1g",
136 "network_policy": {
137 "type": "allowlist",
138 "allowed_domains": [
139 "string"
140 ]
141 }
142 }
143 ],
144 "first_id": "first_id",
145 "has_more": true,
146 "last_id": "last_id",
147 "object": "list"
148}
149```
150
151## Create container
152
153`containers.create(ContainerCreateParams**kwargs) -> ContainerCreateResponse`
154
155**post** `/containers`
156
157Create Container
158
159### Parameters
160
161- `name: str`
162
163 Name of the container to create.
164
165- `expires_after: Optional[ExpiresAfter]`
166
167 Container expiration time in seconds relative to the 'anchor' time.
168
169 - `anchor: Literal["last_active_at"]`
170
171 Time anchor for the expiration time. Currently only 'last_active_at' is supported.
172
173 - `"last_active_at"`
174
175 - `minutes: int`
176
177- `file_ids: Optional[Sequence[str]]`
178
179 IDs of files to copy to the container.
180
181- `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`
182
183 Optional memory limit for the container. Defaults to "1g".
184
185 - `"1g"`
186
187 - `"4g"`
188
189 - `"16g"`
190
191 - `"64g"`
192
193- `network_policy: Optional[NetworkPolicy]`
194
195 Network access policy for the container.
196
197 - `class ContainerNetworkPolicyDisabled: …`
198
199 - `type: Literal["disabled"]`
200
201 Disable outbound network access. Always `disabled`.
202
203 - `"disabled"`
204
205 - `class ContainerNetworkPolicyAllowlist: …`
206
207 - `allowed_domains: List[str]`
208
209 A list of allowed domains when type is `allowlist`.
210
211 - `type: Literal["allowlist"]`
212
213 Allow outbound network access only to specified domains. Always `allowlist`.
214
215 - `"allowlist"`
216
217 - `domain_secrets: Optional[List[ContainerNetworkPolicyDomainSecret]]`
218
219 Optional domain-scoped secrets for allowlisted domains.
220
221 - `domain: str`
222
223 The domain associated with the secret.
224
225 - `name: str`
226
227 The name of the secret to inject for the domain.
228
229 - `value: str`
230
231 The secret value to inject for the domain.
232
233- `skills: Optional[Iterable[Skill]]`
234
235 An optional list of skills referenced by id or inline data.
236
237 - `class SkillReference: …`
238
239 - `skill_id: str`
240
241 The ID of the referenced skill.
242
243 - `type: Literal["skill_reference"]`
244
245 References a skill created with the /v1/skills endpoint.
246
247 - `"skill_reference"`
248
249 - `version: Optional[str]`
250
251 Optional skill version. Use a positive integer or 'latest'. Omit for default.
252
253 - `class InlineSkill: …`
254
255 - `description: str`
256
257 The description of the skill.
258
259 - `name: str`
260
261 The name of the skill.
262
263 - `source: InlineSkillSource`
264
265 Inline skill payload
266
267 - `data: str`
268
269 Base64-encoded skill zip bundle.
270
271 - `media_type: Literal["application/zip"]`
272
273 The media type of the inline skill payload. Must be `application/zip`.
274
275 - `"application/zip"`
276
277 - `type: Literal["base64"]`
278
279 The type of the inline skill source. Must be `base64`.
280
281 - `"base64"`
282
283 - `type: Literal["inline"]`
284
285 Defines an inline skill for this request.
286
287 - `"inline"`
288
289### Returns
290
291- `class ContainerCreateResponse: …`
292
293 - `id: str`
294
295 Unique identifier for the container.
296
297 - `created_at: int`
298
299 Unix timestamp (in seconds) when the container was created.
300
301 - `name: str`
302
303 Name of the container.
304
305 - `object: str`
306
307 The type of this object.
308
309 - `status: str`
310
311 Status of the container (e.g., active, deleted).
312
313 - `expires_after: Optional[ExpiresAfter]`
314
315 The container will expire after this time period.
316 The anchor is the reference point for the expiration.
317 The minutes is the number of minutes after the anchor before the container expires.
318
319 - `anchor: Optional[Literal["last_active_at"]]`
320
321 The reference point for the expiration.
322
323 - `"last_active_at"`
324
325 - `minutes: Optional[int]`
326
327 The number of minutes after the anchor before the container expires.
328
329 - `last_active_at: Optional[int]`
330
331 Unix timestamp (in seconds) when the container was last active.
332
333 - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`
334
335 The memory limit configured for the container.
336
337 - `"1g"`
338
339 - `"4g"`
340
341 - `"16g"`
342
343 - `"64g"`
344
345 - `network_policy: Optional[NetworkPolicy]`
346
347 Network access policy for the container.
348
349 - `type: Literal["allowlist", "disabled"]`
350
351 The network policy mode.
352
353 - `"allowlist"`
354
355 - `"disabled"`
356
357 - `allowed_domains: Optional[List[str]]`
358
359 Allowed outbound domains when `type` is `allowlist`.
360
361### Example
362
363```python
364import os
365from openai import OpenAI
366
367client = OpenAI(
368 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
369)
370container = client.containers.create(
371 name="name",
372)
373print(container.id)
374```
375
376#### Response
377
378```json
379{
380 "id": "id",
381 "created_at": 0,
382 "name": "name",
383 "object": "object",
384 "status": "status",
385 "expires_after": {
386 "anchor": "last_active_at",
387 "minutes": 0
388 },
389 "last_active_at": 0,
390 "memory_limit": "1g",
391 "network_policy": {
392 "type": "allowlist",
393 "allowed_domains": [
394 "string"
395 ]
396 }
397}
398```
399
400## Retrieve container
401
402`containers.retrieve(strcontainer_id) -> ContainerRetrieveResponse`
403
404**get** `/containers/{container_id}`
405
406Retrieve Container
407
408### Parameters
409
410- `container_id: str`
411
412### Returns
413
414- `class ContainerRetrieveResponse: …`
415
416 - `id: str`
417
418 Unique identifier for the container.
419
420 - `created_at: int`
421
422 Unix timestamp (in seconds) when the container was created.
423
424 - `name: str`
425
426 Name of the container.
427
428 - `object: str`
429
430 The type of this object.
431
432 - `status: str`
433
434 Status of the container (e.g., active, deleted).
435
436 - `expires_after: Optional[ExpiresAfter]`
437
438 The container will expire after this time period.
439 The anchor is the reference point for the expiration.
440 The minutes is the number of minutes after the anchor before the container expires.
441
442 - `anchor: Optional[Literal["last_active_at"]]`
443
444 The reference point for the expiration.
445
446 - `"last_active_at"`
447
448 - `minutes: Optional[int]`
449
450 The number of minutes after the anchor before the container expires.
451
452 - `last_active_at: Optional[int]`
453
454 Unix timestamp (in seconds) when the container was last active.
455
456 - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`
457
458 The memory limit configured for the container.
459
460 - `"1g"`
461
462 - `"4g"`
463
464 - `"16g"`
465
466 - `"64g"`
467
468 - `network_policy: Optional[NetworkPolicy]`
469
470 Network access policy for the container.
471
472 - `type: Literal["allowlist", "disabled"]`
473
474 The network policy mode.
475
476 - `"allowlist"`
477
478 - `"disabled"`
479
480 - `allowed_domains: Optional[List[str]]`
481
482 Allowed outbound domains when `type` is `allowlist`.
483
484### Example
485
486```python
487import os
488from openai import OpenAI
489
490client = OpenAI(
491 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
492)
493container = client.containers.retrieve(
494 "container_id",
495)
496print(container.id)
497```
498
499#### Response
500
501```json
502{
503 "id": "id",
504 "created_at": 0,
505 "name": "name",
506 "object": "object",
507 "status": "status",
508 "expires_after": {
509 "anchor": "last_active_at",
510 "minutes": 0
511 },
512 "last_active_at": 0,
513 "memory_limit": "1g",
514 "network_policy": {
515 "type": "allowlist",
516 "allowed_domains": [
517 "string"
518 ]
519 }
520}
521```
522
523## Delete a container
524
525`containers.delete(strcontainer_id)`
526
527**delete** `/containers/{container_id}`
528
529Delete Container
530
531### Parameters
532
533- `container_id: str`
534
535### Example
536
537```python
538import os
539from openai import OpenAI
540
541client = OpenAI(
542 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
543)
544client.containers.delete(
545 "container_id",
546)
547```
548
549## Domain Types
550
551### Container List Response
552
553- `class ContainerListResponse: …`
554
555 - `id: str`
556
557 Unique identifier for the container.
558
559 - `created_at: int`
560
561 Unix timestamp (in seconds) when the container was created.
562
563 - `name: str`
564
565 Name of the container.
566
567 - `object: str`
568
569 The type of this object.
570
571 - `status: str`
572
573 Status of the container (e.g., active, deleted).
574
575 - `expires_after: Optional[ExpiresAfter]`
576
577 The container will expire after this time period.
578 The anchor is the reference point for the expiration.
579 The minutes is the number of minutes after the anchor before the container expires.
580
581 - `anchor: Optional[Literal["last_active_at"]]`
582
583 The reference point for the expiration.
584
585 - `"last_active_at"`
586
587 - `minutes: Optional[int]`
588
589 The number of minutes after the anchor before the container expires.
590
591 - `last_active_at: Optional[int]`
592
593 Unix timestamp (in seconds) when the container was last active.
594
595 - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`
596
597 The memory limit configured for the container.
598
599 - `"1g"`
600
601 - `"4g"`
602
603 - `"16g"`
604
605 - `"64g"`
606
607 - `network_policy: Optional[NetworkPolicy]`
608
609 Network access policy for the container.
610
611 - `type: Literal["allowlist", "disabled"]`
612
613 The network policy mode.
614
615 - `"allowlist"`
616
617 - `"disabled"`
618
619 - `allowed_domains: Optional[List[str]]`
620
621 Allowed outbound domains when `type` is `allowlist`.
622
623### Container Create Response
624
625- `class ContainerCreateResponse: …`
626
627 - `id: str`
628
629 Unique identifier for the container.
630
631 - `created_at: int`
632
633 Unix timestamp (in seconds) when the container was created.
634
635 - `name: str`
636
637 Name of the container.
638
639 - `object: str`
640
641 The type of this object.
642
643 - `status: str`
644
645 Status of the container (e.g., active, deleted).
646
647 - `expires_after: Optional[ExpiresAfter]`
648
649 The container will expire after this time period.
650 The anchor is the reference point for the expiration.
651 The minutes is the number of minutes after the anchor before the container expires.
652
653 - `anchor: Optional[Literal["last_active_at"]]`
654
655 The reference point for the expiration.
656
657 - `"last_active_at"`
658
659 - `minutes: Optional[int]`
660
661 The number of minutes after the anchor before the container expires.
662
663 - `last_active_at: Optional[int]`
664
665 Unix timestamp (in seconds) when the container was last active.
666
667 - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`
668
669 The memory limit configured for the container.
670
671 - `"1g"`
672
673 - `"4g"`
674
675 - `"16g"`
676
677 - `"64g"`
678
679 - `network_policy: Optional[NetworkPolicy]`
680
681 Network access policy for the container.
682
683 - `type: Literal["allowlist", "disabled"]`
684
685 The network policy mode.
686
687 - `"allowlist"`
688
689 - `"disabled"`
690
691 - `allowed_domains: Optional[List[str]]`
692
693 Allowed outbound domains when `type` is `allowlist`.
694
695### Container Retrieve Response
696
697- `class ContainerRetrieveResponse: …`
698
699 - `id: str`
700
701 Unique identifier for the container.
702
703 - `created_at: int`
704
705 Unix timestamp (in seconds) when the container was created.
706
707 - `name: str`
708
709 Name of the container.
710
711 - `object: str`
712
713 The type of this object.
714
715 - `status: str`
716
717 Status of the container (e.g., active, deleted).
718
719 - `expires_after: Optional[ExpiresAfter]`
720
721 The container will expire after this time period.
722 The anchor is the reference point for the expiration.
723 The minutes is the number of minutes after the anchor before the container expires.
724
725 - `anchor: Optional[Literal["last_active_at"]]`
726
727 The reference point for the expiration.
728
729 - `"last_active_at"`
730
731 - `minutes: Optional[int]`
732
733 The number of minutes after the anchor before the container expires.
734
735 - `last_active_at: Optional[int]`
736
737 Unix timestamp (in seconds) when the container was last active.
738
739 - `memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]`
740
741 The memory limit configured for the container.
742
743 - `"1g"`
744
745 - `"4g"`
746
747 - `"16g"`
748
749 - `"64g"`
750
751 - `network_policy: Optional[NetworkPolicy]`
752
753 Network access policy for the container.
754
755 - `type: Literal["allowlist", "disabled"]`
756
757 The network policy mode.
758
759 - `"allowlist"`
760
761 - `"disabled"`
762
763 - `allowed_domains: Optional[List[str]]`
764
765 Allowed outbound domains when `type` is `allowlist`.
766
767# Files
768
769## List container files
770
771`containers.files.list(strcontainer_id, FileListParams**kwargs) -> SyncCursorPage[FileListResponse]`
772
773**get** `/containers/{container_id}/files`
774
775List Container files
776
777### Parameters
778
779- `container_id: str`
780
781- `after: Optional[str]`
782
783 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.
784
785- `limit: Optional[int]`
786
787 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
788
789- `order: Optional[Literal["asc", "desc"]]`
790
791 Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
792
793 - `"asc"`
794
795 - `"desc"`
796
797### Returns
798
799- `class FileListResponse: …`
800
801 - `id: str`
802
803 Unique identifier for the file.
804
805 - `bytes: int`
806
807 Size of the file in bytes.
808
809 - `container_id: str`
810
811 The container this file belongs to.
812
813 - `created_at: int`
814
815 Unix timestamp (in seconds) when the file was created.
816
817 - `object: Literal["container.file"]`
818
819 The type of this object (`container.file`).
820
821 - `"container.file"`
822
823 - `path: str`
824
825 Path of the file in the container.
826
827 - `source: str`
828
829 Source of the file (e.g., `user`, `assistant`).
830
831### Example
832
833```python
834import os
835from openai import OpenAI
836
837client = OpenAI(
838 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
839)
840page = client.containers.files.list(
841 container_id="container_id",
842)
843page = page.data[0]
844print(page.id)
845```
846
847#### Response
848
849```json
850{
851 "data": [
852 {
853 "id": "id",
854 "bytes": 0,
855 "container_id": "container_id",
856 "created_at": 0,
857 "object": "container.file",
858 "path": "path",
859 "source": "source"
860 }
861 ],
862 "first_id": "first_id",
863 "has_more": true,
864 "last_id": "last_id",
865 "object": "list"
866}
867```
868
869## Create container file
870
871`containers.files.create(strcontainer_id, FileCreateParams**kwargs) -> FileCreateResponse`
872
873**post** `/containers/{container_id}/files`
874
875Create a Container File
876
877You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.
878
879### Parameters
880
881- `container_id: str`
882
883- `file: Optional[FileTypes]`
884
885 The File object (not file name) to be uploaded.
886
887- `file_id: Optional[str]`
888
889 Name of the file to create.
890
891### Returns
892
893- `class FileCreateResponse: …`
894
895 - `id: str`
896
897 Unique identifier for the file.
898
899 - `bytes: int`
900
901 Size of the file in bytes.
902
903 - `container_id: str`
904
905 The container this file belongs to.
906
907 - `created_at: int`
908
909 Unix timestamp (in seconds) when the file was created.
910
911 - `object: Literal["container.file"]`
912
913 The type of this object (`container.file`).
914
915 - `"container.file"`
916
917 - `path: str`
918
919 Path of the file in the container.
920
921 - `source: str`
922
923 Source of the file (e.g., `user`, `assistant`).
924
925### Example
926
927```python
928import os
929from openai import OpenAI
930
931client = OpenAI(
932 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
933)
934file = client.containers.files.create(
935 container_id="container_id",
936)
937print(file.id)
938```
939
940#### Response
941
942```json
943{
944 "id": "id",
945 "bytes": 0,
946 "container_id": "container_id",
947 "created_at": 0,
948 "object": "container.file",
949 "path": "path",
950 "source": "source"
951}
952```
953
954## Retrieve container file
955
956`containers.files.retrieve(strfile_id, FileRetrieveParams**kwargs) -> FileRetrieveResponse`
957
958**get** `/containers/{container_id}/files/{file_id}`
959
960Retrieve Container File
961
962### Parameters
963
964- `container_id: str`
965
966- `file_id: str`
967
968### Returns
969
970- `class FileRetrieveResponse: …`
971
972 - `id: str`
973
974 Unique identifier for the file.
975
976 - `bytes: int`
977
978 Size of the file in bytes.
979
980 - `container_id: str`
981
982 The container this file belongs to.
983
984 - `created_at: int`
985
986 Unix timestamp (in seconds) when the file was created.
987
988 - `object: Literal["container.file"]`
989
990 The type of this object (`container.file`).
991
992 - `"container.file"`
993
994 - `path: str`
995
996 Path of the file in the container.
997
998 - `source: str`
999
1000 Source of the file (e.g., `user`, `assistant`).
1001
1002### Example
1003
1004```python
1005import os
1006from openai import OpenAI
1007
1008client = OpenAI(
1009 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
1010)
1011file = client.containers.files.retrieve(
1012 file_id="file_id",
1013 container_id="container_id",
1014)
1015print(file.id)
1016```
1017
1018#### Response
1019
1020```json
1021{
1022 "id": "id",
1023 "bytes": 0,
1024 "container_id": "container_id",
1025 "created_at": 0,
1026 "object": "container.file",
1027 "path": "path",
1028 "source": "source"
1029}
1030```
1031
1032## Delete a container file
1033
1034`containers.files.delete(strfile_id, FileDeleteParams**kwargs)`
1035
1036**delete** `/containers/{container_id}/files/{file_id}`
1037
1038Delete Container File
1039
1040### Parameters
1041
1042- `container_id: str`
1043
1044- `file_id: str`
1045
1046### Example
1047
1048```python
1049import os
1050from openai import OpenAI
1051
1052client = OpenAI(
1053 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
1054)
1055client.containers.files.delete(
1056 file_id="file_id",
1057 container_id="container_id",
1058)
1059```
1060
1061## Domain Types
1062
1063### File List Response
1064
1065- `class FileListResponse: …`
1066
1067 - `id: str`
1068
1069 Unique identifier for the file.
1070
1071 - `bytes: int`
1072
1073 Size of the file in bytes.
1074
1075 - `container_id: str`
1076
1077 The container this file belongs to.
1078
1079 - `created_at: int`
1080
1081 Unix timestamp (in seconds) when the file was created.
1082
1083 - `object: Literal["container.file"]`
1084
1085 The type of this object (`container.file`).
1086
1087 - `"container.file"`
1088
1089 - `path: str`
1090
1091 Path of the file in the container.
1092
1093 - `source: str`
1094
1095 Source of the file (e.g., `user`, `assistant`).
1096
1097### File Create Response
1098
1099- `class FileCreateResponse: …`
1100
1101 - `id: str`
1102
1103 Unique identifier for the file.
1104
1105 - `bytes: int`
1106
1107 Size of the file in bytes.
1108
1109 - `container_id: str`
1110
1111 The container this file belongs to.
1112
1113 - `created_at: int`
1114
1115 Unix timestamp (in seconds) when the file was created.
1116
1117 - `object: Literal["container.file"]`
1118
1119 The type of this object (`container.file`).
1120
1121 - `"container.file"`
1122
1123 - `path: str`
1124
1125 Path of the file in the container.
1126
1127 - `source: str`
1128
1129 Source of the file (e.g., `user`, `assistant`).
1130
1131### File Retrieve Response
1132
1133- `class FileRetrieveResponse: …`
1134
1135 - `id: str`
1136
1137 Unique identifier for the file.
1138
1139 - `bytes: int`
1140
1141 Size of the file in bytes.
1142
1143 - `container_id: str`
1144
1145 The container this file belongs to.
1146
1147 - `created_at: int`
1148
1149 Unix timestamp (in seconds) when the file was created.
1150
1151 - `object: Literal["container.file"]`
1152
1153 The type of this object (`container.file`).
1154
1155 - `"container.file"`
1156
1157 - `path: str`
1158
1159 Path of the file in the container.
1160
1161 - `source: str`
1162
1163 Source of the file (e.g., `user`, `assistant`).
1164
1165# Content
1166
1167## Retrieve container file content
1168
1169`containers.files.content.retrieve(strfile_id, ContentRetrieveParams**kwargs) -> BinaryResponseContent`
1170
1171**get** `/containers/{container_id}/files/{file_id}/content`
1172
1173Retrieve Container File Content
1174
1175### Parameters
1176
1177- `container_id: str`
1178
1179- `file_id: str`
1180
1181### Returns
1182
1183- `BinaryResponseContent`
1184
1185### Example
1186
1187```python
1188import os
1189from openai import OpenAI
1190
1191client = OpenAI(
1192 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
1193)
1194content = client.containers.files.content.retrieve(
1195 file_id="file_id",
1196 container_id="container_id",
1197)
1198print(content)
1199data = content.read()
1200print(data)
1201```