Skip to content

资源分组接口 ​

资源管理接口用于管理模型可引用的素材资源,方便用户复用素材。目前仅用于火山 Seedance 系列模型。

注意:某些API key资源分组不支持资源管理,参见Seedance。

注意:由于素材和创建视频所在的分组API Key需要一致,所以要使用资源管理功能时,创建API Key时请指定具体分组。

鉴权: Authorization: Bearer <api-key>

枚举: status:1 可用 / 2 处理中 / 3 失败 / 4 已删除

创建资源分组 ​

http
POST /api/model-resources/groups

请求参数:

字段类型必填说明
namestring是分组名称
descriptionstring否分组描述

请求示例:

bash
curl --location 'https://neolink.com/api/api/model-resources/groups' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "用户组1",
    "description": "这是备注"
  }'

返回示例:

json
{
  "success": true,
  "message": "",
  "data": {
    "id": 8,
    "name": "用户组1",
    "description": "这是备注",
    "busi_type": 1,
    "created_at": 1779330365,
    "updated_at": 1779330365,
    "deleted_at": null
  }
}

查询资源分组列表 ​

http
GET /api/model-resources/groups

Query 参数:

字段类型必填说明
pint否页码,默认 1
page_sizeint否每页数量
keywordstring否按名称或描述搜索

请求示例:

bash
curl --location 'https://neolink.com/api/api/model-resources/groups?p=1&page_size=20' \
  --header 'Authorization: Bearer <api-key>'

返回示例:

json
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "items": [
      {
        "id": 8,
        "name": "用户组1",
        "description": "这是备注",
        "busi_type": 1,
        "created_at": 1779330365,
        "updated_at": 1779330365,
        "deleted_at": null
      }
    ]
  }
}

查询资源分组详情 ​

http
GET /api/model-resources/groups/{id}

请求示例:

bash
curl --location 'https://neolink.com/api/api/model-resources/groups/8' \
  --header 'Authorization: Bearer <api-key>'

返回字段同创建资源分组。

更新资源分组 ​

http
PATCH /api/model-resources/groups/{id}
PUT /api/model-resources/groups/{id}

请求参数:

字段类型必填说明
namestring否新分组名称
descriptionstring否新分组描述

请求示例:

bash
curl --location --request PATCH 'https://neolink.com/api/api/model-resources/groups/8' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "用户组1-更新",
    "description": "新的备注"
  }'