Seedance
建立形象素材群組
建立供 Seedance 參考輸入使用的 CometAPI 形象素材群組。虛擬群組會立即啟用,真人群組則需要完成驗證。
POST
/
api
/
asset
/
groups
cURL
curl https://api.cometapi.com/api/asset/groups \
-H "Authorization: $COMETAPI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"my-character","type":"virtual"}'import os
import requests
response = requests.post(
"https://api.cometapi.com/api/asset/groups",
headers={"Authorization": os.environ["COMETAPI_ACCESS_TOKEN"]},
json={"name": "my-character", "type": "virtual"},
timeout=30,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.cometapi.com/api/asset/groups", {
method: "POST",
headers: {
Authorization: process.env.COMETAPI_ACCESS_TOKEN,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "my-character", type: "virtual" }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/api/asset/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([
'name' => 'my-character',
'type' => 'virtual'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.cometapi.com/api/asset/groups"
payload := strings.NewReader("{\n \"name\": \"my-character\",\n \"type\": \"virtual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.cometapi.com/api/asset/groups")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-character\",\n \"type\": \"virtual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/api/asset/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-character\",\n \"type\": \"virtual\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "",
"data": {
"id": "ag-example",
"name": "my-character",
"group_type": "virtual",
"status": "active",
"created_at": 1777385418
}
}請在上傳角色圖片前建立群組。在
回應會將 CometAPI 群組 ID 儲存在
對於真人群組,請依序前往取得形象素材群組和啟用真人驗證。對於虛擬群組,請前往上傳形象素材。
Authorization 標頭中傳送原始存取權杖,不要加上 Bearer 前綴。
curl \
https://api.cometapi.com/api/asset/groups \
-H "Authorization: $COMETAPI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-character",
"type": "virtual"
}'
要求欄位
| 欄位 | 類型 | 說明 |
|---|---|---|
name | string | 長度為 1 到 64 個字元的群組名稱。 |
type | string | 虛擬角色使用 virtual,真人使用 real。 |
data.id。virtual 群組會回傳 data.status=active。real 群組會回傳 data.status=pending,並包含已簽名的 data.liveness.platform_wrapper_url。
回應欄位
| 欄位 | 說明 |
|---|---|
data.id | 上傳和群組端點使用的群組 ID。 |
data.group_type | 您傳送的群組類型。 |
data.status | active、pending 或 expired。 |
data.liveness | 等待中的真人群組會包含此欄位。 |
主體
application/json
最後修改於 2026年12月1日
⌘I
cURL
curl https://api.cometapi.com/api/asset/groups \
-H "Authorization: $COMETAPI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"my-character","type":"virtual"}'import os
import requests
response = requests.post(
"https://api.cometapi.com/api/asset/groups",
headers={"Authorization": os.environ["COMETAPI_ACCESS_TOKEN"]},
json={"name": "my-character", "type": "virtual"},
timeout=30,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.cometapi.com/api/asset/groups", {
method: "POST",
headers: {
Authorization: process.env.COMETAPI_ACCESS_TOKEN,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "my-character", type: "virtual" }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/api/asset/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([
'name' => 'my-character',
'type' => 'virtual'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.cometapi.com/api/asset/groups"
payload := strings.NewReader("{\n \"name\": \"my-character\",\n \"type\": \"virtual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.cometapi.com/api/asset/groups")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-character\",\n \"type\": \"virtual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/api/asset/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-character\",\n \"type\": \"virtual\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "",
"data": {
"id": "ag-example",
"name": "my-character",
"group_type": "virtual",
"status": "active",
"created_at": 1777385418
}
}