列出文件
按用途筛选,使用 after 或 before 游标翻页。
/file/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.
scope_idstring可选query: Filter files by session scope. A nonexistent scope returns 404.
beforestring可选query: Return the preceding page; mutually exclusive with after.
返回
200 list
错误按 OpenAI 格式返回,参见 错误码
响应
HTTP 200
OK
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| object | string | Object type; always `list`. |
| data | array<object> | Files of the page, in the requested order. |
| 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 | Upload purpose. Image references in conversations require user_data. |
| data[].status | string | Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. |
| data[].status_details | string | null | Deprecated; always null or absent. |
| data[].mime_type | string | Content-detected MIME type. |
| data[].downloadable | boolean | Tenant-owned live files can be downloaded through this face. |
| data[].scope | object | Present for session output files. |
| data[].relative_path | string | Path within the session output directory; present for session outputs. |
| data[].revision | integer | Session output revision; present for session outputs. |
| first_id | string | Id of the first file of the page; usable as `before` to read the preceding page. |
| last_id | string | Id of the last file of the page; usable as `after` to read the next page. |
| has_more | boolean | Whether more files exist beyond this page. |