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

Alibaba Cloud Model Studio:Wan - テキスト動画生成 API リファレンス (2.1-2.6)

最終更新日:Sep 02, 2026

Wan テキスト動画生成モデルは、 テキストプロンプト からスムーズな動画を生成します。

リファレンス: ユーザーガイド

利用可能リージョン

呼び出しを成功させるには、モデル、エンドポイント URL、API キーがすべて同じリージョンに属している必要があります。リージョン間の呼び出しは失敗します。

注記このトピックのサンプルコードは、シンガポールリージョンに適用されます。

重要Alibaba Cloud Model Studio は、中国 (北京) およびシンガポールリージョン向けにワークスペース専用ドメインをリリースしました。新しい専用ドメインは、推論リクエストに対して優れたパフォーマンスと高い安定性を提供します。新しいドメインへの移行を推奨します:

  • 中国 (北京): https://dashscope.aliyuncs.com から https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com へ
  • シンガポール: https://dashscope-intl.aliyuncs.com から https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com へ

{WorkspaceId} は、Alibaba Cloud Model Studio コンソールの [ワークスペース詳細] ページで確認できるワークスペース ID です。既存のドメインも引き続き完全に機能します。

HTTP

重要この API はレガシープロトコルを使用し、wan2.6 およびそれ以前のモデル (wan2.5/wan2.2/wan2.1) をサポートします。

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

ステップ 1:タスクを作成し、タスク ID を取得する

シンガポール

POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

米国 (バージニア)

POST https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

フランクフルト

POST https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

北京

POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

注記

  • タスクが作成された後、返された task_id を使用して結果をクエリします。task_id は 24 時間有効です。重複したタスクを作成しないでください。代わりに、ポーリングを使用して結果を取得してください。
  • 初心者向けのガイダンスについては、「Postman または cURL を使用した API の呼び出し」をご参照ください。

リクエストパラメーター

リクエストヘッダー

Content-Type string (必須)

リクエストのコンテンツタイプです。application/json である必要があります。

Authorization string (必須)

Model Studio API キーでリクエストを認証します。例:Bearer sk-xxxx。

X-DashScope-Async string (必須)

非同期処理を有効にします。HTTP リクエストは非同期呼び出しのみをサポートします。enable である必要があります。

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

リクエストボディ

model string (必須)

使用するモデルの名前です。利用可能なモデルのリストについては、「モデルリスト」をご参照ください。

例:wan2.6-t2v。

input object (必須)

プロンプトなどの基本的な入力情報を含みます。

プロパティ

prompt string (必須)

テキストプロンプトです。生成される動画の望ましい要素と視覚的特徴を記述します。

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

  • wan2.6 および wan2.5 シリーズモデル:最大 1,500 文字。
  • wan2.2 および wan2.1 シリーズモデル:最大 800 文字。

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

詳細については、「テキスト動画生成/画像動画生成プロンプトガイド」をご参照ください。

negative_prompt string (任意)

動画から除外するコンテンツを記述するプロンプトです。これにより、生成されるコンテンツを洗練させることができます。

プロンプトは中国語または英語で指定できます。最大長は 500 文字です。この制限を超えたテキストは自動的に切り捨てられます。

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

audio_url string (任意)

サポートされているモデル:wan2.6 および wan2.5 シリーズモデル。

音声ファイルの URL です。モデルはこの音声を使用して動画を生成します。

サポートされている入力フォーマット:

  1. パブリック URL:

音声の制限:

  • フォーマット:wav、mp3。
  • 持続時間:3〜30 秒。
  • ファイルサイズ:最大 15 MB。
  • 指定された持続時間を超える音声の処理:音声が duration パラメーターで指定された値 (例:5 秒) よりも長い場合、音声は指定された持続時間に切り捨てられます。音声が動画の持続時間よりも短い場合、動画の残りの部分は無音になります。たとえば、音声が 3 秒で動画が 5 秒の場合、動画の最初の 3 秒には音声があり、最後の 2 秒は無音になります。

