YUYU_M6 文生影片
YUYU_M6 只需要一段文字描述就能生成影片,不用準備圖片。影片長度固定 5 秒,畫面比例可以從 5 種裡選,適合沒有現成素材、規格固定的短片。
POST /api/tasks/text2video
X-Api-Key: sk-live-xxxx
Content-Type: application/json
Idempotency-Key: 選填,見〈文生影片〉的說明
完整範例
duration 固定是 5,但仍然要填:
curl -X POST https://yuyuvideo.com/api/tasks/text2video \
-H "X-Api-Key: sk-live-xxxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-20261021-00043" \
-d '{
"model": "YUYU_M6",
"prompt": "a young woman with short silver hair and a red raincoat walks through a neon-lit street at night, rain falling, cinematic",
"duration": 5,
"aspect_ratio": "9:16",
"seed": 1234567,
"payload": { "external_order_id": "order-20261021-00043" },
"callback_url": "https://example.com/webhooks/yuyu-video"
}'
建立成功會回傳 201 Created 和任務資料。這時任務還在排隊,files 是空的。credits 是這次扣除的積分,範例中的數字僅為示意:
{
"public_id": "01K83A1B2C3D4E5F6G7H8J9K0M",
"type": 5,
"status": 0,
"credits": 10,
"params": {
"model": "YUYU_M6",
"prompt": "a young woman with short silver hair and a red raincoat walks through a neon-lit street at night, rain falling, cinematic",
"duration": 5,
"aspect_ratio": "9:16",
"seed": 1234567,
"prompt_enhance": false,
"payload": { "external_order_id": "order-20261021-00043" },
"callback_url": "https://example.com/webhooks/yuyu-video"
},
"error_code": null,
"error_message": null,
"created_at": "2026-10-21T08:00:00.000000Z",
"finished_at": null,
"files_expire_at": null,
"files_expired": false,
"files": []
}
接下來如何查詢進度、下載影片,請見〈任務查詢與取件〉。
參數表
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
model |
string | 是 | 填 YUYU_M6 |
prompt |
string | 是 | 影片描述,最多 10000 字 |
duration |
integer | 是 | 只能填 5,不能省略,填其他值會回傳 422 |
aspect_ratio |
string | 否 | 畫面比例:16:9(橫式)、9:16(直式)、1:1、3:4、4:3。不帶的話是 9:16 |
seed |
integer | 否 | 隨機種子,1–2147483647。不帶的話每次隨機 |
prompt_enhance |
boolean | 否 | 提示詞優化,預設 false。設為 true 時,系統會先把你的 prompt 補成完整的鏡頭、動作與聲音描述再生成影片,prompt 寫得比較簡短時特別有用;引號內的台詞會原字保留。會多扣積分,實際金額以回應中的 credits 為準 |
payload |
object | 否 | 自訂資料,例如你的訂單編號。系統不會讀取或修改,查詢任務和 Webhook 通知時會原樣帶回 |
callback_url |
string | 否 | 任務結束時要通知的網址,需以 https:// 開頭,最多 2000 字。詳見〈回呼(Webhook)〉 |
YUYU_M6 文生影片不收 images、resolution、audio、age_declared,帶了會回傳 422。表格沒有列出的參數一律回傳 422,不會被忽略。
model 填了不存在的模型會回傳 422:Unknown model alias: {model}。
撰寫 prompt 的建議
- 沒有輸入圖片,畫面裡的人物、場景全靠文字決定。把外觀寫具體:髮型髮色、服裝、年齡感、場景、光線、鏡頭運動。
- 無法指定某個特定人物的臉。就算寫了真實人物的名字,也不會生成和那個人相同的長相;需要固定角色長相時,請改用〈全能參考影片〉或〈圖生影片〉並提供圖片。
錯誤情境
| 狀態碼 | 原因 | 回應內容 |
|---|---|---|
422 |
參數有誤,例如缺少 prompt、帶了 images、duration 不是 5、aspect_ratio 不在可選值內、seed 超出範圍 |
errors 欄位會列出每個欄位的錯誤原因 |
422 |
設定了 prompt_enhance: true,但提示詞優化暫時無法使用 |
{ "message": "Prompt enhancement is temporarily unavailable", "errors": { "prompt_enhance": ["Prompt enhancement is temporarily unavailable"] } }。不會建立任務,也不會扣積分,可以改成 false 或不帶這個參數再送一次 |
422 |
model 填了不存在的模型 |
{ "message": "Unknown model alias: {model}" } |
402 |
積分不足 | { "message": "Insufficient credits to complete this charge." } |
429 |
排隊中的文生影片任務太多 | { "message": "Too many pending tasks of this type; please retry later." }。可以依回應的 Retry-After header 決定多久後再試 |
扣款規則請見〈積分與計費〉。