列出文件
按用途筛选,使用 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: File ID cursor for the next page; mutually exclusive with before. Use an ID from the current listing.
scope_idstring可选query: Session whose output files to list. Accepts sesn_ or ags_ followed by 1 to 251 letters, digits, underscores or hyphens. An existing session with no outputs returns an empty list; a nonexistent or inaccessible session returns 404.
beforestring可选query: File ID cursor for the preceding page; mutually exclusive with after. Use an ID from the current listing.
返回
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 | File identifier: file_dp_ followed by a 26-character uppercase Crockford ULID. Use the ID returned by upload or list. |
| 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. |