すべてのプロダクト
Search
ドキュメントセンター

Alibaba Cloud Model Studio:Wan - text-to-video API reference

最終更新日:Dec 17, 2025

Wan テキスト動画生成モデルは、テキストプロンプトに基づいてスムーズな動画を生成します。以下の機能をサポートしています:

  • 基本機能:動画の長さ (5 秒、10 秒、または 15 秒) の選択、動画の解像度 (480P、720P、または 1080P) の指定、プロンプトのインテリジェントな書き換えの有効化、ウォーターマークの追加が可能です。

  • オーディオ機能:自動吹き替え、またはカスタムオーディオファイルを使用した音声と映像の同期をサポートします。(wan2.5 および wan2.6 でサポート)

  • マルチショットナラティブ:ショットが切り替わっても主題の一貫性を維持しながら、複数のショットを持つ動画の生成をサポートします。(wan2.6 のみでサポート)

クイックリンク:Wan 公式サイトでオンラインで試す

説明

Wan 公式サイトの機能は、API がサポートする機能と異なる場合があります。このドキュメントでは、API の実際の機能について説明しており、新機能がリリースされるたびに更新されます。

モデル概要

入力例

出力動画 (wan2.5)

入力プロンプト:ローアングルからの撮影、ミディアムクローズアップ、暖かい色調、混合照明 (デスクランプからの実用光が窓からの曇り空の光と混ざり合う)、サイドライティング、中央構図。クラシックな探偵事務所で、木製の本棚には古い事件ファイルと灰皿が詰まっています。緑色のデスクランプが、机の中央に広げられた事件ファイルを照らしています。ダークブラウンのトレンチコートとライトグレーのフェドーラ帽をかぶったキツネが革張りの椅子に座っており、その毛皮は深紅色で、尻尾は軽く端にかかり、指は黄ばんだページをゆっくりとめくっています。外では、青い空の下で霧雨が降り続き、ガラスに曲がりくねった筋を残しています。彼はゆっくりと頭を上げ、耳をわずかにひくつかせ、琥珀色の瞳でカメラをまっすぐに見つめ、滑らかで皮肉な声で「事件は冷え切っていた、冬の魚よりも冷たく。だが、どんな鶏にも秘密はある。そして私は、それを見つけ出すつもりだった」と口をはっきりと動かして話します。

入力オーディオ

前提条件

呼び出しを行う前に、API キーを取得し、API キーを環境変数として設定してください。SDK を使用して呼び出しを行うには、DashScope SDK をインストールしてください。

重要

中国 (北京) とシンガポールのリージョンでは、API キーリクエストエンドポイントが異なります。これらを相互に交換して使用しないでください。リージョンをまたいだ呼び出しは、認証失敗やサービスエラーの原因となります。

HTTP 呼び出し

テキスト動画生成タスクは完了までに時間がかかるため (通常 1〜5 分)、API は非同期呼び出しを使用します。プロセスには、タスクの作成 -> 結果のポーリングという 2 つのコアステップが含まれます。手順は以下の通りです:

所要時間は、キュー内のタスク数とサービスの実行状況によって異なります。結果が得られるまで、しばらくお待ちください。

ステップ 1:タスクを作成してタスク ID を取得

シンガポールPOST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

中国 (北京)POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

説明
  • タスクが作成された後、返された task_id を使用して結果をクエリします。task_id の有効期間は 24 時間です。重複したタスクを作成しないでください。ポーリングを使用して結果を取得してください。

リクエストパラメーター

マルチショットナラティブ

この機能は wan2.6-t2v モデルでのみサポートされています。

# 注:中国 (北京) リージョンのモデルを使用する場合、URL を https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis に置き換えてください
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.6-t2v",
    "input": {
        "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them \""
    },
    "parameters": {
        "size": "1280*720",
        "prompt_extend": true,
        "duration": 10,
        "audio": true,
        "shot_type":"multi"
    }
}'

自動吹き替え

この機能は wan2.5 以降のモデルでのみサポートされています。

自動吹き替え機能はデフォルトで有効になっているため、設定は不要です。この設定を明示的に宣言するには、parameters.audio パラメーターを true に設定します。

# 注:中国本土 (北京) リージョンのモデルを使用する場合、URL を https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis に置き換えてください
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.5-t2v-preview",
    "input": {
        "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them \""
    },
    "parameters": {
        "size": "832*480",
        "prompt_extend": true,
        "duration": 10,
        "audio": true
    }
}'

オーディオファイルの使用

この機能は wan2.5 以降のモデルでのみサポートされています。

