seedance-2.5-ext 视频生成
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"seconds": 123,
"size": "<string>",
"resolution": "<string>",
"reference_image": "<string>",
"reference_images": [
"<string>"
],
"video_with_roles": [
{}
],
"audio_with_roles": [
{}
],
"callback_url": "<string>",
"client_business_id": "<string>",
"trace_id": "<string>"
}
'import requests
url = "https://toapis.com/v1/videos/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"seconds": 123,
"size": "<string>",
"resolution": "<string>",
"reference_image": "<string>",
"reference_images": ["<string>"],
"video_with_roles": [{}],
"audio_with_roles": [{}],
"callback_url": "<string>",
"client_business_id": "<string>",
"trace_id": "<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({
model: '<string>',
prompt: '<string>',
seconds: 123,
size: '<string>',
resolution: '<string>',
reference_image: '<string>',
reference_images: ['<string>'],
video_with_roles: [{}],
audio_with_roles: [{}],
callback_url: '<string>',
client_business_id: '<string>',
trace_id: '<string>'
})
};
fetch('https://toapis.com/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://toapis.com/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",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'seconds' => 123,
'size' => '<string>',
'resolution' => '<string>',
'reference_image' => '<string>',
'reference_images' => [
'<string>'
],
'video_with_roles' => [
[
]
],
'audio_with_roles' => [
[
]
],
'callback_url' => '<string>',
'client_business_id' => '<string>',
'trace_id' => '<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://toapis.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"reference_image\": \"<string>\",\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_with_roles\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"callback_url\": \"<string>\",\n \"client_business_id\": \"<string>\",\n \"trace_id\": \"<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://toapis.com/v1/videos/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"reference_image\": \"<string>\",\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_with_roles\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"callback_url\": \"<string>\",\n \"client_business_id\": \"<string>\",\n \"trace_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/videos/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"reference_image\": \"<string>\",\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_with_roles\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"callback_url\": \"<string>\",\n \"client_business_id\": \"<string>\",\n \"trace_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "seedance-2.5-ext",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
seedance-ext
seedance-2.5-ext 视频生成
使用 seedance-2.5-ext 模型生成视频,支持参考图片、参考视频和参考音频
POST
/
v1
/
videos
/
generations
seedance-2.5-ext 视频生成
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"seconds": 123,
"size": "<string>",
"resolution": "<string>",
"reference_image": "<string>",
"reference_images": [
"<string>"
],
"video_with_roles": [
{}
],
"audio_with_roles": [
{}
],
"callback_url": "<string>",
"client_business_id": "<string>",
"trace_id": "<string>"
}
'import requests
url = "https://toapis.com/v1/videos/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"seconds": 123,
"size": "<string>",
"resolution": "<string>",
"reference_image": "<string>",
"reference_images": ["<string>"],
"video_with_roles": [{}],
"audio_with_roles": [{}],
"callback_url": "<string>",
"client_business_id": "<string>",
"trace_id": "<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({
model: '<string>',
prompt: '<string>',
seconds: 123,
size: '<string>',
resolution: '<string>',
reference_image: '<string>',
reference_images: ['<string>'],
video_with_roles: [{}],
audio_with_roles: [{}],
callback_url: '<string>',
client_business_id: '<string>',
trace_id: '<string>'
})
};
fetch('https://toapis.com/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://toapis.com/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",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'seconds' => 123,
'size' => '<string>',
'resolution' => '<string>',
'reference_image' => '<string>',
'reference_images' => [
'<string>'
],
'video_with_roles' => [
[
]
],
'audio_with_roles' => [
[
]
],
'callback_url' => '<string>',
'client_business_id' => '<string>',
'trace_id' => '<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://toapis.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"reference_image\": \"<string>\",\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_with_roles\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"callback_url\": \"<string>\",\n \"client_business_id\": \"<string>\",\n \"trace_id\": \"<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://toapis.com/v1/videos/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"reference_image\": \"<string>\",\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_with_roles\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"callback_url\": \"<string>\",\n \"client_business_id\": \"<string>\",\n \"trace_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/videos/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"seconds\": 123,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"reference_image\": \"<string>\",\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_with_roles\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"callback_url\": \"<string>\",\n \"client_business_id\": \"<string>\",\n \"trace_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "seedance-2.5-ext",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
国内用户请注意: 中国大陆用户请使用
https://toapis.cn 作为接口地址(Base URL)。文档示例中的 https://toapis.com 请替换为 https://toapis.cn。seedance-2.5-ext 是 Seedance 2.5 系列的促销渠道模型,支持文生视频和多模态参考生成:
- 文生视频、参考图片生成
- 参考视频和参考音频联合生成(不支持视频编辑、延长和首尾帧模式)
- 接口为异步任务:提交后返回
generation.task,完成后通过视频任务状态接口获取结果。
认证
string
必填
使用 Bearer Token 认证:
Authorization: Bearer YOUR_API_KEY
请求参数
string
默认值:"seedance-2.5-ext"
必填
ToAPIs 公共模型名,固定使用
seedance-2.5-ext。string
描述场景、镜头运动、主体动作、风格和声音氛围。引用素材时可按数组顺序写“图片1”“视频1”“音频1”等标签。
integer
输出视频时长(秒),范围
10–30。兼容字段 duration 也可以使用,无需同时传入。携带参考视频、参考音频或超过 10 张参考图片时不支持
15 秒;纯文本或不超过 10 张图片的请求不受此限制。string
输出宽高比,支持
16:9、9:16、4:3、3:4、1:1。兼容字段 aspect_ratio 也可以使用。string
默认值:"720p"
输出分辨率,固定为
720p。string
单张参考图片的公开 URL。多张时请改用
reference_images。string[]
参考图片 URL 数组,最多
30 张。也可以使用 image_with_roles(role 为 reference_image)显式传入。object[]
参考视频数组,最多
10 段。每项包含:url:公开可访问的视频 URLrole:固定为reference_video
object[]
参考音频数组,最多
10 段。每项包含:url:公开可访问的音频 URLrole:固定为reference_audio
string
ToAPIs 任务完成回调地址,详见任务 Webhook。
string
客户侧订单号或业务任务 ID。提交后会随任务保存,也可用
GET /v1/videos/generations/{client_business_id} 查询。string
调用方自定义的链路追踪 ID。
素材组合规则
| 请求内容 | 是否支持 | 说明 |
|---|---|---|
| 仅提示词 | 是 | 文生视频 |
| 参考图片 ≤10 张 | 是 | 低成本上游 |
| 参考图片 11–30 张 | 是 | 不支持 15 秒 |
| 参考视频 / 参考音频 | 是 | 不支持 15 秒;音频需搭配图片或视频 |
| 首帧 / 尾帧 | 否 | 不支持首尾帧模式 |
| 视频编辑 / 延长 | 否 | 请使用 seedance-2-5 |
请求示例
文生视频
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.5-ext",
"prompt": "电影感产品特写,镜头缓慢推进,保留自然室内声音。",
"seconds": 10,
"size": "16:9",
"resolution": "720p"
}'
参考图片生成
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.5-ext",
"prompt": "让图片1中的人物走入雨夜街道,镜头跟随。",
"seconds": 12,
"size": "9:16",
"reference_images": [
"https://example.com/character.png"
]
}'
视频和音频联合参考
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.5-ext",
"prompt": "使用图片1中的人物形象、视频1的运镜和音频1的节奏生成视频。",
"seconds": 14,
"size": "16:9",
"reference_images": [
"https://example.com/character.png"
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/rhythm.mp3", "role": "reference_audio"}
]
}'
响应
string
任务 ID,用于查询状态。
string
请求传入该字段时返回。
string
固定为
generation.task。string
本次请求的模型名。
string
queued、in_progress、completed 或 failed。integer
0–100 的任务进度。integer
创建时间戳。
{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "seedance-2.5-ext",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}