curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "doubao-seedance-2.5",
prompt: "一段极具电影感的30秒蒸汽朋克微缩景观序列",
size: "16:9",
resolution: "720p",
duration: 30,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "doubao-seedance-2.5",
"prompt" => "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size" => "16:9",
"resolution" => "720p",
"duration" => 30
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KMCGF6BQGN3X28H3KSR50X5T"
}
]
}
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试",
"type": "server_error"
}
}
doubao-seedance-2-5
doubao-seedance-2.5 视频生成
- 异步处理,返回 task_id 用于查询
- 文生视频 / 多模态参考 / 视频编辑 / 视频延长 / 首尾帧
- 单次最长 30 秒;参考素材最多 30 图 + 10 视频 + 10 音频
- 分辨率仅 480p / 720p;支持 mp4 / mov 输出
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "doubao-seedance-2.5",
prompt: "一段极具电影感的30秒蒸汽朋克微缩景观序列",
size: "16:9",
resolution: "720p",
duration: 30,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "doubao-seedance-2.5",
"prompt" => "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size" => "16:9",
"resolution" => "720p",
"duration" => 30
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KMCGF6BQGN3X28H3KSR50X5T"
}
]
}
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试",
"type": "server_error"
}
}
相对 2.0 的主要变化:时长上限 15s → 30s;参考素材 9 图 + 3 视频 + 3 音频 → 30 图 + 10 视频 + 10 音频;支持纯音频参考;新增 mov 输出。
注意:分辨率仅 480p / 720p(2.0 的 1080p / 4k 在 2.5 不可用)。
注意:分辨率仅 480p / 720p(2.0 的 1080p / 4k 在 2.5 不可用)。
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "doubao-seedance-2.5",
prompt: "一段极具电影感的30秒蒸汽朋克微缩景观序列",
size: "16:9",
resolution: "720p",
duration: 30,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "doubao-seedance-2.5",
"prompt" => "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size" => "16:9",
"resolution" => "720p",
"duration" => 30
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KMCGF6BQGN3X28H3KSR50X5T"
}
]
}
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试",
"type": "server_error"
}
}
认证
string
必填
Bearer Token 认证。访问 API Key 管理页面 获取密钥。
Authorization: Bearer YOUR_API_KEY
请求参数
string
必填
固定值:
doubao-seedance-2.5string
必填
提示词。可用
@图片1 / @视频1 / @音频1 指代参考素材(下标从 1 起,对应数组顺序)。示例:"全程使用@视频1的第一视角构图,@音频1作为背景音乐,首帧为@图片1"string
默认值:"720p"
分辨率,仅支持:
480p720p(默认)
1080p / 2k / 4k 等会同步 400。string
默认值:"adaptive"
宽高比(也接受字段名
aspect_ratio)。可选值:16:9、4:3、1:1、3:4、9:16、21:9、adaptive(默认)视频编辑、视频延长、首帧/首尾帧任务对
size 有硬性限制,见 任务类型与限制。integer
默认值:"5"
时长(秒):
4~30-1:模型自动选择时长(提交时按 30 秒上限预扣,完成后按实际产出多退少补)
boolean
默认值:"true"
是否生成音频(也接受字段名
audio)。true:有声视频(默认)false:无声视频
boolean
默认值:"false"
是否添加「AI 生成」水印。默认
false。integer
随机种子。相同请求下不同 seed 通常得到不同结果;相同 seed 结果相近但不保证完全一致。
string
默认值:"mp4"
输出封装格式:
mp4(默认)mov:更高色彩精度,推荐用于编辑 / 延长场景
array<string>
参考图 URL 数组,一律作为
reference_image。支持:- 普通 URL:
https://example.com/pic.jpg - 私域素材:
asset://cm9xxxxxxxx
image_with_roles。- 最多 30 张
- 与
image_with_roles不要混用冲突角色语义;首尾帧请走image_with_roles
array<object>
带角色的图片数组。
示例:
显示 字段说明
显示 字段说明
[
{"url": "https://example.com/first.jpg", "role": "first_frame"},
{"url": "https://example.com/last.jpg", "role": "last_frame"}
]
若同时存在
video_urls / audio_urls,first_frame / last_frame 会自动转为 reference_image(多模态参考任务)。array<string>
参考视频 URL 数组(
reference_video)。支持普通 URL 与 asset://...。最多 10 个;总时长 ≤ 30s(单段 2~30s)。array<string>
参考音频 URL 数组(
reference_audio)。支持普通 URL 与 asset://...。最多 10 段;总时长 ≤ 30s(单段 2~30s)。2.5 支持纯音频参考(可不配图/视频)。
boolean
默认值:"false"
为
true 时,任务成功后额外返回尾帧图片,便于连续生成。array<object>
工具列表,用于联网搜索等增强能力。示例:
"tools": [{"type": "web_search"}]
显示 字段说明
显示 字段说明
string
必填
工具类型可选值:
web_search- 联网搜索,生成时参考网络信息
素材要求
| 素材 | 限制 |
|---|---|
| 图片 | ≤30 张;jpeg / png / webp / bmp / tiff / gif / heic / heif;宽高比 [0.4, 2.5];边长 [300, 6000]px;单张 <30MB |
| 视频 | ≤10 个;mp4 / mov(H.264 / H.265 + AAC / MP3);单个 [2, 30]s 且总时长 ≤30s;480p / 720p;总像素 [409600, 8295044];fps [24, 60];单个 ≤200MB |
| 音频 | ≤10 段;wav / mp3;单段 [2, 30]s 且总时长 ≤30s;单个 ≤15MB |
任务类型与限制
系统会按参考素材与提示词意图判定任务类型。后三种对size / duration 有硬性限制,违反会在任务开始后异步失败(如 InvalidParameter.TaskTypeConstraint):
| 任务类型 | 触发条件 | 限制 |
|---|---|---|
| 文生视频 | 仅文本 | 无 |
| 参考生视频 | 参考素材 + 普通描述提示词 | 无。避免在提示词中出现「编辑 / 延长 / 续写 / 删除 / 替换」等词,防止误判 |
| 视频编辑 | 参考素材 + 提示词含「编辑视频 / 增加 / 删除 / 修改 / 替换」等 | size 仅 adaptive,duration 仅 -1;待编辑视频须 4~30s |
| 视频延长 | 参考素材 + 提示词含「向前 / 向后延长 / 延续 / 续写」 | size 仅 adaptive |
| 首帧 / 首尾帧 | image_with_roles 使用 first_frame / last_frame | size 仅 adaptive(提交阶段也会同步校验) |
私域素材库(asset://)
与 Seedance 2.0 私域虚拟人像 相同:在 image_urls / image_with_roles / video_urls / audio_urls 中可直接使用已审核通过的素材 ID:
"video_urls": ["asset://cm9xxxxxxxx"]
计费
- 按 秒 × 分辨率档 计费。
- 有参考视频输入时:计费秒数 = 输入视频总时长(≤30s)+ 输出时长,走带输入参考的优惠档单价。
duration = -1(自动时长):提交时按上限 30 秒预扣,完成后按实际产出多退少补。- 未传
duration:按 5 秒生成与计费。 - 任务失败或内容审核拦截:全额退款(仅成功出片收费)。
请求示例
文生视频(30 秒)
{
"model": "doubao-seedance-2.5",
"prompt": "一段极具电影感的30秒蒸汽朋克微缩景观序列",
"size": "16:9",
"resolution": "720p",
"duration": 30
}
多模态参考(图 + 视频 + 音频)
{
"model": "doubao-seedance-2.5",
"prompt": "全程使用@视频1的第一视角构图,@音频1作为背景音乐,首帧为@图片1",
"image_urls": [
"https://example.com/pic1.jpg",
"https://example.com/pic2.jpg"
],
"video_urls": ["https://example.com/ref.mp4"],
"audio_urls": ["https://example.com/bgm.mp3"],
"size": "16:9",
"duration": 11
}
视频编辑
{
"model": "doubao-seedance-2.5",
"prompt": "编辑视频:删除 @视频1 中的所有路人,只保留主角",
"video_urls": ["https://example.com/input.mp4"],
"size": "adaptive",
"duration": -1,
"output_format": "mov"
}
首尾帧生视频
{
"model": "doubao-seedance-2.5",
"prompt": "图中女孩对着镜头说\"茄子\",360度环绕运镜",
"image_with_roles": [
{"url": "https://example.com/first.jpg", "role": "first_frame"},
{"url": "https://example.com/last.jpg", "role": "last_frame"}
],
"size": "adaptive",
"duration": 5
}
私域素材
{
"model": "doubao-seedance-2.5",
"prompt": "人物在城市街道自然行走,阳光明媚",
"image_urls": ["asset://cm9xxxxxxxx"],
"duration": 5,
"resolution": "720p"
}
联网搜索
{
"model": "doubao-seedance-2.5",
"prompt": "根据最新资讯生成一段科技新闻短视频开场",
"size": "16:9",
"resolution": "720p",
"duration": 8,
"tools": [{"type": "web_search"}]
}
常见错误
| 现象 | 原因 |
|---|---|
400 This model only supports 480p or 720p resolution | 传了 1080p / 2k / 4k 等,2.5 不支持 |
400 This model only supports duration 4-30 seconds, or -1 | duration 不在允许范围 |
400 first_frame/last_frame tasks only support ratio=adaptive | 首尾帧任务指定了具体宽高比 |
| 任务异步失败(编辑 / 延长类提示) | 提示词被判定为编辑 / 延长,但 size / duration 不满足对应限制(见上表) |
任务异步失败 SensitiveContentDetected | 素材或产物触发内容审核 |
响应
integer
响应状态码,成功时为 200
使用 获取任务状态 轮询。成功后取
result.videos[0].url(已转存,长期有效)。return_last_frame=true 时结果中附尾帧图片。与 2.0 的差异
| 特性 | 2.0 | 2.5 |
|---|---|---|
| 模型名 | doubao-seedance-2.0 等 | doubao-seedance-2.5 |
| 时长 | 约 4~15s | 4~30s,或 -1 自动 |
| 分辨率 | 480p / 720p / 1080p / 4k | 仅 480p / 720p |
| 参考图 | ≤9 | ≤30 |
| 参考视频 | ≤3,总时长约 <15s | ≤10,总时长 ≤30s |
| 参考音频 | ≤3,总时长 ≤15s | ≤10,总时长 ≤30s;支持纯音频 |
| 输出格式 | 主要为 mp4 | mp4 / mov |
| 水印 | — | watermark |
私域 asset:// | 支持 | 通用(同一私域接口) |
⌘I