input.audio_url パラメーターを使用して、カスタムオーディオファイルの URL を渡します。

# 注:中国本土 (北京) リージョンのモデルを使用する場合、URL を https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis に置き換えてください
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.5-t2v-preview",
    "input": {
        "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them \".",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3"
    },
    "parameters": {
        "size": "832*480",
        "prompt_extend": true,
        "duration": 10
    }
}'

無音動画の生成

パラメーター設定はモデルのバージョンによって異なります:

  • wan2.5 以降のモデルでは、parameters.audio パラメーターを明示的に false に設定する必要があります。

  • wan2.2 以前のモデルでは、デフォルトで無音動画が生成されます。パラメーターを設定する必要はありません。詳細については、以下のコードブロックをご参照ください。

# 注:中国 (北京) リージョンのモデルを使用する場合、URL を https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis に置き換えてください
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.2-t2v-plus",
    "input": {
        "prompt": "Low contrast, in a retro 70s-style subway station, a street musician plays amidst dim colors and rough textures. He wears an old-style jacket, holds a guitar, and plays with concentration. Commuters hurry past, and a small crowd gradually gathers to listen. The camera slowly moves to the right, capturing the scene where the sound of the instrument intertwines with the hustle and bustle, with old-fashioned subway signs and mottled walls in the background."
    },
    "parameters": {
        "size": "832*480",
        "prompt_extend": true
    }
}'

ネガティブプロンプトの使用

`negative_prompt` パラメーターを使用して、「花」などの要素が動画に表示されないように除外できます。

# 注:中国 (北京) リージョンのモデルを使用する場合、URL を https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis に置き換えてください
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.2-t2v-plus",
    "input": {
        "prompt": "A kitten running in the moonlight",
        "negative_prompt": "flowers"
    },
    "parameters": {
        "size": "832*480"
    }
}'
ヘッダー

Content-Type string (必須)

リクエストのコンテントタイプ。このパラメーターを application/json に設定します。

Authorization string (必須)

リクエストの身分認証情報。この API は、Model Studio API キーを使用して身分認証を行います。例:Bearer sk-xxxx。

X-DashScope-Async string (必須)

非同期処理の設定パラメーター。HTTP リクエストは非同期処理のみをサポートします。このパラメーターを enable に設定する必要があります。

重要

このリクエストヘッダーがない場合、「current user api does not support synchronous calls」というエラーメッセージが返されます。

リクエストボディ

model string (必須)

モデル名。利用可能なモデルとその料金については、「モデル料金」をご参照ください。

例:wan2.5-t2v-preview。

input object (必須)

プロンプトなどの基本的な入力情報。

プロパティ

prompt string (必須)

テキストプロンプト。プロンプトは、生成される動画に含めたい要素や視覚的特徴を記述します。

中国語と英語をサポートしています。各漢字またはアルファベットは 1 文字としてカウントされます。制限を超えるテキストは自動的に切り捨てられます。長さの制限はモデルのバージョンによって異なります:

  • wan2.6-t2v:最大 1,500 文字。

  • wan2.5-t2v-preview:最大 1,500 文字。

  • wan2.2 以前のモデル:最大 800 文字。

例:月明かりの中を走る子猫。

プロンプトの使用に関するヒントについては、「テキスト動画生成/画像動画生成プロンプトガイド」をご参照ください。

negative_prompt string (任意)

ネガティブプロンプト。動画に表示したくないコンテンツを記述します。これは動画コンテンツを制約するために使用できます。

中国語と英語をサポートしています。長さは 500 文字に制限されています。制限を超えるテキストは自動的に切り捨てられます。

例:低解像度、エラー、最低品質、低品質、変形、余分な指、悪いプロポーション。

audio_url string (任意)

サポートモデル:wan2.6-t2v、wan2.5-t2v-preview。

オーディオファイルの URL。モデルはこのオーディオを使用して動画を生成します。詳細については、「オーディオパラメーターの設定」をご参照ください。

HTTP および HTTPS プロトコルをサポートしています。

オーディオの制限:

  • フォーマット:wav または mp3。

  • 長さ:3 秒から 30 秒。

  • ファイルサイズ:最大 15 MB。

  • 超過長の処理:オーディオの長さが duration の値 (5 秒または 10 秒) を超える場合、最初の 5 秒または 10 秒のみが使用され、残りは破棄されます。オーディオが動画より短い場合、オーディオの長さを超える動画の部分は無音になります。例えば、オーディオが 3 秒で動画が 5 秒の場合、出力動画の最初の 3 秒には音があり、最後の 2 秒は無音になります。

