seedance-2-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>"
],
"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>"],
"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>'],
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>'
],
'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 \"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 \"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 \"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-ext",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
seedance-ext
seedance-2-ext 動画生成
seedance-2-ext モデルで動画を生成 — テキストから動画と参照画像による生成に対応
POST
/
v1
/
videos
/
generations
seedance-2-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>"
],
"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>"],
"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>'],
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>'
],
'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 \"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 \"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 \"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-ext",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
中国本土のユーザー向け: 中国本土のユーザーは
https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。seedance-2-ext は Seedance 2.0 ファミリーのプロモーションチャネルモデルで、標準割引ティアを提供します:
- テキストから動画、参照画像による生成
- 参照動画、参照音声、最初/最後フレーム制御、動画編集は非対応
- API は非同期タスクです:送信すると
generation.taskが返され、完了後に動画タスクステータス APIで結果を取得します。
認証
string
必須
Bearer Token で認証します:
Authorization: Bearer YOUR_API_KEY
リクエストパラメータ
string
デフォルト:"seedance-2-ext"
必須
ToAPIs の公開モデル名。常に
seedance-2-ext を指定してください。string
シーン、カメラワーク、被写体の動き、スタイル、サウンドの雰囲気を記述します。
integer
出力動画の長さ(秒)。
4–15 の範囲。互換フィールド duration も使用できます。両方を同時に渡さないでください。string
出力アスペクト比。
16:9、9:16、4:3、3:4、1:1、21:9 をサポート。互換フィールド aspect_ratio も使用できます。string
デフォルト:"720p"
出力解像度。
720p 固定です。string
単一の参照画像の公開 URL。複数枚の場合は
reference_images を使用してください。string[]
参照画像 URL の配列。最大
9 枚。image_with_roles(role は reference_image)で明示的に渡すこともできます。string
ToAPIs のタスク完了コールバック URL。詳細はタスク Webhookを参照してください。
string
お客様側の注文番号または業務タスク ID。タスクと一緒に保存され、
GET /v1/videos/generations/{client_business_id} でも照会できます。string
呼び出し側が定義するトレース ID。
素材の組み合わせルール
| リクエスト内容 | 対応 | 備考 |
|---|---|---|
| プロンプトのみ | はい | テキストから動画生成 |
| 参照画像 | はい | 最大 9 枚 |
| 参照動画 / 参照音声 | いいえ | seedance-2.5-ext をご利用ください |
| 最初 / 最後フレーム | いいえ | フレームモード非対応 |
リクエスト例
テキストから動画
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-ext",
"prompt": "夕暮れの都市のスカイライン、カメラがゆっくり引いていく。",
"seconds": 5,
"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-ext",
"prompt": "画像1の製品がゆっくり回転して展示される。",
"seconds": 10,
"size": "1:1",
"reference_images": [
"https://example.com/product.png"
]
}'
レスポンス
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-ext",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}