parameters object (任意)

動画の解像度の設定、プロンプトリライトの有効化、ウォーターマークの追加など、動画処理パラメーターです。

プロパティ

size string (任意)

重要

  • サイズは課金に直接影響します。呼び出しを行う前に、「モデルの料金」をご確認ください。
  • サイズは、1:1 のようなアスペクト比や 480P のような解像度ティアではなく、1280*720 のような特定の値に設定する必要があります。

生成される動画の解像度を 幅*高さ のフォーマットで指定します。このパラメーターのデフォルト値と有効な値は、以下のように model パラメーターに依存します:

  • wan2.6-t2v:デフォルト値は 1920*1080 (1080P) です。有効な解像度には、720P および 1080P ティアのすべての解像度が含まれます。
  • wan2.6-t2v-us:デフォルト値は 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 (任意)

重要持続時間は課金に直接影響します。コスト = 単価 (解像度に基づく) × 持続時間 (秒単位)。呼び出しを行う前に、「モデルの料金」をご確認ください。

生成される動画の持続時間 (秒単位)。このパラメーターの有効な値は、model パラメーターに依存します:

  • wan2.6-t2v:2〜15 の整数。デフォルト値は 5 です。
  • wan2.6-t2v-us:有効な値は 5 と 10 です。デフォルト値は 5 です。
  • wan2.5-t2v-preview:有効な値は 5 と 10 です。デフォルト値は 5 です。
  • wan2.2-t2v-plus:5 秒に固定されており、変更できません。
  • wan2.1-t2v-plus:5 秒に固定されており、変更できません。
  • wan2.1-t2v-turbo:5 秒に固定されており、変更できません。

prompt_extendboolean (任意)

プロンプトリライトを有効にするかどうかを指定します。有効にすると、モデルは入力プロンプトをインテリジェントに書き換えます。これにより、短いプロンプトで生成される動画の品質が大幅に向上しますが、実行時間は長くなります。

  • true (デフォルト)
  • false

shot_type string (任意)

サポートされているモデル:wan2.6 モデル。

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

有効な値:

  • single:デフォルト値。シングルショット動画を出力します。
  • multi:マルチショット動画を出力します。

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

パラメーターの優先度:shot_type > prompt。たとえば、shot_type が "single" に設定されている場合、プロンプトに "generate a multi-shot video" が含まれていても、モデルはシングルショット動画を出力します。

watermark boolean (任意)

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

  • false (デフォルト)
  • true

seed integer (任意)

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

指定しない場合、ランダムなシードが生成されます。固定シードは再現性を向上させます。

モデルの生成は確率的であるため、同じシードでも同一の結果が保証されるわけではありません。

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

  • マルチショット動画の場合、shot_type は "multi" に設定する必要があります。
  • マルチショット動画の場合、ショット記述の最適化のためにプロンプトリライトを有効にするには、prompt_extend を true に設定する必要があります。

# シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.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 \".",
        "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": "1280*720",
        "prompt_extend": true,
        "duration": 10,
        "shot_type":"multi"
    }
}'

音声ファイルの提供

サポートされているモデル:wan2.6/wan2.5 シリーズモデル。

input.audio_url パラメーターを使用して、カスタム音声ファイルの URL を提供できます。


# シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.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.6/wan2.5 シリーズモデル。

input.audio_url を提供しない場合、モデルは動画コンテンツに基づいて一致する BGM または効果音を自動的に生成します。


# シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.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
    }
}'

無音動画の生成

wan2.2 および wan2.1 シリーズモデルのみが無音動画生成をサポートしています。これらのモデルはデフォルトで無音動画を生成し、追加の設定は不要です。

wan2.6 および wan2.5 シリーズモデルは、デフォルトで音声付きの動画を生成します。


# シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.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-fashioned jacket, holds a guitar, and plays with concentration. Commuters hurry by, 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 city's hustle and bustle, with old-style subway signs and mottled walls in the background."
    },
    "parameters": {
        "size": "832*480",
        "prompt_extend": true
    }
}'

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

