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
}