Lấy tài nguyên vật liệu 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"
}
}Video & tư liệu
Lấy tài nguyên vật liệu (Get Material Asset)
Truy xuất một tài nguyên vật liệu Seedance theo ID tài nguyên vật liệu TokenLab.
GET
/
v1
/
videos
/
assets
/
{assetId}
Lấy tài nguyên vật liệu 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"
}
}Truy xuất một tài nguyên vật liệu và kiểm tra trạng thái xử lý của nó. Tài nguyên chỉ có thể được sử dụng để tạo video khi
ready là true và status là ACTIVE.
Nếu quá trình tạo video trả về lỗi Seedance material asset not found or not accessible, hãy xác minh rằng bạn đã truyền đúng id của tài nguyên vật liệu này, thay vì group_id của vật liệu.
project_name tách biệt tài nguyên trong tổ chức đã xác thực. Mặc định là default; dùng cùng một giá trị phân biệt chữ hoa, chữ thường cho nhóm và tài nguyên liên quan. Gửi trong nội dung JSON với POST/PUT và tham số truy vấn với GET/DELETE.
Ví dụ yêu cầu
curl "https://api.tokenlab.sh/v1/videos/assets/asset-20260720123456-qn7wr?project_name=default" \
-H "Authorization: Bearer $TOKENLAB_API_KEY"
Ví dụ phản hồi
{
"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
}
Ủy quyền
Xác thực bằng Khóa API. Tạo hoặc quản lý khóa API trong Dashboard > API > API Keys.
Tham số đường dẫn
Tham số truy vấn
Phạm vi dự án cho tài nguyên vật liệu.
Required string length:
1 - 128Phản hồi
Tài nguyên vật liệu
ID tài sản tài liệu TokenLab. Sử dụng ID này làm material_asset_id sau khi tài sản trở thành ACTIVE.
Tùy chọn có sẵn:
seedance.material_asset Tùy chọn có sẵn:
aigc_avatar, liveness_face Tùy chọn có sẵn:
Image, Video, Audio Tùy chọn có sẵn:
PROCESSING, ACTIVE, FAILED, DELETED True khi tài sản đang hoạt động và không bị xóa.
ID nhóm tài liệu TokenLab sở hữu tài sản tài liệu này.
Phạm vi dự án cho tài sản tài liệu này.
Lỗi xử lý kết thúc an toàn công khai. Các lỗi xác thực nguồn vĩnh viễn bao gồm ràng buộc kích thước bị từ chối.
Dấu thời gian Unix khi bản ghi tài sản tài liệu được tạo.
Dấu thời gian Unix khi bản ghi tài sản tài liệu được cập nhật lần cuối.