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(stringfileID, RequestOptionsoptions?): Response
GET/files/{file_id}/content

Returns a response containing the contents of the specified file.

ParametersExpand Collapse
fileID: string
ReturnsExpand Collapse
unnamed_schema_0 = Response

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();
Returns Examples