OpenAI

列出文件

列出已上传的文件。

GET /openai/v1/files● 支持

OpenAI 官方文档 ↗

请求参数

  • 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: 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

名称类型说明
objectstring
dataarray<object>
data[].idstringThe file identifier, which can be referenced in the API endpoints.
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[].purposestringThe intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`.
data[].statusstringDeprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`.
data[].status_detailsstringDeprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.
first_idstring
last_idstring
has_moreboolean