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",
"task": "generate",
"duration": 5
}'
参数
| JSON | |
|---|---|
model |
必填;执行优化的付费文本模型 ID。 |
prompt |
必填;1–12000 个字符。保留原始素材标签和台词。 |
target_model |
可选;默认 seedance-2.5,目前仅支持该值。 |
language |
可选;输出语言,例如 zh、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,实际 token 用量在 usage。这里只输出提示词,不返回视频任务 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",
"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 字段)会被拒绝。不要在提示词或素材说明中放入密钥。
