文件

列出文件

按用途筛选,使用 after 或 before 游标翻页。

GET /file/v1/files● 支持

请求参数

  • purposestring可选

    query: Only return files with the given purpose.

  • limitinteger可选
    默认 10000

    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可选
    默认 "desc"

    query: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.

    取值 ascdesc
  • 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

名称类型说明
objectstringObject type; always `list`.
dataarray<object>Files of the page, in the requested order.
data[].idstringFile identifier: file_dp_ followed by a 26-character uppercase Crockford ULID. Use the ID returned by upload or list.
data[].bytesintegerThe size of the file, in bytes.
data[].created_atintegerThe Unix timestamp (in seconds) for when the file was created.
data[].expires_atintegerThe Unix timestamp (in seconds) for when the file will expire.
data[].filenamestringThe name of the file.
data[].objectstringThe object type, which is always `file`.
data[].purposestringUpload purpose. Image references in conversations require user_data.
data[].statusstringDeprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
data[].status_detailsstring | nullDeprecated; always null or absent.
data[].mime_typestringContent-detected MIME type.
data[].downloadablebooleanTenant-owned live files can be downloaded through this face.
data[].scopeobjectPresent for session output files.
data[].relative_pathstringPath within the session output directory; present for session outputs.
data[].revisionintegerSession output revision; present for session outputs.
first_idstringId of the first file of the page; usable as `before` to read the preceding page.
last_idstringId of the last file of the page; usable as `after` to read the next page.
has_morebooleanWhether more files exist beyond this page.