Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Retrieve container file content

containers.files.content.retrieve(strfile_id, ContentRetrieveParams**kwargs) -> BinaryResponseContent
GET/containers/{container_id}/files/{file_id}/content

Retrieve Container File Content

ParametersExpand Collapse
container_id: str
file_id: str
ReturnsExpand Collapse
BinaryResponseContent

Retrieve container file content

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
content = client.containers.files.content.retrieve(
    file_id="file_id",
    container_id="container_id",
)
print(content)
data = content.read()
print(data)
<binary content of the file>
Returns Examples
<binary content of the file>