サポートされているモデル:すべてのモデル。

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


# シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.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": "flower"
    },
    "parameters": {
        "size": "832*480"
    }
}'

レスポンスパラメーター

output object

タスクの出力情報を含みます。

プロパティ

task_id string

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

task_status string

タスクのステータスです。

列挙値

  • PENDING
  • RUNNING
  • SUCCEEDED
  • FAILED
  • CANCELED
  • UNKNOWN:タスクが存在しないか、ステータスが不明です。

request_id string

トレースとトラブルシューティングのための一意のリクエスト識別子です。

code string

エラーコードです。失敗したリクエストに対してのみ返されます。「エラーコード」をご参照ください。

message string

詳細なエラーメッセージです。失敗したリクエストに対してのみ返されます。「エラーコード」をご参照ください。

成功レスポンス

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": "7438d53d-6eb8-4596-8835-xxxxxx"
}

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

シンガポール

GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

バージニア

GET https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v1/tasks/{task_id}

フランクフルト

GET https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1/tasks/{task_id}

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

北京

GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

注記

  • ポーリングの推奨事項:動画の生成には数分かかります。15 秒などの適切な間隔でポーリングメカニズムを使用してください。
  • タスク状態の遷移:PENDING → RUNNING → SUCCEEDED または FAILED。
  • 結果リンク:タスクが成功すると、24 時間有効な動画 URL が返されます。動画をダウンロードして、OSS などの永続ストレージに保存してください。
  • task_idの有効期間:24 時間。この期間を過ぎると、クエリはタスクステータスを UNKNOWN として返します。

リクエストパラメーター

リクエストヘッダー

Authorization string (必須)

Model Studio API キーでリクエストを認証します。例:Bearer sk-xxxx。

URL パスパラメーター

task_id string (必須)

タスクの ID です。

タスク結果のクエリ

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えてください。task_id は 24 時間クエリに有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

curl -X GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

レスポンスパラメーター

outputobject

タスクの出力情報を含みます。

プロパティ

task_id string

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

task_status string

タスクのステータスです。

列挙値

  • PENDING
  • RUNNING
  • SUCCEEDED
  • FAILED
  • CANCELED
  • UNKNOWN:タスクが存在しないか、ステータスが不明です。
ポーリング中の状態遷移:
  • PENDING → RUNNING → SUCCEEDED または FAILED。
  • 初期クエリのステータスは通常 PENDING または RUNNING です。
  • ステータスが SUCCEEDED に変わると、レスポンスには生成された動画の URL が含まれます。
  • ステータスが FAILED の場合は、エラーメッセージを確認してタスクを再試行してください。

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 時間有効です。動画は MP4 フォーマットで H.264 エンコーディングです。

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 です。

duration float

wan2.6 モデルを使用している場合にのみ返されます。課金に使用されます。

合計動画持続時間を示します。ここで、duration = input_video_duration + output_video_duration です。

input_video_duration integer

wan2.6 モデルを使用している場合にのみ返されます。0 に固定されています。

output_video_duration integer

wan2.6 モデルを使用している場合にのみ返されます。

出力動画の持続時間 (秒単位)。その値は input.duration の値と同じです。

SR integer

wan2.6 モデルを使用している場合にのみ返されます。生成された動画の解像度ティアです。例:720。

size string

wan2.6 モデルを使用している場合にのみ返されます。生成された動画の解像度です。フォーマットは「幅高さ」です。例:19201080。

video_ratio string

wan2.5 およびそれ以前のモデルを使用している場合にのみ返されます。生成された動画の解像度です。フォーマットは「幅高さ」です。例:832480。

video_count integer

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

request_id string

トレースとトラブルシューティングのための一意のリクエスト識別子です。

タスク成功

動画 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"
    }
}

DashScope SDK

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

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

実際の処理時間は、キュー内のタスク数とサービスステータスによって異なります。結果をお待ちください。

Python

