List files
List the files you have uploaded.
/openai/v1/files● SupportedRequest parameters
purposestring可选query: Only return files with the given purpose.
Verified to take effect.
limitinteger可选query: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.
Verified to take effect.
orderstring可选query: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
Verified to take effect.
afterstring可选query: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
Verified to take effect.
Returns
200 list
Only the after, order, limit and purpose query parameters are accepted; any other returns 400 invalid_request_error "Unrecognized request argument supplied: <name>" with param naming it.
Errors follow the OpenAI format — see error codes
Response
HTTP 200
OK
application/json
| Name | Type | Description |
|---|---|---|
| object | string | |
| data | array<object> | |
| data[].id | string | The file identifier, which can be referenced in the API endpoints. |
| data[].bytes | integer | The size of the file, in bytes. |
| data[].created_at | integer | The Unix timestamp (in seconds) for when the file was created. |
| data[].expires_at | integer | The Unix timestamp (in seconds) for when the file will expire. |
| data[].filename | string | The name of the file. |
| data[].object | string | The object type, which is always `file`. |
| data[].purpose | string | The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`. |
| data[].status | string | Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. |
| data[].status_details | string | Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. |
| first_id | string | |
| last_id | string | |
| has_more | boolean |