例:https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/xxx.mp3。

parameters object (任意)

画像編集パラメーター。例えば、動画の解像度の設定、プロンプトのインテリジェントな書き換えの有効化、ウォーターマークの追加などができます。

プロパティ

size string (任意)

重要
  • `size` パラメーターはコストに直接影響します。コストは次のように計算されます:単価 (解像度に基づく) × 長さ (秒)。同じモデルの場合、1080P > 720P > 480P となります。呼び出しを行う前に、モデル料金を確認してください。

  • `size` パラメーターは、1280*720 のような特定の値に設定する必要があります。1:1 のようなアスペクト比や、480P のような解像度レベルには設定できません。

生成される動画の解像度を 幅*高さ のフォーマットで指定します。このパラメーターのデフォルト値と利用可能な列挙値は、`model` パラメーターに依存し、以下のリストで説明されています:

  • wan2.6-t2v:デフォルト値は 1920*1080 (1080P) です。任意の解像度:720P および 1080P に対応するすべての解像度。

  • wan2.5-t2v-preview:デフォルト値は 1920*1080 (1080P) です。任意の解像度:480P、720P、および 1080P に対応するすべての解像度。

  • wan2.2-t2v-plus:デフォルト値は 1920*1080 (1080P) です。任意の解像度:480P および 1080P に対応するすべての解像度。

  • wan2.1-t2v-turbo:デフォルト値は 1280*720 (720P) です。オプションの解像度:480P および 720P に対応するすべての解像度。

  • wan2.1-t2v-plus: デフォルト値は 1280*720 (720P) です。選択可能な解像度は 720P に対応するすべての解像度です。

480P レベル:任意の動画解像度とそれに対応するアスペクト比は次のとおりです:

  • 832*480:16:9。

  • 480*832:9:16。

  • 624*624:1:1。

720P レベル:任意の動画解像度とそれに対応するアスペクト比は次のとおりです:

  • 1280*720:16:9。

  • 720*1280:9:16。

  • 960*960:1:1。

  • 1088*832:4:3。

  • 832*1088:3:4。

1080P レベル:任意の動画解像度とそれに対応するアスペクト比は次のとおりです:

  • 1920*1080:16:9。

  • 1080*1920:9:16。

  • 1440*1440:1:1。

  • 1632*1248:4:3。

  • 1248*1632:3:4。

duration integer (任意)

重要

`duration` パラメーターはコストに直接影響します。コストは次のように計算されます:単価 (解像度に基づく) × 長さ (秒)。呼び出しを行う前に、モデル料金を確認してください。

生成される動画の長さ (秒)。このパラメーターの値は `model` パラメーターに依存します:

  • wan2.6-t2v:任意の価は 5、10、15 です。デフォルト値は 5 です。

  • wan2.5-t2v-preview:任意の価は 5 と 10 です。デフォルト値は 5 です。

  • wan2.2-t2v-plus:5 秒に固定されており、変更できません。

  • wan2.1-t2v-plus: 5 秒で固定されており、変更できません。

  • wan2.1-t2v-turbo: 5 秒に固定されており、変更できません。

例:5。

prompt_extend boolean (任意)

プロンプトの書き換えを有効にするかどうかを指定します。有効にすると、大規模言語モデル (LLM) が入力プロンプトを書き換えます。これにより、短いプロンプトの生成品質が大幅に向上しますが、所要時間が増加します。

  • true (デフォルト)

  • false

例:true。

shot_type string (任意)

サポートモデル:wan2.6-t2v。

生成される動画のショットタイプ、つまり動画が単一の連続したショットで構成されるか、複数の切り替えられたショットで構成されるかを指定します。

このパラメーターは、"prompt_extend" が `true` に設定されている場合にのみ有効です。

パラメーターの優先順位:shot_type > prompt。例えば、shot_type が "single" に設定されている場合、プロンプトがマルチショット動画を要求していても、モデルはシングルショット動画を生成します。

任意の値:

  • single:(デフォルト) シングルショット動画を出力します。

  • multi:マルチショット動画を出力します。

例:single。

説明

このパラメーターを使用して、製品のディスプレイにシングルショットを使用したり、ショートストーリーにマルチショットを使用したりするなど、動画の物語構造を厳密に制御します。

audio boolean (任意)

サポートモデル:wan2.6-t2v、wan2.5-t2v-preview。

生成される動画に自動的にオーディオを追加するかどうかを指定します。

このパラメーターは、`audio_url` が提供されていない場合にのみ有効です。

