Repository Public
1> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.23## Retrieve file45**get** `/files/{file_id}`67Returns information about a specific file.89### Path Parameters1011- `file_id: string`1213### Returns1415- `FileObject object { id, bytes, created_at, 6 more }`1617 The `File` object represents a document that has been uploaded to OpenAI.1819 - `id: string`2021 The file identifier, which can be referenced in the API endpoints.2223 - `bytes: number`2425 The size of the file, in bytes.2627 - `created_at: number`2829 The Unix timestamp (in seconds) for when the file was created.3031 - `filename: string`3233 The name of the file.3435 - `object: "file"`3637 The object type, which is always `file`.3839 - `"file"`4041 - `purpose: "assistants" or "assistants_output" or "batch" or 5 more`4243 The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.4445 - `"assistants"`4647 - `"assistants_output"`4849 - `"batch"`5051 - `"batch_output"`5253 - `"fine-tune"`5455 - `"fine-tune-results"`5657 - `"vision"`5859 - `"user_data"`6061 - `status: "uploaded" or "processed" or "error"`6263 Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.6465 - `"uploaded"`6667 - `"processed"`6869 - `"error"`7071 - `expires_at: optional number`7273 The Unix timestamp (in seconds) for when the file will expire.7475 - `status_details: optional string`7677 Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.7879### Example8081```http82curl https://api.openai.com/v1/files/$FILE_ID \83 -H "Authorization: Bearer $OPENAI_API_KEY"84```8586#### Response8788```json89{90 "id": "id",91 "bytes": 0,92 "created_at": 0,93 "filename": "filename",94 "object": "file",95 "purpose": "assistants",96 "status": "uploaded",97 "expires_at": 0,98 "status_details": "status_details"99}100```101102### Example103104```http105curl https://api.openai.com/v1/files/file-abc123 \106 -H "Authorization: Bearer $OPENAI_API_KEY"107```108109#### Response110111```json112{113 "id": "file-abc123",114 "object": "file",115 "bytes": 120000,116 "created_at": 1677610602,117 "expires_at": 1677614202,118 "filename": "mydata.jsonl",119 "purpose": "fine-tune",120}121```122