cli/resources/files/methods/retrieve/index.md +0 −101 deleted
File Deleted View Diff
1## Retrieve file
2
3`$ openai files retrieve`
4
5**get** `/files/{file_id}`
6
7Returns information about a specific file.
8
9### Parameters
10
11- `--file-id: string`
12
13 The ID of the file to use for this request.
14
15### Returns
16
17- `file_object: object { id, bytes, created_at, 6 more }`
18
19 The `File` object represents a document that has been uploaded to OpenAI.
20
21 - `id: string`
22
23 The file identifier, which can be referenced in the API endpoints.
24
25 - `bytes: number`
26
27 The size of the file, in bytes.
28
29 - `created_at: number`
30
31 The Unix timestamp (in seconds) for when the file was created.
32
33 - `filename: string`
34
35 The name of the file.
36
37 - `object: "file"`
38
39 The object type, which is always `file`.
40
41 - `purpose: "assistants" or "assistants_output" or "batch" or 5 more`
42
43 The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
44
45 - `"assistants"`
46
47 - `"assistants_output"`
48
49 - `"batch"`
50
51 - `"batch_output"`
52
53 - `"fine-tune"`
54
55 - `"fine-tune-results"`
56
57 - `"vision"`
58
59 - `"user_data"`
60
61 - `status: "uploaded" or "processed" or "error"`
62
63 Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
64
65 - `"uploaded"`
66
67 - `"processed"`
68
69 - `"error"`
70
71 - `expires_at: optional number`
72
73 The Unix timestamp (in seconds) for when the file will expire.
74
75 - `status_details: optional string`
76
77 Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
78
79### Example
80
81```cli
82openai files retrieve \
83 --api-key 'My API Key' \
84 --file-id file_id
85```
86
87#### Response
88
89```json
90{
91 "id": "id",
92 "bytes": 0,
93 "created_at": 0,
94 "filename": "filename",
95 "object": "file",
96 "purpose": "assistants",
97 "status": "uploaded",
98 "expires_at": 0,
99 "status_details": "status_details"
100}
101```