列出文件
列出已上传的文件。
/openai/v1/files● 支持请求参数
purposestring可选query: Only return files with the given purpose.
已验证生效。
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.
已验证生效。
orderstring可选query: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
已验证生效。
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.
已验证生效。
返回
200 list
只接受查询参数 after、order、limit、purpose;其他查询参数返回 400 invalid_request_error,消息为 "Unrecognized request argument supplied: <参数>",param 为该参数。
错误按 OpenAI 格式返回,参见 错误码
响应
HTTP 200
OK
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| 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 |