パラメーターの優先順位は audio_url > audio です。詳細については、「オーディオパラメーターの設定」をご参照ください。

任意の値:

  • true:(デフォルト) 自動的にオーディオを追加します。出力は音声付きの動画です。

  • false:オーディオを追加しません。出力は無音動画です。

例:true。

説明

特殊効果のデモや無音アニメーションなど、純粋に視覚的なコンテンツを生成するには、明示的に "audio": false を設定します。カスタムオーディオを使用するには、このパラメーターの代わりに audio_url パラメーターを使用します。

watermark boolean (任意)

ウォーターマークを追加するかどうかを指定します。ウォーターマークには固定テキスト「AI Generated」が含まれ、動画の右下隅に配置されます。

  • false (デフォルト)

  • true:ウォーターマークが追加されます。

例:false。

seed integer (任意)

乱数シード。値は [0, 2147483647] の範囲内である必要があります。

このパラメーターを指定しない場合、システムは自動的にランダムなシードを生成します。結果の再現性を向上させるために、固定のシード値を設定できます。

モデルの生成は確率的であるため、同じシードを使用しても結果が毎回同一であることが保証されるわけではないことにご注意ください。

例:12345。

レスポンスパラメーター

成功レスポンス

task_id を保存して、タスクのステータスと結果をクエリします。

{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

エラーレスポンス

タスクの作成に失敗しました。詳細については、「エラーメッセージ」を参照して問題を解決してください。

{
    "code":"InvalidApiKey",
    "message":"Invalid API-key provided.",
    "request_id":"fb53c4ec-1c12-4fc4-a580-xxxxxx"
}

output object

タスクの出力情報。

プロパティ

task_id string

タスク ID。クエリは 24 時間有効です。

task_status string

タスクステータス。

列挙

  • PENDING

  • RUNNING

  • SUCCEEDED

  • FAILED

  • CANCELED

  • UNKNOWN:タスクが存在しないか、そのステータスを判断できません。

request_id string

一意のリクエスト ID。この ID を使用して問題を追跡およびトラブルシューティングできます。

code string

失敗したリクエストのエラーコード。リクエストが成功した場合、このパラメーターは返されません。詳細については、「エラーメッセージ」をご参照ください。

message string

失敗したリクエストの詳細情報。リクエストが成功した場合、このパラメーターは返されません。詳細については、「エラーメッセージ」をご参照ください。

ステップ 2:タスク ID で結果をクエリ

シンガポールGET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}

中国 (北京)GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}

説明
  • ポーリングの提案:動画生成には数分かかります。ポーリングメカニズムを使用し、15 秒などの合理的なクエリ間隔を設定して結果を取得してください。

  • タスクステータスの遷移:PENDING → RUNNING → SUCCEEDED または FAILED。

  • 結果リンク:タスクが成功すると、動画リンクが返されます。このリンクは 24 時間有効です。リンクを取得したら、すぐに動画をダウンロードして、Object Storage Service (OSS) などの永続ストレージサービスに保存してください。

  • task_id の有効期間24 時間。この期間を過ぎると、結果をクエリできなくなり、API はタスクステータスとして UNKNOWN を返します。

リクエストパラメーター

タスク結果のクエリ

86ecf553-d340-4e21-xxxxxxxxx を実際のタスク ID に置き換えてください。

シンガポールと北京リージョンの API キーは異なります。API キーを作成してください。
以下の `base_url` はシンガポールリージョン用です。北京リージョンのモデルについては、`base_url` を `https://dashscope.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx` に置き換えてください。
curl -X GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

ヘッダー

Authorization string (必須)

リクエストの身分認証情報。この API は、Model Studio API キーを使用して身分認証を行います。例:Bearer sk-xxxx。

URL パスパラメーター

task_id string (必須)

タスク ID。

レスポンスパラメーター

タスクの実行成功

動画 URL は 24 時間のみ保持され、この期間が過ぎると自動的にパージされます。生成された動画は速やかに保存する必要があります。

{
    "request_id": "abbf7aa3-9652-4785-a622-xxxxxx",
    "output": {
        "task_id": "38513c71-5190-48e1-9f3b-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2025-09-29 14:05:22.119",
        "scheduled_time": "2025-09-29 14:05:28.278",
        "end_time": "2025-09-29 14:10:00.437",
        "orig_prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '。",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
    },
    "usage": {
        "duration": 10,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "video_count": 1,
        "SR": 720
    }
}

タスクの実行失敗

タスクが失敗した場合、task_status は FAILED に設定され、エラーコードとメッセージが提供されます。詳細については、「エラーメッセージ」を参照して問題を解決してください。

