取得 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"
}
}視頻與素材
取得素材資源 (Get Material Asset)
透過 TokenLab 素材資源 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 金鑰。
路徑參數
查詢參數
素材資源的專案範圍。
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 時間戳記。