Wan 2.7 — text to video
Wan 2.7 — text to video(テキストから動画)を MegaBrain API で:動画1秒あたり $0.096。すべてのモデルに 1 つのキー、ドル建てのプリペイド残高から支払い、サブスクリプション不要。
alibaba/wan-2.7/text-to-video長さは 2〜15 秒。5 秒の動画は $0.48。
ジョブがキューに入った時点で差し引かれ、生成に失敗した場合は返金されます。
出力例
ブラウザで試す
サインインすると、英語ページのプレイグラウンドで Wan 2.7 — text to video をブラウザから実行できます。料金は API と同じ残高から支払われます。
プレイグラウンドを開くリクエストパラメータ
リクエストの JSON ボディのフィールドです。これ以外のフィールドは受け付けず、含めると 400 エラーになります。
- prompt文字列必須
- resolution文字列任意
- デフォルト:
1080p- 値:
720p,1080p
- negative_prompt文字列任意
- ratio文字列任意
- デフォルト:
16:9- 値:
16:9,9:16,1:1,4:3,3:4
- duration整数任意
- デフォルト:
5- 範囲:
2–15
- prompt_extendtrue / false任意
- デフォルト:
true
- watermarktrue / false任意
- デフォルト:
false
- seed整数任意
- 範囲:
0–2147483647
API で使う
ジョブを送信し、status_url が COMPLETED になるまで確認してから、response_url で結果を取得します。同じキーと残高でテキストモデルも使えます。 API ドキュメント(英語)
curl
curl -X POST https://getmegabrain.com/api/gateway/v1/queue/alibaba/wan-2.7/text-to-video \
-H "Authorization: Bearer $MEGABRAIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"a slow dolly shot of a lighthouse at dawn, waves below"}'
# Then poll status_url and fetch the result from response_url:
curl https://getmegabrain.com/api/gateway/v1/queue/requests/$REQUEST_ID -H "Authorization: Bearer $MEGABRAIN_API_KEY"Python
import os, time, requests
BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}
job = requests.post(f"{BASE}/queue/alibaba/wan-2.7/text-to-video", headers=HEADERS, json={
"prompt": "a slow dolly shot of a lighthouse at dawn, waves below"
}).json()
while requests.get(job["status_url"], headers=HEADERS).json()["status"] not in ("COMPLETED", "FAILED"):
time.sleep(2)
print(requests.get(job["response_url"], headers=HEADERS).json())JavaScript
const BASE = 'https://getmegabrain.com/api/gateway/v1';
const headers = {
Authorization: `Bearer ${process.env.MEGABRAIN_API_KEY}`,
'Content-Type': 'application/json',
};
const job = await fetch(`${BASE}/queue/alibaba/wan-2.7/text-to-video`, {
method: 'POST',
headers,
body: JSON.stringify({
"prompt": "a slow dolly shot of a lighthouse at dawn, waves below"
}),
}).then(r => r.json());
let status = job.status;
while (status !== 'COMPLETED' && status !== 'FAILED') {
await new Promise(r => setTimeout(r, 2000));
({ status } = await fetch(job.status_url, { headers }).then(r => r.json()));
}
console.log(await fetch(job.response_url, { headers }).then(r => r.json()));よくある質問
Wan 2.7 — text to video API の料金は?
動画1秒あたり $0.096。5 秒の動画は $0.48 です。 ドル建てのプリペイド残高から支払われ、失敗した生成は全額返金されます。サブスクリプションはありません。
Wan 2.7 — text to video を API で使うには?
MegaBrain の API キーを付けて POST https://getmegabrain.com/api/gateway/v1/queue/alibaba/wan-2.7/text-to-video でジョブを送信し、status_url が COMPLETED になるまで確認してから、response_url で結果を取得します。同じキーと残高でテキストモデルも使えます。
コードを書かずに Wan 2.7 — text to video を試せますか?
はい。サインインすると、モデルの英語ページにあるプレイグラウンドで Wan 2.7 — text to video をブラウザから実行できます。料金は API と同じ残高から支払われます。
Wan 2.7 — text to video の動画はどのくらいの長さにできますか?
2–15 秒です。duration フィールドで指定します。