{
    "request_id": "e5d70b02-ebd3-98ce-9fe8-759d7d7b107d",
    "output": {
        "task_id": "86ecf553-d340-4e21-af6e-a0c6a421c010",
        "task_status": "FAILED",
        "code": "InvalidParameter",
        "message": "The size is not match xxxxxx"
    }
}

タスククエリの期限切れ

task_id は 24 時間有効です。この期間を過ぎると、クエリは失敗し、以下のエラーメッセージが返されます。

{
    "request_id": "a4de7c32-7057-9f82-8581-xxxxxx",
    "output": {
        "task_id": "502a00b1-19d9-4839-a82f-xxxxxx",
        "task_status": "UNKNOWN"
    }
}

output object

タスクの出力情報。

プロパティ

task_id string (必須)

タスク ID。

task_status string

タスクステータス。

列挙

  • PENDING

  • RUNNING

  • SUCCEEDED

  • FAILED

  • CANCELED

  • UNKNOWN:タスクが存在しないか、そのステータスを判断できません。

submit_time string

タスクが送信された時刻。時刻は UTC+8 タイムゾーンです。フォーマットは YYYY-MM-DD HH:mm:ss.SSS です。

scheduled_time string

タスクが実行を開始した時刻。時刻は UTC+8 タイムゾーンです。フォーマットは YYYY-MM-DD HH:mm:ss.SSS です。

end_time string

タスクが完了した時刻。時刻は UTC+8 タイムゾーンです。フォーマットは YYYY-MM-DD HH:mm:ss.SSS です。

video_url string

動画 URL。このパラメーターは、task_status が SUCCEEDED の場合にのみ返されます。

リンクは 24 時間有効です。この URL を使用して動画をダウンロードできます。動画は H.264 エンコーディングの MP4 フォーマットです。

orig_prompt string

元の入力プロンプト。これは prompt リクエストパラメーターに対応します。

actual_prompt string

prompt_extend=true の場合、システムは入力プロンプトを自動的に書き換えます。このフィールドは、生成に使用される最適化されたプロンプトを返します。

  • prompt_extend=false の場合、このフィールドは返されません。

  • 注:wan2.6 モデルは、prompt_extend の値に関係なく、このフィールドを返しません。

code string

失敗したリクエストのエラーコード。リクエストが成功した場合、このパラメーターは返されません。詳細については、「エラーメッセージ」をご参照ください。

message string

失敗したリクエストの詳細情報。リクエストが成功した場合、このパラメーターは返されません。詳細については、「エラーメッセージ」をご参照ください。

usage object

出力情報の統計。成功した結果のみがカウントされます。

プロパティ

video_duration integer

このパラメーターは、wan2.5 以前のモデルでのみ返され、課金に使用されます。

生成された動画の長さ (秒)。可能な値は 5 と 10 です。

input_video_duration integer

このパラメーターは wan2.6 モデルでのみ返されます。値は 0 に固定されています。

output_video_duration integer

このパラメーターは wan2.6 モデルでのみ返されます。

出力動画の長さ (秒)。その値は input.duration の値と同じです。

duration float

このパラメーターは wan2.6 モデルでのみ返され、課金に使用されます。

合計動画時間を示し、duration=input_video_duration+output_video_duration となります。

SR integer

このパラメーターは wan2.6 モデルでのみ返されます。生成された動画の解像度レベルを示します。例:720。

video_ratio string

生成された動画の解像度。その値は parameters.size の値と同じです。

フォーマットは「幅*高さ」です。例:1920*1080。

video_count integer

生成された動画の数。この値は 1 に固定されています。

request_id string

一意のリクエスト ID。この ID を使用して問題を追跡およびトラブルシューティングできます。

DashScope SDK

SDK のパラメーター名は、ほとんどが HTTP API と一致しています。パラメーター構造は、各プログラミング言語の機能に基づいてカプセル化されています。

テキスト動画生成タスクは完了までに時間がかかるため (通常 1〜5 分)、SDK は下層で HTTP 非同期呼び出しプロセスをカプセル化し、同期呼び出しと非同期呼び出しの両方のメソッドをサポートしています。

所要時間は、キュー内のタスク数とサービスの実行状況によって異なります。結果が得られるまで、しばらくお待ちください。

Python SDK

重要
  • wan2.6-t2v モデルは SDK 呼び出しをサポートしていません。

  • 以下のコードを実行する前に、DashScope Python SDK のバージョンが 1.25.2 以降であることを確認してください。

    SDK のバージョンが古すぎると、「url error, please check url!」などのエラーが発生する可能性があります。詳細については、「SDK のインストール」を参照して SDK を更新してください。

