python/resources/files/methods/content/index.md +0 −41 deleted
File Deleted View Diff
1## Retrieve file content
2
3`files.content(strfile_id) -> BinaryResponseContent`
4
5**get** `/files/{file_id}/content`
6
7Returns the contents of the specified file.
8
9### Parameters
10
11- `file_id: str`
12
13### Returns
14
15- `BinaryResponseContent`
16
17### Example
18
19```python
20import os
21from openai import OpenAI
22
23client = OpenAI(
24 api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
25)
26response = client.files.content(
27 "file_id",
28)
29print(response)
30content = response.read()
31print(content)
32```
33
34### Example
35
36```python
37from openai import OpenAI
38client = OpenAI()
39
40content = client.files.content("file-abc123")
41```