重要以下のコードを実行する前に、DashScope Python SDK のバージョンが少なくとも1.25.16 であることを確認してください。

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

モデルが配置されているリージョンに基づいて dashscope.base_http_api_url を設定します:

シンガポール

dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

バージニア

dashscope.base_http_api_url = 'https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v1'

北京

dashscope.base_http_api_url = 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1'

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

フランクフルト

dashscope.base_http_api_url = 'https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1'

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

同期呼び出し

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

# シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。詳細については、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数が設定されていない場合は、ご利用の Model Studio API キーに置き換えてください:api_key="sk-xxx"。
# 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.6-t2v',
                              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='1280*720',
                              duration=10,
                              negative_prompt="",
                              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 '."
    },
    "usage": {
        "video_count": 1,
        "duration": 10,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "SR": 720
    }
}

非同期呼び出し

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

# これはシンガポールリージョンの URL です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。詳細については、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数が設定されていない場合は、ご利用の Model Studio API キーに置き換えてください:api_key="sk-xxx"
# 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.6-t2v',
                                    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='1280*720',
                                    duration=10,
                                    negative_prompt="",
                                    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
}
  1. タスククエリリクエストへのレスポンスの例

動画 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 '."
    },
    "usage": {
        "video_count": 1,
        "duration": 10,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "SR": 720
    }
}

Java

重要以下のコードを実行する前に、DashScope Java ソフトウェア開発キット (SDK) のバージョンが少なくとも2.22.14 であることを確認してください。

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

モデルが配置されているリージョンに基づいて Constants.baseHttpApiUrl を設定します:

シンガポール

Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

バージニア

Constants.baseHttpApiUrl = "https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v1";

北京

Constants.baseHttpApiUrl = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1";

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

フランクフルト

Constants.baseHttpApiUrl = "https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1";

{WorkspaceId} を実際のワークスペース ID に置き換えてください。

同期呼び出し

リクエストの例
// 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 {
        // シンガポールリージョンの URL。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。詳細については、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数が設定されていない場合は、値を Model Studio API キーに置き換えてください:apiKey = "sk-xxx"。
    // 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.6-t2v")
                        .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("1280*720")
                        .duration(10)
                        .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": "c1209113-8437-424f-a386-xxxxxx",
    "output": {
        "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
        "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 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 '",
        "submit_time": "2026-01-22 23:13:40.553",
        "scheduled_time": "2026-01-22 23:13:49.415",
        "end_time": "2026-01-22 23:17:56.380"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "SR": 720
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

非同期呼び出し

リクエストの例
// 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。{WorkspaceId} を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。詳細については、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

     // 環境変数が設定されていない場合は、プレースホルダーを Model Studio API キーに置き換えてください。例:apiKey="sk-xxx"
    // 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.6-t2v")
                        .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("1280*720")
                        .duration(10)
                        .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"
	}
}
  1. タスククエリリクエストへのレスポンスの例

video_url は 24 時間有効です。速やかにダウンロードしてください。

{
    "request_id": "c1209113-8437-424f-a386-xxxxxx",
    "output": {
        "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
        "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 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 '",
        "submit_time": "2026-01-22 23:13:40.553",
        "scheduled_time": "2026-01-22 23:13:49.415",
        "end_time": "2026-01-22 23:17:56.380"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "SR": 720
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

エラーコード

モデルの呼び出しが失敗し、エラーメッセージが返された場合は、「エラーコード」で解決策をご参照ください。

よくある質問

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

A:リンクを直接変換することはできません。正しい手順は、バックエンドサービスで URL を取得し、動画ファイルをダウンロードしてから、Alibaba Cloud Object Storage Service (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"Video successfully downloaded to: {save_path}")
        # ここに永続ストレージへのアップロードロジックを追加
    except requests.exceptions.RequestException as e:
        print(f"Failed to download the video: {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 時間後に期限切れになるため、ブラウザで直接再生しないでください。代わりに、動画をダウンロードして保存し、再生には永続的なリンクを使用してください。