同期呼び出し

リクエスト例
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# 中国 (北京) リージョンのモデルを使用する場合は、URL を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください:api_key="sk-xxx"
# シンガポールと北京リージョンの API キーは異なります。API キーの取得:https://www.alibabacloud.com/help/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_sync_call_t2v():
    # 同期 API を呼び出し、結果を返します
    print('please wait...')
    rsp = VideoSynthesis.call(api_key=api_key,
                              model='wan2.5-t2v-preview',
                              prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
                              audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
                              size='832*480',
                              duration=10,
                              negative_prompt="",
                              # audio=True,
                              prompt_extend=True,
                              watermark=False,
                              seed=12345)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_sync_call_t2v()
レスポンス例
video_url は 24 時間有効です。動画は速やかにダウンロードしてください。
{
    "status_code": 200,
    "request_id": "167f3beb-3dd0-47fe-a83c-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "5b65411f-d946-4e29-859e-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
        "submit_time": "2025-10-23 11:47:23.879",
        "scheduled_time": "2025-10-23 11:47:34.351",
        "end_time": "2025-10-23 11:52:35.323",
        "orig_prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '。",
        "actual_prompt": "Low-angle shot, medium close-up, warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its crimson fur contrasting with the dimly lit room. Its tail rests lightly on the edge of the chair, and its fingers slowly turn yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. The fox slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera. Its mouth clearly moves as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them.\""
    },
    "usage": {
        "video_count": 1,
        "video_duration": 10,
        "video_ratio": "832*480"
    }
}

非同期呼び出し

リクエスト例
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# 中国 (北京) リージョンのモデルを使用する場合は、URL を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください:api_key="sk-xxx"
# シンガポールと北京リージョンの API キーは異なります。API キーの取得:https://www.alibabacloud.com/help/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
    # 非同期 API を呼び出し、タスク情報を返します
    # 返されたタスク ID でタスクステータスを取得できます
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan2.5-t2v-preview',
                                    prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
                                    audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
                                    size='832*480',
                                    duration=10,
                                    negative_prompt="",
                                    # audio=True,
                                    prompt_extend=True,
                                    watermark=False,
                                    seed=12345)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print("task_id: %s" % rsp.output.task_id)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))
                           
    # タスクステータスを含むタスク情報を取得します
    status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
    if status.status_code == HTTPStatus.OK:
        print(status.output.task_status)  # タスクステータスを確認します
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (status.status_code, status.code, status.message))

    # タスクが完了するのを待ち、定期的に fetch を呼び出して完了ステータスを確認します
    rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_async_call_t2v()
レスポンス例

1. タスク作成のレスポンス例

{
	"status_code": 200,
	"request_id": "c86ff7ba-8377-917a-90ed-xxxxxx",
	"code": "",
	"message": "",
	"output": {
		"task_id": "721164c6-8619-4a35-a6d9-xxxxxx",
		"task_status": "PENDING",
		"video_url": ""
	},
	"usage": null
}

2. タスク結果クエリのレスポンス例

video_url は 24 時間有効です。動画は速やかにダウンロードしてください。
{
    "status_code": 200,
    "request_id": "167f3beb-3dd0-47fe-a83c-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "5b65411f-d946-4e29-859e-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
        "submit_time": "2025-10-23 11:47:23.879",
        "scheduled_time": "2025-10-23 11:47:34.351",
        "end_time": "2025-10-23 11:52:35.323",
        "orig_prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '。",
        "actual_prompt": "Low-angle shot, medium close-up, warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its crimson fur contrasting with the dimly lit room. Its tail rests lightly on the edge of the chair, and its fingers slowly turn yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. The fox slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera. Its mouth clearly moves as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them.\""
    },
    "usage": {
        "video_count": 1,
        "video_duration": 10,
        "video_ratio": "832*480"
    }
}

Java SDK

重要
  • wan2.6-t2v モデルは SDK 呼び出しをサポートしていません。

  • 以下のコードを実行する前に、DashScope Java SDK のバージョンが 2.22.2 以降であることを確認してください。

    バージョンが古すぎると、「url error, please check url!」などのエラーが発生する可能性があります。詳細については、「SDK のインストール」を参照して更新してください。

同期呼び出し

リクエスト例
// Copyright (c) Alibaba, Inc. and its affiliates.

// dashscope sdk >= 2.18.2
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

import java.util.HashMap;
import java.util.Map;

