python/resources/files/methods/retrieve_content/index.md +0 −45 deleted
File Deleted View Diff
1## Retrieve file content
2
3`files.retrieve_content(strfile_id) -> FileContent`
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- `str`
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)
26file_content = client.files.retrieve_content(
27 "file_id",
28)
29print(file_content)
30```
31
32#### Response
33
34```json
35"string"
36```
37
38### Example
39
40```python
41from openai import OpenAI
42client = OpenAI()
43
44content = client.files.content("file-abc123")
45```