更新 Seedance 素材资产
curl --request PUT \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Content-Type: application/json' \
--data '
{
"asset_name": "Front view approved",
"metadata": {
"approved_by": "creative-team"
}
}
'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
payload = {
"asset_name": "Front view approved",
"metadata": { "approved_by": "creative-team" }
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({asset_name: 'Front view approved', metadata: {approved_by: 'creative-team'}})
};
fetch('https://api.tokenlab.sh/v1/videos/assets/{assetId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenlab.sh/v1/videos/assets/{assetId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset_name' => 'Front view approved',
'metadata' => [
'approved_by' => 'creative-team'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
payload := strings.NewReader("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Content-Type", "application/json")
.body("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view approved",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": {
"approved_by": "creative-team"
},
"created_at": 1782998400000
}{
"error": {
"message": "model: Model is required",
"type": "invalid_request_error",
"param": "model"
},
"validation_errors": [
{
"field": "model",
"message": "Model is required"
}
]
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "Image width must be between 300px and 6000px.",
"type": "invalid_request_error",
"code": "seedance_material_source_invalid",
"param": "asset_url"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}视频与素材
更新素材
更新当前工作区的 Seedance 素材。
PUT
/
v1
/
videos
/
assets
/
{assetId}
更新 Seedance 素材资产
curl --request PUT \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Content-Type: application/json' \
--data '
{
"asset_name": "Front view approved",
"metadata": {
"approved_by": "creative-team"
}
}
'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
payload = {
"asset_name": "Front view approved",
"metadata": { "approved_by": "creative-team" }
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({asset_name: 'Front view approved', metadata: {approved_by: 'creative-team'}})
};
fetch('https://api.tokenlab.sh/v1/videos/assets/{assetId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenlab.sh/v1/videos/assets/{assetId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset_name' => 'Front view approved',
'metadata' => [
'approved_by' => 'creative-team'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
payload := strings.NewReader("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Content-Type", "application/json")
.body("{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_name\": \"Front view approved\",\n \"metadata\": {\n \"approved_by\": \"creative-team\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view approved",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": {
"approved_by": "creative-team"
},
"created_at": 1782998400000
}{
"error": {
"message": "model: Model is required",
"type": "invalid_request_error",
"param": "model"
},
"validation_errors": [
{
"field": "model",
"message": "Model is required"
}
]
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "Image width must be between 300px and 6000px.",
"type": "invalid_request_error",
"code": "seedance_material_source_invalid",
"param": "asset_url"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}可修改素材名称或元数据。需要更换文件或素材类型时,请创建新素材。
project_name 用于同一组织内的资源隔离,默认为 default。相关素材组和素材须使用相同且区分大小写的值;POST/PUT 在 JSON 请求体中传入,GET/DELETE 在查询参数中传入。
请求示例
curl https://api.tokenlab.sh/v1/videos/assets/asset-20260720123456-qn7wr \
-X PUT \
-H "Authorization: Bearer $TOKENLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"asset_name":"Front view approved","metadata":{"approved_by":"creative-team"},"project_name":"default"}'
响应示例
{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"project_name": "default",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view approved",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": {"approved_by": "creative-team"},
"created_at": 1782998400000
}
路径参数
TokenLab 素材资产 ID。
请求体
application/json
响应
素材资产已更新
TokenLab 素材资源 ID。在资产变为 ACTIVE 后,请将其用作 material_asset_id。
可用选项:
seedance.material_asset 可用选项:
aigc_avatar, liveness_face 可用选项:
Image, Video, Audio 可用选项:
PROCESSING, ACTIVE, FAILED, DELETED 当资产处于活跃状态且未被删除时为 true。
拥有此素材资源的 TokenLab 素材组 ID。
此素材资源的项目范围。
可公开显示的终端处理错误。永久性源验证失败包括被拒绝的尺寸约束。
素材资源记录创建时的 Unix 时间戳。
素材资源记录最后更新时的 Unix 时间戳。