seedinteger任意0〜2147483647。1 フィールドずつ比べるときは固定し、幅が欲しいときは外してください。
- デフォルト値
- 指定なし
- 制約
- minimum:0maximum:2147483647
alibaba/wan-3.0/reference-to-videoAlibaba の Wan 3.0 reference-to-video は、画像 10 枚・動画 5 本・音声 5 本までで人物・衣装・ロケーション・声を一貫させます。480p〜1080p の 2〜30 秒で、プロンプトは任意です。
例は、選択中のエンドポイントの公開パラメーター定義から作っています。API キーとサンプル素材を差し替えて、ご自身のサーバーから送信してください。
SDK・連携https://api.spicyapi.ai/api/v1/jobs/createTaskAPI キーはサーバーの環境変数 SPICY_API_KEY に保存します。Bearer 認証を使用し、JSON リクエストには Content-Type: application/json を指定してください。
Authorization: Bearer $SPICY_API_KEY# Generate the idempotency key once; reuse it when retrying after a lost response.
export SPICY_IDEMPOTENCY_KEY="${SPICY_IDEMPOTENCY_KEY:-$(uuidgen)}"
curl -X POST https://api.spicyapi.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SPICY_IDEMPOTENCY_KEY" \
-d '{
"model": "alibaba/wan-3.0/reference-to-video",
"input": {
"aspect_ratio": "16:9",
"duration_seconds": 5,
"prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
"reference_image_urls": [
"https://example.com/reference.png"
],
"resolution": "720p"
}
}'
# Copy data.taskId from the response into TASK_ID, then poll the status.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.spicyapi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"このモデルの入力スキーマから生成した例です。API はどのリクエストも、同じスキーマで検証します。
これらのフィールドは、リクエスト本文の input オブジェクトに指定します。名前と型は API と一致します。デフォルト値の指定がない項目に、デフォルト値があると想定しないでください。
このモデルには項目どうしの依存関係があります。「条件付きで必須」の項目は、ほかの入力の内容によって必須になります。詳しい条件は、下の JSON Schema で確認してください。
seedinteger任意0〜2147483647。1 フィールドずつ比べるときは固定し、幅が欲しいときは外してください。
enable_prompt_expansionboolean任意既定でオフ。オンにすると生成前にプロンプトが書き直され、薄いブリーフには効き、詳細なブリーフとは喧嘩します。指定せずに reference_file_url か reference_link_url を添付すると、資料やページはこの段階で読み込まれるため、そのリクエストではオンになります。明示的に false を指定した場合も資料やページは読み込まれ、プロンプトの書き直しだけが行われません。
generate_audioboolean任意既定でオン。映像に固定された音付きでクリップが返ります。自分で音を付けるときは false にしてください。
duration_secondsinteger任意料金に影響2〜30 の任意の整数秒、または -1 でスマート尺。既定は 5。参照動画を使う場合、その合計秒数とこの値の和は 30 秒以内に収める必要があり、参照動画の秒数も出力に加えて課金されます。伸ばす前に 5 秒で見た目を固めてください。
-123456789101112131415161718192021222324252627282930resolutionstring任意料金に影響480p、720p、1080p。既定は 720p。解像度は料金と、タスクが返るまでの時間の両方を変えます。
"480p""720p""1080p"enable_thinkingboolean任意生成の前に、指示と参照素材をモデルにじっくり読み込ませます。長いドキュメントや Web ページ、複雑な参照画像に向いていますが、処理は遅くなります。既定はオフで、参照ファイルやリンクを渡すと自動でオンになります。料金は変わりません。
aspect_ratiostring任意16:9、9:16、1:1、4:3、3:4、adaptive から選びます。adaptive はモデルに選ばせる指定です。既定は 16:9 です。
"16:9""9:16""1:1""4:3""3:4""adaptive"reference_link_urlstring条件付きで必須モデルが参考として読む公開ウェブページを 1 つ指定します。記事、商品ページ、キャラクター紹介などです。ログインなしで開けるページに限ります。自動読み取りを拒むサイトや、文章が少なすぎるページは使えません。その場合はタスクが URL を読み取れなかった旨のメッセージで失敗し、失敗したタスクには料金がかかりません。reference_file_url とは同時に使えず、enable_prompt_expansion を指定していなければ、リンクを添付した場合もプロンプト拡張がオンになります。リンクには料金がかかりません。
reference_file_urlstring条件付きで必須ショットを組み立てる前にモデルが読む資料を 1 つ渡せます。キャラクターシート、台本、ショットリスト、商品ブリーフなどです。PDF、DOCX、DOC、TXT、MD、PPTX、PPT、XLSX、XLS、KEY、PAGES、NUMBERS に対応し、100 MB・50 ページまでです。単独でも参照画像・動画・音声と一緒でも使えますが、reference_link_url とは同時に使えません。資料はプロンプト拡張の段階で読み込まれるため、enable_prompt_expansion を指定していなければ、ファイルを添付するとそのリクエストではプロンプト拡張がオンになります。ファイルには料金がかかりません。
reference_audio_urlsarray<string>条件付きで必須最大 5 本、各 1〜15 秒、合計 15 秒までです。カットが合わせるべき声、台詞の読み、ルームトーンに使います。参照音声は課金されません。WAV または MP3 で、1 本 15 MB までです。動画の制限と同じく、受け付け時ではなく生成中に判定されます。
reference_video_urlsarray<string>条件付きで必須料金に影響最大 5 本、各 1〜15 秒、合計 15 秒までです。顔ではなく、動きやカメラワークのために使ってください。長さは出力と合わせて課金され、参照動画と出力の合計は 30 秒以内に収める必要があります。MP4 または MOV、16 fps 以上、各辺 240〜4096 px、縦横比 8:1 以内、1 本 100 MB までです。これらの制限は受け付け時ではなく生成中に判定されるので、送信前にクリップの長さを確認してください。
reference_image_urlsarray<string>条件付きで必須人物、衣装、セットのプレートとして 1〜10 枚を渡します。人物なのか衣装なのかセットなのか、プロンプトで一枚ずつ名指ししないと平均化されてしまいます。参照画像は課金されません。JPEG、透過なしの PNG、BMP、WEBP に対応し、各辺 240〜8000 px、縦横比 8:1 以内、1 枚 20 MB までです。実在の人物の写真は、このモデルの顔チェックで拒否されることが多く、その場合タスクは「The input content is suspected to include real human faces.」というエラーで失敗します。代わりにイラストや 3D レンダリングのキャラクターを使ってください。拒否されたタスクは課金されません。
promptstring任意任意です。書く場合は、まず各参照が何を担うかを示し、続けて被写体、動作 1 つ、カメラの動き 1 つ、光と音を書きます。形容詞を長く並べるより、明快な動作 1 つのほうが結果を動かします。
{
"additionalProperties": false,
"anyOf": [
{
"required": [
"reference_image_urls"
]
},
{
"required": [
"reference_video_urls"
]
},
{
"required": [
"reference_audio_urls"
]
},
{
"required": [
"reference_file_url"
]
},
{
"required": [
"reference_link_url"
]
}
],
"properties": {
"aspect_ratio": {
"default": "16:9",
"description": "Output aspect ratio; adaptive follows the input media and the intent.",
"enum": [
"16:9",
"9:16",
"1:1",
"4:3",
"3:4",
"adaptive"
],
"type": "string",
"x-ui": {
"order": 70,
"widget": "select"
}
},
"duration_seconds": {
"default": 5,
"description": "Requested output length in seconds. Pass -1 for smart duration: the model picks the length from the prompt and any input media instead of a fixed number. With reference videos, their total length plus the output length must not exceed 30 seconds, and the reference video seconds are billed together with the output seconds.",
"enum": [
-1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30
],
"type": "integer",
"x-ui": {
"advanced": false,
"affects_price": true,
"enum_labels": {
"-1": "Smart"
},
"order": 50,
"unit": "s",
"widget": "slider"
}
},
"enable_prompt_expansion": {
"description": "Allow the service to expand the submitted creative brief before generation.",
"type": "boolean",
"x-ui": {
"order": 30,
"widget": "switch"
}
},
"enable_thinking": {
"default": false,
"description": "Let the model reason about the brief and the reference material before generating. Helps with complex references; slower. Switches on by itself when a reference file or link is given.",
"type": "boolean",
"x-ui": {
"order": 66,
"widget": "switch"
}
},
"generate_audio": {
"default": true,
"description": "Request generated audio with the video.",
"type": "boolean",
"x-ui": {
"order": 40,
"widget": "switch"
}
},
"prompt": {
"description": "Describe the subject, action, camera, light, pacing, and boundaries for the shot.",
"minLength": 1,
"type": "string",
"x-ui": {
"order": 110,
"primary": true,
"reference_tokens": {
"reference_audio_urls": "Audio {index}",
"reference_image_urls": "Image {index}",
"reference_video_urls": "Video {index}"
},
"widget": "textarea"
}
},
"reference_audio_urls": {
"description": "Reference audio, up to 5 items and 15 seconds in total.",
"items": {
"contentMediaType": [
"audio/mpeg",
"audio/wav"
],
"type": "string"
},
"maxItems": 5,
"minItems": 1,
"type": "array",
"x-ui": {
"max_total_duration_seconds": 15,
"order": 80,
"widget": "multi-upload"
}
},
"reference_file_url": {
"contentMediaType": [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.apple.keynote",
"application/vnd.apple.pages",
"application/vnd.apple.numbers",
"text/plain",
"text/markdown"
],
"description": "One reference document (PDF, DOCX, TXT, MD and similar) that the model reads for characters, wardrobe, setting and action.",
"format": "uri",
"type": "string",
"x-ui": {
"order": 76,
"widget": "upload"
}
},
"reference_image_urls": {
"description": "Reference images, up to 10 items.",
"items": {
"contentMediaType": [
"image/jpeg",
"image/png",
"image/webp",
"image/gif"
],
"type": "string"
},
"maxItems": 10,
"minItems": 1,
"type": "array",
"x-ui": {
"order": 100,
"primary": true,
"widget": "multi-upload"
}
},
"reference_link_url": {
"description": "One public web page the model reads for reference. It must open without a login.",
"format": "uri",
"type": "string",
"x-ui": {
"order": 74,
"placeholder": "https://",
"widget": "text"
}
},
"reference_video_urls": {
"description": "Reference videos, up to 5 items and 15 seconds in total.",
"items": {
"contentMediaType": [
"video/mp4",
"video/webm",
"video/quicktime"
],
"type": "string"
},
"maxItems": 5,
"minItems": 1,
"type": "array",
"x-ui": {
"affects_price": true,
"max_duration_seconds": 15,
"max_total_duration_seconds": 15,
"order": 90,
"widget": "multi-upload"
}
},
"resolution": {
"default": "720p",
"description": "Output resolution.",
"enum": [
"480p",
"720p",
"1080p"
],
"type": "string",
"x-ui": {
"advanced": false,
"affects_price": true,
"order": 60,
"widget": "radio"
}
},
"seed": {
"description": "Random seed. Keep it fixed only for controlled comparisons, not as a frame-identical guarantee.",
"maximum": 2147483647,
"minimum": 0,
"type": "integer",
"x-ui": {
"order": 10,
"widget": "number"
}
}
},
"type": "object",
"x-pricing": {
"billingMode": "duration_capped",
"variantFields": [
"resolution"
]
}
}HTTP 202 はタスクを受け付けたという意味で、生成が終わったという意味ではありません。返ってきた taskId を保存し、そのタスクの状態を問い合わせてください。結果を待っている間に、同じ内容でタスクを作り直さないでください。
HTTP/1.1 202 Accepted
Location: /api/v1/jobs/recordInfo?taskId=job_01k3m8x9q2z4v7n5p6r8s0t1w3
{
"code": 200,
"msg": "success",
"request_id": "req_example_create",
"data": {
"taskId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
"state": "queued",
"estimatedCost": "0.750000"
}
}受理レスポンスには今回の概算料金が含まれるため、アプリのタスク履歴と請求画面に同じ金額を表示できます。
curl --get "https://api.spicyapi.ai/api/v1/jobs/recordInfo" \
--data-urlencode "taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"ポーリングは約 2 秒間隔から始め、徐々に間隔を延ばします。終了状態になったら止めてください。通信が切れたときも、元の taskId で状態を確認します。作成をやり直すときは、同じ冪等キーと同じ本文をそのまま使い回してください。
import { verifyWebhook } from "@spicyapi/sdk";
// express.raw keeps the bytes we signed; express.json never matches.
app.post("/hooks/spicy", express.raw({ type: "application/json" }), (req, res) => {
const { payload } = verifyWebhook({
rawBody: req.body,
timestamp: req.header("X-Webhook-Timestamp"),
signature: req.header("X-Webhook-Signature"),
payloadVersion: Number(req.header("X-Webhook-Payload-Version")),
secret: process.env.SPICY_WEBHOOK_SECRET,
});
res.status(200).end();
void handleFinishedTask(payload);
});タスク作成時に callBackUrl を渡せば、完了したレコードが POST で届きます——ポーリングは一切不要です。配信には毎回 X-Webhook-Timestamp、X-Webhook-Signature、X-Webhook-Payload-Version が付きます。署名は taskId.timestamp.sha256(body) に対する HMAC-SHA256(base64)なので、生のバイト列で検証してください。JSON を解析して再度文字列化するとバイト列が変わり、検証は必ず失敗します。失敗した配信は再送されるため同じ taskId が二度届くことがあります。ハンドラーは冪等に。まず 2xx を返し、処理はその後で——応答が遅いと配信失敗として扱われます。
output を読むのは、state が succeeded のときだけにしてください。失敗したときは errorCode、errorMessage、request_id を手がかりに調べます。例に出ている料金や状態は、実際の請求ではありません。
{
"code": 200,
"msg": "success",
"request_id": "req_example_record",
"data": {
"taskId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
"model": "alibaba/wan-3.0/reference-to-video",
"state": "succeeded",
"output": {
"assets": [
{
"key": "tasks/2026/08/28/job_01k3m8x9q2z4v7n5p6r8s0t1w3/3f7a1c9e5b2d48f0a6c1e3d5b7f9a1c3.mp4",
"mime": "video/mp4",
"url": "https://example.r2.cloudflarestorage.com/results/job_01k3m8x9q2z4v7n5p6r8s0t1w3/result.mp4?X-Amz-Signature=SIGNATURE_FROM_RESPONSE",
"expiresAt": "2026-08-28T12:20:08.000Z"
}
]
},
"cost": "0.750000",
"settled": true,
"createdAt": "2026-08-28T12:00:00Z",
"completedAt": "2026-08-28T12:00:30Z"
}
}利用可能なファイルは assets[].url からそのまま開くか、ダウンロードできます。API の Authorization ヘッダーは不要です。署名付き URL は expiresAt で失効しますが、保存期間内であればタスクを再取得することで更新できます。処理中または利用できないファイルに URL はありません。署名付き URL は非公開情報として扱ってください。
アプリ、ターミナル、AI アシスタント、ビジュアルワークフローで SpicyAPI を活用。接続ガイドを選んでください。
上のコードを書く必要はありません。MCP サーバーを 1 回接続すれば、MCP に対応するエージェント(Claude Code、Codex、Cursor、Windsurf、VS Code、Gemini CLI、Cline、LibreChat)がこのモデルを名前で実行できます。シェルから 1 つのコマンドで実行することもできます。
Use alibaba/wan-3.0/reference-to-video to make a five-second shot of a neon-lit rooftop at dusk, slow push-in, and save it to ./out/.
エージェントは公開カタログからモデルを引き、ローカルファイルを代わりにアップロードし、正確な見積もりと上限額を示して確認を待ちます。承認するまで課金は発生しません。
claude mcp add spicyapi -e SPICY_API_KEY=$SPICY_API_KEY \
-- npx --yes --package=@spicyapi/mcp spicyapi-mcp
npx skills add spicyapi-ai/spicy-skill1 行目でツールを、2 行目で Skill を渡します。Skill は使い方の取り決めです——課金の前に見積もりを取り、ローカルファイルはバイト列を貼らずにアップロードし、完成した成果物の URL を推測せずに読む。ほかのクライアントも同じサーバーをそれぞれの設定ファイルから使います。開発者向けページをご覧ください。
npx @spicyapi/cli tasks create --model alibaba/wan-3.0/reference-to-video \
--input-json '{"aspect_ratio":"16:9","duration_seconds":5,"prompt":"A slow aerial shot drifting over a misty pine forest at sunrise","reference_image_urls":["https://example.com/reference.png"],"resolution":"720p"}' \
--wait入力は上の例と同じ、このエンドポイント固有のスキーマに従います。--wait はタスクの完了までポーリングして結果を表示します。CI では --yes を追加すると確認を省略できます。先に SPICY_API_KEY を設定してください。API、CLI、MCP サーバーで同じキーを使えます。
npx @spicyapi/cli tasks create --model alibaba/wan-3.0/reference-to-video \
--input-json '{…}' --retention 1h --wait
npx @spicyapi/cli tasks get $TASK_ID # read back the retention that applied--retention は保持期間を短くするだけです——30m、1h、7d、あるいは 0 なら終了と同時に削除。実際に効くのはリクエスト・アカウント設定・プラットフォーム上限のうち最も短い値なので、指定した数値が通った前提で進めず、タスクレコードから読み戻してください。アカウントの許容より長い値を渡しても何も起きません。
ComfyUI Manager か下のコマンドで SpicyAPI ノードをインストールしたら、キャンバスで Wan 3.0 · Reference to Video を検索してください。このノードにはこのページと同じオプションがあり、実行前に価格が表示されます。
cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi埋め込みパネルはこのページと同じスキーマを参照するため、API 仕様とのずれを防げます。ドキュメント内の検索対象にする場合は、/api/embed/models/ の JSON を取得して描画してください。
<iframe src="https://spicyapi.ai/embed/ja/models/wan-3-0/api?model=alibaba%2Fwan-3.0%2Freference-to-video" width="100%" height="560" loading="lazy" title="リクエスト例" style="border:1px solid rgba(0,0,0,.12)"></iframe>