Criar grupo de ativos de material Seedance
curl --request POST \
--url https://api.tokenlab.sh/v1/videos/assets/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Fotos de produto reutilizáveis"
}
'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/groups"
payload = {
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Fotos de produto reutilizáveis"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
library_type: 'aigc_avatar',
group_name: 'Product references',
description: 'Fotos de produto reutilizáveis'
})
};
fetch('https://api.tokenlab.sh/v1/videos/assets/groups', 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/groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'library_type' => 'aigc_avatar',
'group_name' => 'Product references',
'description' => 'Fotos de produto reutilizáveis'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/groups"
payload := strings.NewReader("{\n \"library_type\": \"aigc_avatar\",\n \"group_name\": \"Product references\",\n \"description\": \"Fotos de produto reutilizáveis\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.tokenlab.sh/v1/videos/assets/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"library_type\": \"aigc_avatar\",\n \"group_name\": \"Product references\",\n \"description\": \"Fotos de produto reutilizáveis\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"library_type\": \"aigc_avatar\",\n \"group_name\": \"Product references\",\n \"description\": \"Fotos de produto reutilizáveis\"\n}"
response = http.request(request)
puts response.read_body{
"id": "group-20260720123456-vrt01",
"object": "seedance.material_asset_group",
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Fotos de produto reutilizáveis",
"status": "ACTIVE",
"metadata": null,
"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": "<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": "An internal error occurred",
"type": "server_error"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}Vídeo e materiais
Criar Grupo de Ativos de Material
Cria um grupo de material de avatar virtual da Seedance.
POST
/
v1
/
videos
/
assets
/
groups
Criar grupo de ativos de material Seedance
curl --request POST \
--url https://api.tokenlab.sh/v1/videos/assets/groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Fotos de produto reutilizáveis"
}
'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/groups"
payload = {
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Fotos de produto reutilizáveis"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
library_type: 'aigc_avatar',
group_name: 'Product references',
description: 'Fotos de produto reutilizáveis'
})
};
fetch('https://api.tokenlab.sh/v1/videos/assets/groups', 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/groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'library_type' => 'aigc_avatar',
'group_name' => 'Product references',
'description' => 'Fotos de produto reutilizáveis'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/groups"
payload := strings.NewReader("{\n \"library_type\": \"aigc_avatar\",\n \"group_name\": \"Product references\",\n \"description\": \"Fotos de produto reutilizáveis\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.tokenlab.sh/v1/videos/assets/groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"library_type\": \"aigc_avatar\",\n \"group_name\": \"Product references\",\n \"description\": \"Fotos de produto reutilizáveis\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"library_type\": \"aigc_avatar\",\n \"group_name\": \"Product references\",\n \"description\": \"Fotos de produto reutilizáveis\"\n}"
response = http.request(request)
puts response.read_body{
"id": "group-20260720123456-vrt01",
"object": "seedance.material_asset_group",
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Fotos de produto reutilizáveis",
"status": "ACTIVE",
"metadata": null,
"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": "<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": "An internal error occurred",
"type": "server_error"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}Crie um grupo de material com
library_type: "aigc_avatar". Use este endpoint para avatares virtuais, produtos, estilos e outras referências reutilizáveis que não exigem verificação de pessoa real.
Novos grupos de material de pessoa real são criados através da Criar sessão de validação visual e não podem ser criados diretamente com este endpoint.
project_name isola recursos dentro da organização autenticada. O padrão é default; use o mesmo valor, diferenciando maiúsculas e minúsculas, para grupos e ativos relacionados. Envie-o no corpo JSON para POST/PUT e na consulta para GET/DELETE.
Exemplo de Requisição
curl https://api.tokenlab.sh/v1/videos/assets/groups \
-H "Authorization: Bearer $TOKENLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"library_type":"aigc_avatar","group_name":"Product references","description":"Reusable product shots","project_name":"default"}'
Exemplo de Resposta
{
"id": "group-20260720123456-vrt01",
"object": "seedance.material_asset_group",
"project_name": "default",
"library_type": "aigc_avatar",
"group_name": "Product references",
"description": "Reusable product shots",
"status": "ACTIVE",
"metadata": null,
"created_at": 1782998400000
}
Autorizações
Autenticação por Chave de API. Crie ou gerencie chaves de API em Dashboard > API > API Keys.
Corpo
application/json
Nome de exibição opcional para o grupo de material.
Required string length:
1 - 128Maximum string length:
500Classe da biblioteca de materiais. A criação direta suporta aigc_avatar. Crie grupos liveness_face através de CreateVisualValidateSession seguido por GetVisualValidateResult.
Opções disponíveis:
aigc_avatar, liveness_face Escopo do projeto para o grupo de material.
Required string length:
1 - 128Resposta
Grupo de ativos de material criado
ID do grupo de material do TokenLab. Use-o como group_id ao fazer upload de materiais.
Opções disponíveis:
seedance.material_asset_group Opções disponíveis:
aigc_avatar, liveness_face Escopo do projeto para este grupo de material.