字段名 | 类型 | 必需 | 示例值 | 备注 |
---|---|---|---|---|
fileUniqueId | string | 是 | ENthMCy_5zr5zN3GRJseM | 文件UID 必填 |
filename | string | 是 | example-new.png | 新文件名 必填 |
purpose | integer | 否 | 0 | 文件目的 |
is_public | boolean | 否 | true | 是否公开 |
tags | array | 否 | ["tag1", "tag2"] | 新的文件Tag |
expires_at | string | 否 | 2024-12-31T23:59:59 | 到期时间 |
unset_expires_at | boolean | 否 | false | 是否取消设置到期时间 |
file-v1
的权限purpose
定义:{
COMMON = 0,
FINETUNE = 1,
CHAT = 2,
LLM_TMP = 3,
OPENAI_BATCH = 4,
ANTHROPIC_BATCH = 5,
}
curl --location --request POST 'https://cn2us02.opapi.win/api/v1/user/files/update' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"fileUniqueId": "ENthMCy_5zr5zN3GRJseM",
"filename": "new-pic.jpg",
"purpose": "0",
"is_public": true,
"tags": [
"t1",
"t2"
],
"expires_at": "2024-11-29T22:14:53+08:00",
"unset_expires_at": false
}'
{
"statusCode": 200,
"message": "File info updated successfully",
"data": {
"affectedRows": 1
}
}