创建素材
curl --request POST \
--url https://api.gravitex.ai/v1/assets \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"group_id": "<string>",
"asset_type": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.gravitex.ai/v1/assets"
payload = {
"url": "<string>",
"group_id": "<string>",
"asset_type": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
group_id: '<string>',
asset_type: '<string>',
name: '<string>'
})
};
fetch('https://api.gravitex.ai/v1/assets', 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.gravitex.ai/v1/assets",
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([
'url' => '<string>',
'group_id' => '<string>',
'asset_type' => '<string>',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.gravitex.ai/v1/assets"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"group_id\": \"<string>\",\n \"asset_type\": \"<string>\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.gravitex.ai/v1/assets")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"group_id\": \"<string>\",\n \"asset_type\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"group_id\": \"<string>\",\n \"asset_type\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySeedance 2.0(/generations)
创建素材
POST /v1/assets
POST
/
v1
/
assets
创建素材
curl --request POST \
--url https://api.gravitex.ai/v1/assets \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"group_id": "<string>",
"asset_type": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.gravitex.ai/v1/assets"
payload = {
"url": "<string>",
"group_id": "<string>",
"asset_type": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
group_id: '<string>',
asset_type: '<string>',
name: '<string>'
})
};
fetch('https://api.gravitex.ai/v1/assets', 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.gravitex.ai/v1/assets",
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([
'url' => '<string>',
'group_id' => '<string>',
'asset_type' => '<string>',
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.gravitex.ai/v1/assets"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"group_id\": \"<string>\",\n \"asset_type\": \"<string>\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.gravitex.ai/v1/assets")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"group_id\": \"<string>\",\n \"asset_type\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gravitex.ai/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"group_id\": \"<string>\",\n \"asset_type\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body简介
在素材组内创建素材。Content-Type: application/json,仅支持公网 https URL(BytePlus 须能直接拉取),不支持 Base64 / Data URI / multipart 直传。本地文件请先上传至 OSS / TOS / S3 等对象存储。
虚拟(aigc)与真人(liveness_face)素材库均支持 Image / Video / Audio。创建后 status 为 pending,轮询至 active(通常 1~3 分钟)后再用于 asset://。
火山方舟
CreateAsset 自 2026 年起已下线 Base64 直传。详见 Create an Asset。认证
string
必填
Bearer Token,如
Bearer sk-xxxxxxxxxx请求参数
string
必填
公网 https 资源地址;网关原样透传给上游
string
默认值:"Image"
Image / Video / Audio,大小写不敏感string
素材名称(≤ 64 字符,仅用于展示与列表搜索,不参与模型推理)
格式与大小约束
图片 (Image)
| 项目 | 限制 |
|---|---|
| 格式 | jpeg / png / webp / bmp / tiff / gif / heic / heif |
| 大小 | < 30 MB |
| 长宽比 | 0.4 ~ 2.5 |
| 宽高 | 300 ~ 6000 px |
视频 (Video)
| 项目 | 限制 |
|---|---|
| 格式 | mp4 / mov |
| 大小 | ≤ 50 MB |
| 分辨率 | 480p、720p(不支持 1080p+) |
| 时长 | 2 ~ 15 秒 |
| FPS | 24 ~ 60 |
| 长宽比 | 0.4 ~ 2.5 |
| 宽高 | 300 ~ 6000 px |
| 总像素(W×H) | 409600 ~ 927408 |
音频 (Audio)
| 项目 | 限制 |
|---|---|
| 格式 | mp3 / wav |
| 大小 | ≤ 15 MB |
| 时长 | 2 ~ 15 秒 |
网关仅做 URL 后缀校验;尺寸/时长等由 BytePlus 异步完成,不达标时status变为failed。
请求示例
图片、视频、音频请求体结构相同,仅asset_type 与 URL 不同:
# 图片
curl -X POST "https://api.gravitex.ai/v1/assets" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-cdn.com/portrait.jpg","group_id":"group-xxx","asset_type":"Image","name":"portrait.jpg"}'
# 视频
curl -X POST "https://api.gravitex.ai/v1/assets" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-cdn.com/dance.mp4","group_id":"group-xxx","asset_type":"Video","name":"dance.mp4"}'
# 音频
curl -X POST "https://api.gravitex.ai/v1/assets" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"url":"https://your-cdn.com/voice.mp3","group_id":"group-xxx","asset_type":"Audio","name":"voice.mp3"}'
响应示例
{
"virtual_id": "asset-20260508120145-pqwhc",
"asset_url": "asset://asset-20260508120145-pqwhc",
"group_id": "group-20260508120000-abcde",
"asset_type": "Image",
"status": "pending"
}
| 字段 | 说明 |
|---|---|
asset_url | 视频生成时在 content 中引用(按 asset_type 映射字段) |
status | pending → active / failed |
⌘I
