上传素材
curl --request POST \
--url https://octopusx.ai/v1/seedance/asset/CreateAsset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"GroupId": "<string>",
"URL": "<string>",
"AssetType": "<string>",
"Name": "<string>"
}
'import requests
url = "https://octopusx.ai/v1/seedance/asset/CreateAsset"
payload = {
"GroupId": "<string>",
"URL": "<string>",
"AssetType": "<string>",
"Name": "<string>"
}
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({GroupId: '<string>', URL: '<string>', AssetType: '<string>', Name: '<string>'})
};
fetch('https://octopusx.ai/v1/seedance/asset/CreateAsset', 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://octopusx.ai/v1/seedance/asset/CreateAsset",
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([
'GroupId' => '<string>',
'URL' => '<string>',
'AssetType' => '<string>',
'Name' => '<string>'
]),
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://octopusx.ai/v1/seedance/asset/CreateAsset"
payload := strings.NewReader("{\n \"GroupId\": \"<string>\",\n \"URL\": \"<string>\",\n \"AssetType\": \"<string>\",\n \"Name\": \"<string>\"\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://octopusx.ai/v1/seedance/asset/CreateAsset")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"GroupId\": \"<string>\",\n \"URL\": \"<string>\",\n \"AssetType\": \"<string>\",\n \"Name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/seedance/asset/CreateAsset")
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 \"GroupId\": \"<string>\",\n \"URL\": \"<string>\",\n \"AssetType\": \"<string>\",\n \"Name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"state": 1,
"data": {
"Id": "asset-xxx",
"task_id": "task_xxx"
},
"error": null
}
{
"error": {
"code": "InvalidParameter",
"message": "the parameter duration specified in the request is not valid",
"type": "new_api_error"
}
}
{
"error": {
"code": "Unauthorized",
"message": "Invalid API key provided",
"type": "new_api_error"
}
}
{
"error": {
"code": "Forbidden",
"message": "access denied",
"type": "new_api_error"
}
}
{
"error": {
"code": "RateLimitExceeded",
"message": "当前请求频率过高,请稍后再试",
"type": "new_api_error"
}
}
{
"error": {
"code": "InternalError",
"message": "internal server error",
"type": "new_api_error"
}
}
Asset Management
上传素材
使用 POST /v1/seedance/asset/CreateAsset 将公网素材导入 Seedance 素材库。
POST
https://octopusx.ai
/
v1
/
seedance
/
asset
/
CreateAsset
上传素材
curl --request POST \
--url https://octopusx.ai/v1/seedance/asset/CreateAsset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"GroupId": "<string>",
"URL": "<string>",
"AssetType": "<string>",
"Name": "<string>"
}
'import requests
url = "https://octopusx.ai/v1/seedance/asset/CreateAsset"
payload = {
"GroupId": "<string>",
"URL": "<string>",
"AssetType": "<string>",
"Name": "<string>"
}
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({GroupId: '<string>', URL: '<string>', AssetType: '<string>', Name: '<string>'})
};
fetch('https://octopusx.ai/v1/seedance/asset/CreateAsset', 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://octopusx.ai/v1/seedance/asset/CreateAsset",
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([
'GroupId' => '<string>',
'URL' => '<string>',
'AssetType' => '<string>',
'Name' => '<string>'
]),
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://octopusx.ai/v1/seedance/asset/CreateAsset"
payload := strings.NewReader("{\n \"GroupId\": \"<string>\",\n \"URL\": \"<string>\",\n \"AssetType\": \"<string>\",\n \"Name\": \"<string>\"\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://octopusx.ai/v1/seedance/asset/CreateAsset")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"GroupId\": \"<string>\",\n \"URL\": \"<string>\",\n \"AssetType\": \"<string>\",\n \"Name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octopusx.ai/v1/seedance/asset/CreateAsset")
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 \"GroupId\": \"<string>\",\n \"URL\": \"<string>\",\n \"AssetType\": \"<string>\",\n \"Name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"state": 1,
"data": {
"Id": "asset-xxx",
"task_id": "task_xxx"
},
"error": null
}
{
"error": {
"code": "InvalidParameter",
"message": "the parameter duration specified in the request is not valid",
"type": "new_api_error"
}
}
{
"error": {
"code": "Unauthorized",
"message": "Invalid API key provided",
"type": "new_api_error"
}
}
{
"error": {
"code": "Forbidden",
"message": "access denied",
"type": "new_api_error"
}
}
{
"error": {
"code": "RateLimitExceeded",
"message": "当前请求频率过高,请稍后再试",
"type": "new_api_error"
}
}
{
"error": {
"code": "InternalError",
"message": "internal server error",
"type": "new_api_error"
}
}
上传素材
在指定素材组中导入素材。URL 用于把公网 HTTPS 资源拉取进素材库(审核/转码由服务端完成)。导入成功后返回 AssetId,在 创建视频 中推荐用 asset://{assetId} 引用,而不是重复填写公网 URL。
方法与路径
POST /v1/seedance/asset/CreateAsset
请求示例
curl -X POST https://octopusx.ai/v1/seedance/asset/CreateAsset \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"GroupId": "group-20260415111540-w9pkb",
"URL": "https://example.com/reference.webp",
"AssetType": "Image",
"Name": "child"
}'
import requests
resp = requests.post(
"https://octopusx.ai/v1/seedance/asset/CreateAsset",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"GroupId": "group-20260415111540-w9pkb",
"URL": "https://example.com/reference.webp",
"AssetType": "Image",
"Name": "child",
},
timeout=60,
)
print(resp.json())
响应示例
{
"state": 1,
"data": {
"Id": "asset-xxx",
"task_id": "task_xxx"
},
"error": null
}
{
"error": {
"code": "InvalidParameter",
"message": "the parameter duration specified in the request is not valid",
"type": "new_api_error"
}
}
{
"error": {
"code": "Unauthorized",
"message": "Invalid API key provided",
"type": "new_api_error"
}
}
{
"error": {
"code": "Forbidden",
"message": "access denied",
"type": "new_api_error"
}
}
{
"error": {
"code": "RateLimitExceeded",
"message": "当前请求频率过高,请稍后再试",
"type": "new_api_error"
}
}
{
"error": {
"code": "InternalError",
"message": "internal server error",
"type": "new_api_error"
}
}
task_id 调用 查询素材,待 Status 为 Active 后再用于视频生成。
认证
Authorization: Bearer YOUR_API_KEY
Body
待导入素材的公网 HTTPS 地址。
素材类型:
Image、Video、Audio。素材名称。
Response
业务状态码。
素材 ID,视频生成时可写为
asset://{Id}。错误信息。
相关页面
⌘I