Wan 3.0 オールインワン動画生成
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"ratio": "<string>",
"resolution": "<string>",
"audio": true,
"watermark": true,
"seed": 123,
"image_with_roles": [
{}
],
"reference_images": [
"<string>"
],
"video_list": [
{}
],
"audio_with_roles": [
{}
],
"metadata": {}
}
'import requests
url = "https://toapis.com/v1/videos/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"ratio": "<string>",
"resolution": "<string>",
"audio": True,
"watermark": True,
"seed": 123,
"image_with_roles": [{}],
"reference_images": ["<string>"],
"video_list": [{}],
"audio_with_roles": [{}],
"metadata": {}
}
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>',
duration: 123,
ratio: '<string>',
resolution: '<string>',
audio: true,
watermark: true,
seed: 123,
image_with_roles: [{}],
reference_images: ['<string>'],
video_list: [{}],
audio_with_roles: [{}],
metadata: {}
})
};
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>',
'duration' => 123,
'ratio' => '<string>',
'resolution' => '<string>',
'audio' => true,
'watermark' => true,
'seed' => 123,
'image_with_roles' => [
[
]
],
'reference_images' => [
'<string>'
],
'video_list' => [
[
]
],
'audio_with_roles' => [
[
]
],
'metadata' => [
]
]),
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 \"duration\": 123,\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"audio\": true,\n \"watermark\": true,\n \"seed\": 123,\n \"image_with_roles\": [\n {}\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_list\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"metadata\": {}\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 \"duration\": 123,\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"audio\": true,\n \"watermark\": true,\n \"seed\": 123,\n \"image_with_roles\": [\n {}\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_list\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"metadata\": {}\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 \"duration\": 123,\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"audio\": true,\n \"watermark\": true,\n \"seed\": 123,\n \"image_with_roles\": [\n {}\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_list\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "wan3.0-video",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
Wan 3.0
Wan 3.0 オールインワン動画生成
Wan 3.0 All-in-One モデルで動画を生成 — テキストから動画、最初/最後フレーム制御、画像・動画・音声などのマルチモーダル参照に対応
POST
/
v1
/
videos
/
generations
Wan 3.0 オールインワン動画生成
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"ratio": "<string>",
"resolution": "<string>",
"audio": true,
"watermark": true,
"seed": 123,
"image_with_roles": [
{}
],
"reference_images": [
"<string>"
],
"video_list": [
{}
],
"audio_with_roles": [
{}
],
"metadata": {}
}
'import requests
url = "https://toapis.com/v1/videos/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"ratio": "<string>",
"resolution": "<string>",
"audio": True,
"watermark": True,
"seed": 123,
"image_with_roles": [{}],
"reference_images": ["<string>"],
"video_list": [{}],
"audio_with_roles": [{}],
"metadata": {}
}
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>',
duration: 123,
ratio: '<string>',
resolution: '<string>',
audio: true,
watermark: true,
seed: 123,
image_with_roles: [{}],
reference_images: ['<string>'],
video_list: [{}],
audio_with_roles: [{}],
metadata: {}
})
};
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>',
'duration' => 123,
'ratio' => '<string>',
'resolution' => '<string>',
'audio' => true,
'watermark' => true,
'seed' => 123,
'image_with_roles' => [
[
]
],
'reference_images' => [
'<string>'
],
'video_list' => [
[
]
],
'audio_with_roles' => [
[
]
],
'metadata' => [
]
]),
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 \"duration\": 123,\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"audio\": true,\n \"watermark\": true,\n \"seed\": 123,\n \"image_with_roles\": [\n {}\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_list\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"metadata\": {}\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 \"duration\": 123,\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"audio\": true,\n \"watermark\": true,\n \"seed\": 123,\n \"image_with_roles\": [\n {}\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_list\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"metadata\": {}\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 \"duration\": 123,\n \"ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"audio\": true,\n \"watermark\": true,\n \"seed\": 123,\n \"image_with_roles\": [\n {}\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"video_list\": [\n {}\n ],\n \"audio_with_roles\": [\n {}\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "wan3.0-video",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
中国本土のユーザー向け: 中国本土のユーザーは
https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。wan3.0-video です。1つのモデルで以下の生成方式をサポートします:
- テキストから動画生成
- 最初フレームまたは最初/最後フレーム制御
- 参照画像・参照動画・参照音声の組み合わせ生成
- ファイルまたは公開 Web ページの参照
最初/最後フレームモードと参照素材モードは併用できません。リクエストに
first_frame または last_frame が含まれる場合、参照画像・参照動画・参照音声・ファイル・Web リンクを同時に渡すことはできません。参照画像・参照動画・参照音声同士は組み合わせて使用できます。認証
string
必須
Bearer Token 認証を使用します:
Authorization: Bearer YOUR_API_KEY
リクエストパラメータ
string
デフォルト:"wan3.0-video"
必須
モデル名。
wan3.0-video 固定です。string
動画の内容、被写体の動作、カメラワーク、音声の説明。
prompt とメディア素材の少なくとも一方を指定する必要があります。マルチモーダル参照を使用する場合、配列の順序に合わせてプロンプトに「画像1」「動画1」「音声1」と記述できます。integer
デフォルト:"5"
出力時間。
2 〜 30 秒をサポートします。-1 を指定するとスマート時間モードになり、モデルがプロンプトと素材に応じて出力の長さを自動決定します。string
デフォルト:"adaptive"
出力アスペクト比。以下をサポートします:
adaptive:参照素材に応じて自動調整16:99:161:14:33:4
aspect_ratio も使用できます。両方を同時に渡す必要はありません。string
デフォルト:"1080p"
出力解像度。
480p、720p、1080p をサポートします。boolean
デフォルト:true
音声を生成するかどうか。デフォルトで有効です。
boolean
デフォルト:false
ウォーターマークを追加するかどうか。デフォルトで無効です。
integer
オプションの乱数シード。同じパラメータとシードで類似した結果を再現しやすくなります。
object[]
最初/最後フレーム制御の配列。各項目には以下が含まれます:
url:公開アクセス可能な画像 URLrole:first_frameまたはlast_frame
last_frame を使用する場合は first_frame も必ず指定してください。string[]
参照画像 URL の配列。最大
10 枚。image_with_roles の最初/最後フレームと併用できません。object[]
参照動画の配列。最大
5 本、合計 15 秒以内。各項目は以下の構造を使用します:{
"video_url": "https://example.com/reference.mp4"
}
object[]
参照音声の配列。最大
5 本、合計 15 秒以内。各項目には以下が含まれます:url:公開アクセス可能な音声 URLrole:reference_audio固定
object
ファイルまたは Web ページの参照は
metadata.media で渡します。表示 metadata.media 構造を展開
表示 metadata.media 構造を展開
media はオブジェクトの配列で、各項目に type と url が含まれます:- ファイル:
{ "type": "file", "url": "https://example.com/brief.pdf" } - Web ページ:
{ "type": "link", "url": "https://example.com/article" }
ローカルの画像や動画は、事前にアップロードして公開 URL を取得してください。生成リクエストにローカルファイルパスや base64 データを直接渡さないでください。
素材の組み合わせルール
| リクエスト内容 | 対応 | 説明 |
|---|---|---|
| プロンプトのみ | ○ | テキストから動画 |
| 最初フレームのみ | ○ | 最初フレーム制御 |
| 最初フレームと最後フレーム | ○ | 最後フレームは単独で使用不可 |
| 参照画像と参照動画 | ○ | 組み合わせ参照可能 |
| 参照画像・動画・音声 | ○ | 組み合わせ参照可能 |
| 最初フレームと参照動画 | × | 最初/最後フレームモードと参照素材モードは併用不可 |
| 最初/最後フレームと参照画像 | × | 最初/最後フレームモードと参照素材モードは併用不可 |
| ファイルと Web リンク | × | 両者は併用不可 |
Wan 3.0 cannot mix first/last frames with reference assets/files/web pages in the same request.
リクエスト例
テキストから動画
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "雨上がりの東京の街を走る茶トラ猫、映画的なカメラワーク",
"duration": 5,
"ratio": "16:9",
"resolution": "1080p",
"audio": true,
"watermark": false
}'
最初/最後フレームから動画生成
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "カメラが自然に寄り、人物が立った状態から微笑んで手を振る姿へ変化する",
"duration": 8,
"ratio": "adaptive",
"resolution": "1080p",
"image_with_roles": [
{
"url": "https://example.com/first-frame.png",
"role": "first_frame"
},
{
"url": "https://example.com/last-frame.png",
"role": "last_frame"
}
]
}'
参照動画から動画生成
このリクエストではfirst_frame や last_frame を同時に渡さないでください。
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "動画1のカメラワークと人物の動きを参考に、新しいストリートダンス動画を生成",
"duration": 10,
"ratio": "adaptive",
"resolution": "720p",
"audio": true,
"video_list": [
{
"video_url": "https://example.com/reference-video.mp4"
}
]
}'
画像・動画・音声の組み合わせ参照
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "画像1のキャラクター、動画1の動き、音声1のリズムを使って動画を生成",
"duration": 10,
"ratio": "16:9",
"resolution": "720p",
"audio": true,
"reference_images": [
"https://example.com/character.png"
],
"video_list": [
{
"video_url": "https://example.com/motion.mp4"
}
],
"audio_with_roles": [
{
"url": "https://example.com/music.mp3",
"role": "reference_audio"
}
]
}'
ファイル参照
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "ファイルの内容に基づいて簡潔な製品紹介動画を生成",
"duration": 10,
"ratio": "16:9",
"resolution": "1080p",
"metadata": {
"media": [
{
"type": "file",
"url": "https://example.com/product-brief.pdf"
}
]
}
}'
レスポンス
string
動画タスク ID。タスクステータスの照会に使用します。
string
オブジェクトタイプ。通常は
generation.task です。string
このリクエストで使用されたモデル名。
string
タスクステータス:
queued、in_progress、completed、または failed。integer
タスクの進捗。
0 〜 100 の範囲。integer
タスク作成タイムスタンプ。
{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "wan3.0-video",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}