视频生成(Seedance)
curl --request POST \
--url https://openp.ai/seedance/v1/videos/generationsimport requests
url = "https://openp.ai/seedance/v1/videos/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://openp.ai/seedance/v1/videos/generations', 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://openp.ai/seedance/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/seedance/v1/videos/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openp.ai/seedance/v1/videos/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/seedance/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body视频与图像生成
视频生成(Seedance)
POST /seedance/v1/videos/generations —— Seedance 标准视频生成
POST
/
seedance
/
v1
/
videos
/
generations
视频生成(Seedance)
curl --request POST \
--url https://openp.ai/seedance/v1/videos/generationsimport requests
url = "https://openp.ai/seedance/v1/videos/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://openp.ai/seedance/v1/videos/generations', 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://openp.ai/seedance/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/seedance/v1/videos/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openp.ai/seedance/v1/videos/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/seedance/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body通过 Seedance 模型生成视频,兼容 seevio.ai 标准 API。采用 异步任务 流程:提交后获取任务 ID,轮询完成后下载视频。
媒体 URL 可以是公开可访问的 http(s) 地址,也可以是 data URL(
媒体也支持 data URL 内联(
参考视频与参考音频同样适用(
返回
提交任务
curl https://openp.ai/seedance/v1/videos/generations \
-H "Authorization: Bearer $OPENPAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0-fast",
"input": {
"prompt": "A golden retriever running on a beach at sunset, cinematic",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}
}'
参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | ✅ | 见下方模型列表 |
input | object | ✅ | 生成参数,字段见下 |
input 字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt | string | ✅ | 视频描述 |
generation_type | string | 生成模式:text-to-video(默认)/ image-to-video / reference-to-video | |
image_urls | array | 条件 | 图片 URL 列表。图生视频:1 张(首帧)或 2 张(首+尾帧);参考生视频:参考图 |
video_urls | array | 参考视频 URL 列表(仅参考生视频) | |
audio_urls | array | 参考音频 URL 列表(仅参考生视频) | |
duration | integer | 时长(秒),默认 5 | |
aspect_ratio | string | 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive(默认) | |
resolution | string | 480p / 720p(默认)/ 1080p | |
generate_audio | boolean | 是否生成配音,默认 true | |
negative_prompt | string | 负面提示词 |
data:image/png;base64,...)。
模型列表
seedance-2-5 / seedance-2-0 / seedance-2-0-fast / seedance-2-0-mini / seedance-2-0-enhanced / seedance-2-0-mini-enhanced / seedance-1-5-pro
生成模式
图生视频(首帧)
image_urls 传 1 张图片作为首帧:
curl https://openp.ai/seedance/v1/videos/generations \
-H "Authorization: Bearer $OPENPAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-5",
"input": {
"prompt": "the subject turns toward camera, soft studio motion",
"generation_type": "image-to-video",
"image_urls": ["https://your.cdn.com/first-frame.jpg"],
"duration": 5,
"resolution": "720p"
}
}'
data:<mime>;base64,...),适合直接上传本地素材而无需先托管。图片:
{
"model": "seedance-2-0-fast",
"input": {
"prompt": "gentle ocean waves under a warm sunset sky, cinematic",
"generation_type": "image-to-video",
"image_urls": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..."],
"duration": 4,
"resolution": "480p"
}
}
video/mp4、audio/mpeg 等 MIME 类型):
{
"model": "seedance-2-5",
"input": {
"prompt": "the character from image 1 performs the motion from the video with the reference voice",
"generation_type": "reference-to-video",
"image_urls": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..."],
"video_urls": ["data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb20..."],
"audio_urls": ["data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4..."],
"duration": 8
}
}
内联视频/音频会让请求体显著增大(base64 约膨胀 33%),单个素材上限 100 MB;素材较大或需复用时建议改用公开 URL。
图生视频(首帧 + 尾帧)
image_urls 传 2 张图片,模型在首帧与尾帧之间插值生成:
{
"model": "seedance-2-5",
"input": {
"prompt": "smooth camera push-in from the first frame to the last",
"generation_type": "image-to-video",
"image_urls": [
"https://your.cdn.com/first-frame.jpg",
"https://your.cdn.com/last-frame.jpg"
],
"duration": 5
}
}
参考生视频(图片 + 视频)
用参考图锁定主体,用参考视频复刻运镜/动作:{
"model": "seedance-2-5",
"input": {
"prompt": "use the product from image 1 and the camera motion from the reference video",
"generation_type": "reference-to-video",
"image_urls": ["https://your.cdn.com/product.jpg"],
"video_urls": ["https://your.cdn.com/camera-motion.mp4"],
"duration": 8,
"resolution": "720p"
}
}
参考生视频(图片 + 音频)
让人物/主体按照参考音频说话或演唱:{
"model": "seedance-2-5",
"input": {
"prompt": "the woman from image 1 sings the reference song on stage",
"generation_type": "reference-to-video",
"image_urls": ["https://your.cdn.com/singer.jpg"],
"audio_urls": ["https://your.cdn.com/song.mp3"],
"duration": 10
}
}
参考生视频(图片 + 视频 + 音频)
三种素材可以同时组合使用:{
"model": "seedance-2-5",
"input": {
"prompt": "the character from image 1 performs the motion from the video with the reference voice",
"generation_type": "reference-to-video",
"image_urls": ["https://your.cdn.com/character.jpg"],
"video_urls": ["https://your.cdn.com/motion.mp4"],
"audio_urls": ["https://your.cdn.com/voice.mp3"],
"duration": 8
}
}
参考生视频(仅音频)
seedance-2-5 支持仅音频作为参考;seedance-2-0 系列使用音频时需至少搭配 1 张图片或 1 段视频:
{
"model": "seedance-2-5",
"input": {
"prompt": "a music video visualizer following the rhythm of the reference track",
"generation_type": "reference-to-video",
"audio_urls": ["https://your.cdn.com/track.mp3"],
"duration": 10
}
}
素材限制
| 模型 | 图片 | 视频 | 音频 | 总量 |
|---|---|---|---|---|
seedance-2-5 | ≤ 30 | ≤ 10,每段 2-30 秒,合计 ≤ 30 秒 | ≤ 10,每段 2-30 秒,合计 ≤ 30 秒 | ≤ 50 |
seedance-2-0 系列 | ≤ 9 | ≤ 3,合计 ≤ 15 秒 | ≤ 3,合计 ≤ 15 秒 | — |
响应(任务创建)
{
"taskId": "task_id",
"credits": 28
}
taskId 即任务 ID,credits 为预估扣费。
查询任务状态
curl https://openp.ai/seedance/v1/tasks/task_id \
-H "Authorization: Bearer $OPENPAI_API_KEY"
{
"id": "task_id",
"status": "completed",
"created_at": 1786176476,
"model": "seedance-2-0-fast",
"billing_status": "charged",
"credits": 28,
"data": {
"results": [
"https://openp.ai/seedance/v1/videos/generations/task_id.mp4"
],
"processing_time": 104
}
}
| 字段 | 说明 |
|---|---|
status | queued / generating / completed / failed |
billing_status | reserved(预扣)/ charged(已扣费)/ refunded(已退款) |
credits | 实际扣费 |
failed_reason | 失败原因(仅 failed 时返回,此时无 data) |
data.results | 视频下载 URL 列表(仅 completed 时返回) |
data.processing_time | 生成耗时(秒) |
下载视频
curl -L https://openp.ai/seedance/v1/videos/generations/task_id.mp4 \
-H "Authorization: Bearer $OPENPAI_API_KEY" \
-o video.mp4
video/mp4 字节流。
轮询建议
- 初始延迟 5-10 秒后开始轮询。
- 间隔 10-30 秒一次。
- 通常 1-3 分钟完成。
- 失败时
failed_reason字段说明原因。
计费
按 模型单价 × 生成秒数 扣费,提交时预扣、完成时结算。失败的任务自动退款(billing_status 变为 refunded)。