public class Text2Video {
    /**
     * 動画合成タスクを作成し、タスクが完了するのを待ちます。
     */
    static {
     Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
     // 中国 (北京) リージョンのモデルを使用する場合は、URL を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
    }
    
    // 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください:api_key="sk-xxx"
    // シンガポールと北京リージョンの API キーは異なります。API キーの取得:https://www.alibabacloud.com/help/model-studio/get-api-key
    public static String apiKey = System.getenv("DASHSCOPE_API_KEY");


    public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);
        parameters.put("watermark", false);
        parameters.put("seed", 12345);

        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.5-t2v-preview")
                        .prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
                        .audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
                        .negativePrompt("")
                        .size("832*480")
                        .duration(10)
                        // .audio(true)
                        .parameters(parameters)
                        .build();
        System.out.println("please wait...");
        VideoSynthesisResult result = vs.call(param);
        System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
        try {
            text2Video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
レスポンス例
video_url は 24 時間有効です。動画は速やかにダウンロードしてください。
{
    "request_id": "4e9aab26-c50b-4ea7-b2c0-xxxxxx",
    "output": {
        "task_id": "9e0fc846-ee92-42ac-af42-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
    },
    "usage": {
        "video_count": 1,
        "video_duration": 10,
        "video_ratio": "832*480"
    }
}

非同期呼び出し

リクエスト例
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisListResult;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

import java.util.HashMap;
import java.util.Map;

public class Text2Video {
    /**
     * 動画合成タスクを作成し、タスクが完了するのを待ちます。
     */
    static {
        // 中国 (北京) リージョンのモデルを使用する場合は、URL を https://dashscope.aliyuncs.com/api/v1 に置き換えてください
        Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
    }

     // 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください:api_key="sk-xxx"
    // シンガポールと北京リージョンの API キーは異なります。API キーの取得:https://www.alibabacloud.com/help/model-studio/get-api-key
    public static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);
        parameters.put("watermark", false);
        parameters.put("seed", 12345);

        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.5-t2v-preview")
                        .prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
                        .audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
                        .negativePrompt("")
                        .size("832*480")
                        .duration(10)
                        // .audio(true)
                        .parameters(parameters)
                        .build();

        // 非同期呼び出し
        VideoSynthesisResult task = vs.asyncCall(param);
        System.out.println(JsonUtils.toJson(task));
        System.out.println("please wait...");

        // 結果の取得
        VideoSynthesisResult result = vs.wait(task, apiKey);
        System.out.println(JsonUtils.toJson(result));
    }

     // タスクリストの取得
    public static void listTask() throws ApiException, NoApiKeyException {
        VideoSynthesis is = new VideoSynthesis();
        AsyncTaskListParam param = AsyncTaskListParam.builder().build();
        param.setApiKey(apiKey);
        VideoSynthesisListResult result = is.list(param);
        System.out.println(result);
    }

    // 単一タスクの結果を取得
    public static void fetchTask(String taskId) throws ApiException, NoApiKeyException {
        VideoSynthesis is = new VideoSynthesis();
        // DASHSCOPE_API_KEY が環境変数として設定されている場合、apiKey は null にできます
        VideoSynthesisResult result = is.fetch(taskId, apiKey);
        System.out.println(result.getOutput());
        System.out.println(result.getUsage());
    }

    public static void main(String[] args) {
        try {
            text2Video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
レスポンス例

1. タスク作成のレスポンス例。

{
        "request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
	"output": {
		"task_id": "7277e20e-aa01-4709-xxxxxxxx",
		"task_status": "PENDING"
	}
}

2. タスク結果クエリのレスポンス例

video_url は 24 時間有効です。動画は速やかにダウンロードしてください。
{
    "request_id": "4e9aab26-c50b-4ea7-b2c0-xxxxxx",
    "output": {
        "task_id": "9e0fc846-ee92-42ac-af42-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
    },
    "usage": {
        "video_count": 1,
        "video_duration": 10,
        "video_ratio": "832*480"
    }
}

制限事項

  • データの有効期間:task_id と動画 URL は 24 時間のみ保持されます。この期間を過ぎると、クエリやダウンロードはできなくなります。

  • オーディオサポート:wan2.5 モデルは音声付き動画 (自動吹き替えまたはカスタムオーディオアップロード) をサポートしています。wan2.2 以前のバージョンは無音動画のみを出力します。必要に応じて、音声合成を使用してオーディオを生成できます。

  • Content Moderation:入力プロンプトと出力動画は Content Moderation の対象となります。非準拠コンテンツを含むリクエストは、「IPInfringementSuspect」または「DataInspectionFailed」エラーになります。詳細については、「エラーメッセージ」をご参照ください。

  • ネットワークアクセス設定:動画リンクは Object Storage Service (OSS) に保存されます。セキュリティポリシーのために業務システムが外部の OSS リンクにアクセスできない場合は、以下の OSS ドメイン名をネットワークアクセスホワイトリストに追加する必要があります。

    # OSS ドメイン名リスト
    dashscope-result-bj.oss-cn-beijing.aliyuncs.com
    dashscope-result-hz.oss-cn-hangzhou.aliyuncs.com
    dashscope-result-sh.oss-cn-shanghai.aliyuncs.com
    dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com
    dashscope-result-zjk.oss-cn-zhangjiakou.aliyuncs.com
    dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com
    dashscope-result-hy.oss-cn-heyuan.aliyuncs.com
    dashscope-result-cd.oss-cn-chengdu.aliyuncs.com
    dashscope-result-gz.oss-cn-guangzhou.aliyuncs.com
    dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com

主要なパラメーターの説明

オーディオパラメーターの設定

サポートモデル:wan2.6-t2v、wan2.5-t2v-preview。

オーディオ設定input.audio_urlparameters.audio パラメーターを使用してオーディオの動作を制御できます。優先順位:audio_url > audio。3 つのモードがサポートされています:

  1. 無音動画の生成

    1. パラメーター設定:`audio_url` を渡さず、`audio` を `false` に設定します。

    2. シナリオ:このモードは、後でオーディオや音楽を追加する予定の純粋に視覚的なコンテンツ向けです。

  2. オーディオの自動生成

    1. パラメーター設定:`audio_url` を渡さず、`audio` を `true` に設定します。

    2. 効果の説明:モデルは、プロンプトと動画コンテンツに基づいて、一致するバックグラウンドオーディオまたは音楽を自動的に生成します。

  3. カスタムオーディオの使用

    1. パラメーター設定:`audio_url` を渡します。`audio` パラメーターは無視されます。

    2. 効果の説明:動画コンテンツは、唇の動きやリズムなど、オーディオコンテンツと一致するように試みます。

課金とレート制限

  • 無料クォータと単価については、「モデル」をご参照ください。

  • レート制限については、「Wan シリーズ」をご参照ください。

  • 課金の説明:

    • 課金は、正常に生成された動画の秒単位の長さに基づいて行われます。クエリ結果 API が task_status として SUCCEEDED を返し、動画が正常に生成された場合にのみ課金されます。

    • モデル呼び出しの失敗や処理エラーに対しては料金は発生せず、無料クォータも消費されません。

エラーコード

呼び出しが失敗した場合は、「エラーメッセージ」を参照してトラブルシューティングを行ってください。

よくある質問

Q:モデルの呼び出し回数を確認するにはどうすればよいですか?

A: モデルの呼び出しが完了してから 1 時間後、[モデルの監視 (シンガポール)][モデルの監視 (北京)] ページに移動して、モデルの呼び出し回数や成功率などのメトリックを表示できます。詳細については、「モデル呼び出しレコードの表示方法」をご参照ください。

Q:一時的な動画リンクを永続的なものに変換するにはどうすればよいですか?

A:リンクを直接変換することはできません。正しい方法は、バックエンドサービスが URL を使用して動画ファイルをダウンロードし、それを Alibaba Cloud OSS などの永続的なオブジェクトストレージサービスにアップロードして、新しい永続的なアクセスリンクを生成することです。

コード例:動画をローカルパスにダウンロード

import requests

def download_and_save_video(video_url, save_path):
    try:
        response = requests.get(video_url, stream=True, timeout=300) # タイムアウトを設定
        response.raise_for_status() # HTTP ステータスコードが 200 でない場合に例外を発生させる
        with open(save_path, 'wb') as f:
            for chunk in response.iter_content(chunk_size=8192):
                f.write(chunk)
        print(f"動画が正常にダウンロードされました:{save_path}")
        # 永続ストレージにアップロードするロジックをここに追加できます
    except requests.exceptions.RequestException as e:
        print(f"動画のダウンロードに失敗しました:{e}")

if __name__ == '__main__':
    video_url = "http://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxxx"
    save_path = "video.mp4"
    download_and_save_video(video_url, save_path)

Q:返された動画リンクはブラウザで直接再生できますか?

A:リンクは 24 時間後に期限切れになるため、推奨されません。推奨されるベストプラクティスは、バックエンドで動画をダウンロードして保存し、再生には永続的なリンクを使用することです。