Skip to content
Primary navigation

Retrieve container file content

client.containers.files.content.retrieve(stringfileID, ContentRetrieveParams { container_id } params, RequestOptionsoptions?): Response
GET/containers/{container_id}/files/{file_id}/content

Retrieve Container File Content

ParametersExpand Collapse
fileID: string
params: ContentRetrieveParams { container_id }
container_id: string
ReturnsExpand Collapse
unnamed_schema_2 = Response

Retrieve container file content

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const content = await client.containers.files.content.retrieve('file_id', {
  container_id: 'container_id',
});

console.log(content);

const data = await content.blob();
console.log(data);
<binary content of the file>
Returns Examples
<binary content of the file>