- 异步处理模式,返回任务ID用于后续查询
- 支持文生视频、图生视频(首帧/尾帧)
- 支持参考视频、参考音频、有声视频
- 支持横屏、竖屏、方形、超宽屏、自适应多种比例
请求示例
bash
curl --request POST \
--url https://api.openveer.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.0",
"prompt": "小猫对着镜头打哈欠",
"resolution": "720p",
"size": "16:9",
"duration": 5,
"generate_audio": true
}'
```python
import requests
url = "https://api.openveer.com/v1/videos/generations"
payload = {
"model": "doubao-seedance-2.0",
"prompt": "小猫对着镜头打哈欠",
"resolution": "720p",
"size": "16:9",
"duration": 5,
"generate_audio": True
}
headers = {
"Authorization": "Bearer
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
```
```javascript
const url = "https://api.openveer.com/v1/videos/generations";
const payload = {
model: "doubao-seedance-2.0",
prompt: "小猫对着镜头打哈欠",
resolution: "720p",
size: "16:9",
duration: 5,
generate_audio: true
};
const headers = {
"Authorization": "Bearer
"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));
```
```go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.openveer.com/v1/videos/generations"
payload := map[string]interface{}{
"model": "doubao-seedance-2.0",
"prompt": "小猫对着镜头打哈欠",
"resolution": "720p",
"size": "16:9",
"duration": 5,
"generate_audio": true,
}
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))
}
```
```java
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.openveer.com/v1/videos/generations";
String payload = """
{
"model": "doubao-seedance-2.0",
"prompt": "小猫对着镜头打哈欠",
"resolution": "720p",
"size": "16:9",
"duration": 5,
"generate_audio": true
}
""";
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
"doubao-seedance-2.0",
"prompt" => "小猫对着镜头打哈欠",
"resolution" => "720p",
"size" => "16:9",
"duration" => 5,
"generate_audio" => true
];
$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
```
```ruby
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.openveer.com/v1/videos/generations")
payload = {
model: "doubao-seedance-2.0",
prompt: "小猫对着镜头打哈欠",
resolution: "720p",
size: "16:9",
duration: 5,
generate_audio: true
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
```
```swift
import Foundation
let url = URL(string: "https://api.openveer.com/v1/videos/generations")!
let payload: [String: Any] = [
"model": "doubao-seedance-2.0",
"prompt": "小猫对着镜头打哈欠",
"resolution": "720p",
"size": "16:9",
"duration": 5,
"generate_audio": true
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: (error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
```
```csharp
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.openveer.com/v1/videos/generations";
var payload = @"{
""model"": ""doubao-seedance-2.0"",
""prompt"": ""小猫对着镜头打哈欠"",
""resolution"": ""720p"",
""size"": ""16:9"",
""duration"": 5,
""generate_audio"": true
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
```
响应示例
json
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KMCGF6BQGN3X28H3KSR50X5T"
}
]
}
json
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
json
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
json
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
json
{
"error": {
"code": 429,
"message": "请求过于频繁,请稍后再试",
"type": "rate_limit_error"
}
}
json
{
"error": {
"code": 500,
"message": "服务器内部错误,请稍后重试",
"type": "server_error"
}
}
认证
Authorization string请求参数
model stringprompt stringduration integersize stringresolution stringseed integergenerate_audio booleanreturn_last_frame booleantools stringimage_urls stringimage_with_roles arrayrole string示例:
json
[
{"url": "https://example.com/day.jpg", "role": "first_frame"},
{"url": "https://example.com/night.jpg", "role": "last_frame"}
]
Asset URL 写法:
json
[
{"url": "asset://asset_a", "role": "reference_image"}
]
video_urls stringaudio_urls string响应
code integerdata arraytask_id string使用场景
场景 1:文生视频
{
"model": "doubao-seedance-2.0",
"prompt": "小猫对着镜头打哈欠",
"resolution": "720p",
"size": "16:9",
"duration": 5,
"seed": 42,
"generate_audio": true
}
场景 2:图生视频(首帧)
{
"model": "doubao-seedance-2.0",
"prompt": "小猫站起来走向镜头",
"image_urls": ["https://example.com/cat.jpg"],
"duration": 5
}
场景 3:首尾帧视频
{
"model": "doubao-seedance-2.0",
"prompt": "从白天过渡到夜晚",
"image_with_roles": [
{"url": "https://example.com/day.jpg", "role": "first_frame"},
{"url": "https://example.com/night.jpg", "role": "last_frame"}
],
"duration": 5
}
场景 4:视频参考生视频
{
"model": "doubao-seedance-2.0",
"prompt": "将视频风格转换为动漫风格",
"video_urls": ["https://example.com/reference.mp4"]
}
场景 5:参考视频 + 参考音频
{
"model": "doubao-seedance-2.0",
"prompt": "人物说话的场景",
"video_urls": ["https://example.com/reference.mp4"],
"audio_urls": ["https://example.com/speech.wav"],
"size": "16:9",
"duration": 11
}
场景 6:有声视频
{
"model": "doubao-seedance-2.0",
"prompt": "男人叫住女人说:\"你记住,以后不可以用手指指月亮。\"",
"generate_audio": true
}
场景 7:连续视频生成(返回尾帧)
{
"model": "doubao-seedance-2.0",
"prompt": "小猫继续走向镜头",
"image_urls": ["https://example.com/last_frame_from_prev.png"],
"return_last_frame": true
}
场景 8:快速版生成
{
"model": "doubao-seedance-2.0-fast",
"prompt": "城市夜景延时摄影",
"size": "21:9",
"duration": 8
}
场景 9:参考图片 + 参考视频 + 参考音频(多模态视频)
结合参考图片、参考视频和参考音频,生成沉浸式第一人称视角广告视频。适用于产品宣传、品牌广告等需要多素材融合的场景。
{
"model": "doubao-seedance-2.0",
"prompt": "全程使用视频1的第一视角构图,全程使用音频1作为背景音乐。第一人称视角果茶宣传广告,seedance牌「苹苹安安」苹果果茶限定款;首帧为图片1,你的手摘下一颗带晨露的阿克苏红苹果,轻脆的苹果碰撞声;2-4秒:快速切镜,你的手将苹果块投入雪克杯,加入冰块与茶底,用力摇晃,冰块碰撞声与摇晃声卡点轻快鼓点,背景音:「鲜切现摇」;4-6秒:第一人称成品特写,分层果茶倒入透明杯,你的手轻挤奶盖在顶部铺展,在杯身贴上粉红包标,镜头拉近看奶盖与果茶的分层纹理;6-8秒:第一人称手持举杯,你将图片2中的果茶举到镜头前(模拟递到观众面前的视角),杯身标签清晰可见,背景音「来一口鲜爽」,尾帧定格为图片2。背景声音统一为女生音色。",
"image_urls": [
"https://example.com/tea_pic1.jpg",
"https://example.com/tea_pic2.jpg"
],
"video_urls": ["https://example.com/tea_video1.mp4"],
"audio_urls": ["https://example.com/tea_audio1.mp3"],
"generate_audio": true,
"size": "16:9",
"duration": 11
}
场景 10:使用 Asset URL 图生视频
审核通过的虚拟人像素材可直接作为参考图片传入,无需重新上传和审核。
{
"model": "doubao-seedance-2.0",
"prompt": "人物在城市街道自然行走,阳光明媚",
"image_urls": ["asset://asset_a"],
"duration": 5,
"resolution": "720p"
}
场景 11:使用 Asset URL 指定参考人像(image_with_roles)
{
"model": "doubao-seedance-2.0",
"prompt": "使用参考人像,人物优雅地走向镜头",
"image_with_roles": [
{
"url": "asset://asset_a",
"role": "reference_image"
}
],
"resolution": "720p",
"duration": 5
}
场景 12:快速版 + Asset URL 图生视频
{
"model": "doubao-seedance-2.0-fast",
"prompt": "人物在公园里漫步,微风轻拂",
"image_urls": ["asset://asset_a"],
"duration": 5,
"resolution": "720p"
}
场景 13:Asset URL 图片 + 参考视频(动作迁移)
将审核通过的人像素材与参考视频结合,驱动人物完成指定动作。
{
"model": "doubao-seedance-2.0",
"prompt": "人物按照参考视频的节奏起舞,动作连贯自然",
"image_urls": ["https://example.com/dance_reference.jpg", "asset://asset_a"],
"video_urls": ["https://example.com/dance_reference.mp4", "asset://asset_a"],
"duration": 8,
"resolution": "720p"
}
与 1.5 Pro 版本的差异
| 特性 | 1.5 Pro | 2.0 / 2.0 fast |
|---|---|---|
| 分辨率 | 480p/720p/1080p | 480p/720p/1080p/4k(fast 仅 480p/720p) |
| 时长范围 | 4-12秒 | 5-15秒 |
| 默认时长 | 5秒 | 5秒 |
| 宽高比参数 | aspect_ratio |
size(新增 adaptive 自适应) |
| 音频生成 | audio 参数 |
generate_audio 参数 |
| 参考视频 | 不支持 | 支持 video_urls |
| 参考音频 | 不支持 | 支持 audio_urls |
| 图生视频 | image_urls / image_with_roles |
image_urls / image_with_roles |
| 有声视频 | 不支持 | 支持 generate_audio |
| 连续视频 | 不支持 | 支持 return_last_frame |
| 快速版 | 不支持 | 支持 doubao-seedance-2.0-fast |