Seedance 2.5 Flash API
账户和部署可用性
需要符合条件的旧版计费账户或已开放扩展生成的美元账户,并已配置对应服务商。
Flash 需要参考素材数据表。使用美元扩展生成时,请原样保留签名报价。
使用你的 API 密钥调用 GET /api/v1/models,查看账户可用的模型及选项。
请求字段
- model
seedance-2-5-flash- provider
apimart- quality
draft (480p), standard (720p)- outputCount
1–4- 提示词长度上限
- 2000
- seed
- 可选整数种子。省略或传 null 时由服务商选择。
0–2147483647 - generateAudio
- 通过 generateAudio 开关生成音频。
视频草稿根据素材字段判断输入方式。请省略 mode 字段。
| 输入方式 | 素材字段 | size | 时长(秒) |
|---|---|---|---|
| text-to-video | 无 | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9 | 4–30 |
| first-frame | firstFrameAssetId | adaptive | 4–30 |
| first-last-frame | firstFrameAssetId, lastFrameAssetId | adaptive | 4–30 |
| reference-images | 至少提供以下一项 referenceAssetIds, referenceVideoAssetIds, referenceAudioAssetIds (0–10 张图) | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9 | 4–30 |
使用互不重复的参考图片,并保持首尾帧字段为空。
参考图片限制 image/jpeg, image/png, image/webp · 300–6000 px · 0.400–2.50 (W:H)
在 referenceAssetIds、referenceVideoAssetIds 和 referenceAudioAssetIds 中使用互不重复的素材 ID。最多可提交 10 张图片、5 段 H.264 MP4 视频和 5 段 PCM WAV 或 MPEG-1、MPEG-2 Layer III 音频。每段时长为 2–30 秒,文件不超过 10 MiB。视频和音频各自的总时长上限为 30 秒。MP4 必须为非分片文件,只含一条视频轨道。若包含音频,使用 AAC 或 MP3。参考视频需为 24–60 fps,每边 300–6000 像素,宽高比为 0.4–2.5,总像素为 409,600–8,295,044。
报价示例
将 REPLACE_WITH_* 替换为你的账户完成上传后返回的素材 ID,再将草稿发送到报价接口。 上传参考素材
text-to-video
curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
-H "Authorization: Bearer $GAPTI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"draft": {
"kind": "video",
"prompt": "Pan slowly across a lakeside cabin at sunrise. Keep the horizon level.",
"model": "seedance-2-5-flash",
"duration": 4,
"quality": "standard",
"outputCount": 1,
"seed": null,
"firstFrameAssetId": null,
"lastFrameAssetId": null,
"provider": "apimart",
"size": "16:9",
"generateAudio": false
}
}'first-frame
curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
-H "Authorization: Bearer $GAPTI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"draft": {
"kind": "video",
"prompt": "Pan slowly across a lakeside cabin at sunrise. Keep the horizon level.",
"model": "seedance-2-5-flash",
"duration": 4,
"quality": "standard",
"outputCount": 1,
"seed": null,
"firstFrameAssetId": "REPLACE_WITH_FIRST_IMAGE_ASSET_ID",
"lastFrameAssetId": null,
"provider": "apimart",
"size": "adaptive",
"generateAudio": false
}
}'first-last-frame
curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
-H "Authorization: Bearer $GAPTI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"draft": {
"kind": "video",
"prompt": "Pan slowly across a lakeside cabin at sunrise. Keep the horizon level.",
"model": "seedance-2-5-flash",
"duration": 4,
"quality": "standard",
"outputCount": 1,
"seed": null,
"firstFrameAssetId": "REPLACE_WITH_FIRST_IMAGE_ASSET_ID",
"lastFrameAssetId": "REPLACE_WITH_LAST_IMAGE_ASSET_ID",
"provider": "apimart",
"size": "adaptive",
"generateAudio": false
}
}'reference-images
curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
-H "Authorization: Bearer $GAPTI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"draft": {
"kind": "video",
"prompt": "Pan slowly across a lakeside cabin at sunrise. Keep the horizon level.",
"model": "seedance-2-5-flash",
"duration": 4,
"quality": "standard",
"outputCount": 1,
"seed": null,
"firstFrameAssetId": null,
"lastFrameAssetId": null,
"provider": "apimart",
"size": "16:9",
"generateAudio": false,
"referenceAssetIds": [
"REPLACE_WITH_FIRST_IMAGE_ASSET_ID"
]
}
}'混合图片、视频和音频参考
curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
-H "Authorization: Bearer $GAPTI_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"draft": {
"kind": "video",
"prompt": "Pan slowly across a lakeside cabin at sunrise. Keep the horizon level.",
"model": "seedance-2-5-flash",
"duration": 4,
"quality": "standard",
"outputCount": 1,
"seed": null,
"firstFrameAssetId": null,
"lastFrameAssetId": null,
"provider": "apimart",
"size": "16:9",
"generateAudio": false,
"referenceAssetIds": [
"REPLACE_WITH_FIRST_IMAGE_ASSET_ID"
],
"referenceVideoAssetIds": [
"REPLACE_WITH_VIDEO_ASSET_ID"
],
"referenceAudioAssetIds": [
"REPLACE_WITH_AUDIO_ASSET_ID"
]
}
}'提交与下载
将 normalizedDraft 作为 draft,并将完整报价作为 quoteAcknowledgement。提交前请确认返回的积分。
提交任务