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 file content

client.files.content(fileID, options?): Response
GET
/files/{file_id}/content

Returns a response containing the contents of the specified file.

Retrieve file content

import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const response = await openai.files.content("file-abc123");
  const content = await response.text();

  console.log(content);
}

main();
Parameters
fileID: string
Returns
unnamed_schema_0 = Response
Returns Examples