获取 Seedance 素材资产
curl --request GET \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": null,
"created_at": 1782998400000
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "An internal error occurred",
"type": "server_error"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}视频与素材
获取素材
通过素材 ID 获取一个 Seedance 素材。
GET
/
v1
/
videos
/
assets
/
{assetId}
获取 Seedance 素材资产
curl --request GET \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
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",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": null,
"created_at": 1782998400000
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "An internal error occurred",
"type": "server_error"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}获取素材及其处理状态。
ready 为 true 且 status 为 ACTIVE 时即可用于视频生成。
如果返回 Seedance material asset not found or not accessible,请确认传入的是素材 id,不是 group_id。
project_name 用于同一组织内的资源隔离,默认为 default。相关素材组和素材须使用相同且区分大小写的值;POST/PUT 在 JSON 请求体中传入,GET/DELETE 在查询参数中传入。
请求示例
curl "https://api.tokenlab.sh/v1/videos/assets/asset-20260720123456-qn7wr?project_name=default" \
-H "Authorization: Bearer $TOKENLAB_API_KEY"
响应示例
{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"project_name": "default",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": null,
"created_at": 1782998400000
}
授权
API Key 身份验证。在 Dashboard > API > API Keys 中创建或管理 API Key。
路径参数
查询参数
素材资源的项目范围。
Required string length:
1 - 128响应
素材资产
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 时间戳。