Seedance 提示詞最佳化 API
將創意改寫為適用 Seedance 2.5 的提示詞。
Seedance 提示詞最佳化 API
這是 APIMaster 的文字最佳化服務,只回傳提示詞,不建立影片任務。依火山引擎公開指南獨立實作,並非 Seedance 官方最佳化 API,也不內建或散布官方 Skill。
POST https://apimaster.ai/v1/video/prompt-optimize
使用 APIMaster API Key。model 指定執行並計費的文字模型,須有可用路由及 Key 權限;target_model 才是影片模型,目前僅支援 seedance-2.5。範例文字模型不可用時請替換。
快速開始
curl --fail-with-body -sS "https://apimaster.ai/v1/video/prompt-optimize" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-lite",
"target_model": "seedance-2.5",
"prompt": "A cat watches raindrops on a window, then turns toward the camera.",
"language": "zh-TW",
"task": "generate",
"duration": 5
}'
參數
| JSON | |
|---|---|
model |
必填;用於最佳化的付費文字模型 ID。 |
prompt |
必填;1–12000 字元,保留素材標籤與台詞。 |
target_model |
選填;預設且僅支援 seedance-2.5。 |
language |
選填;輸出語言如 zh-TW、en;省略時跟隨輸入。最多 64 位元組。 |
task |
選填;generate(預設)、edit 或 extend。 |
duration |
選填;整數 4–30 或 -1。編輯須省略或用 -1。只提供規劃依據,不設定生成參數。 |
references |
選填;最多 50 項文字說明,含唯一 label(1–64 字元)及 description(1–2000 字元)。不下載或分析媒體。 |
回應格式
回應為標準 Chat Completions JSON。從 choices[0].message.content 取得提示詞,從 usage 取得 token 用量;不回傳影片任務 ID。若 finish_reason 不是 stop,尤其為 length,請先確認內容完整。
{
"object": "chat.completion",
"model": "gemini-3.1-flash-lite",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "A cat sits beside a rain-covered window, watching the drops slide down the glass. It slowly turns its head toward the camera."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 600,
"completion_tokens": 50,
"total_tokens": 650
}
}
參考素材說明
{
"model": "gemini-3.1-flash-lite",
"prompt": "Use @Image1 for the person and @Video1 for the camera movement.",
"language": "zh-TW",
"references": [
{
"label": "@Image1",
"description": "Person appearance only; ignore the background."
},
{
"label": "@Video1",
"description": "Slow camera push-in only; ignore the people."
}
]
}
錯誤與計費
400 參數或 JSON 錯誤;401 Key 無效;403 權限不足;413 超過 64 KiB;415 非 JSON;429 限流。上游錯誤沿用文字模型回應。
依文字模型及群組計算 token 費用,沿用餘額檢查、日誌與失敗結算。系統指令及素材說明也計入輸入 token。不收影片費用;後續生成另計。
檢查後生成影片
將完整結果作為生成請求的 prompt。媒體、時長、比例另行提交,標籤須與素材順序及職責一致。服務未查看媒體,不保證人物一致、精確字幕或逐幀時序。
限制
僅非串流文字最佳化。未知頂層欄位(含 stream、messages、webhook、媒體 URL)會被拒絕。請勿填入密鑰。
