Seedance 2.5
seedance-2.5/image-to-video
价格
seedance-2.5/image-to-video 每秒
| 规格 | 单价 |
|---|---|
| 720P | $0.231 |
| 1080P | $0.562 |
模型介绍撰写中
该模型的详细指南正在准备中。下方的价格、参数与 API 文档已可查阅。
提交生成任务
https://api.hiapi.ai/v1/tasks 请求头
Authorizationstring必填账号 API Key,所有请求必填。示例:Bearer YOUR_HIAPI_API_KEY。获取 API Key
Content-Typestring可选请求体固定按 JSON 解析;如携带,仅接受 application/json(可带 charset),其他取值返回 415。示例:application/json。
Idempotency-Keystring可选幂等键,最长 255 字节。同账户同键的重试只创建一次任务,重放返回首次 taskId。
网络超时或客户端自动重试时,同键只创建一次任务、不会重复扣费(幂等范围 = API Key 所属账户)。建议用业务侧唯一标识做键(如 "order-42");同键重放返回首次 taskId,键在首次提交 24 小时后过期。详细的场景矩阵见统一异步接口介绍页。
请求体
modelstring必填当前固定值:seedance-2.5/image-to-video
routestring可选当前固定值:default
inputobject必填
seedance-2.5/image-to-video 和线路 default 的业务参数对象,见下方参数表。
promptstring必填minLength 1maxLength 10000Motion, camera, scene, and audio instructions. Eleven prompt languages are supported.
durationinteger可选默认值: 5min 4max 30Output duration in seconds. HiAPI charges by the requested duration; use an integer from 4 to 30.
watermarkboolean可选默认值: falseWhether to add an AI-generated watermark to the bottom-right corner.
resolutionstring可选默认值: "720p"Output resolution. Seedance 2.5 supports 720p and 1080p.
720p1080pweb_searchboolean可选默认值: falseAllow the model to search the web for current information mentioned in the prompt.
aspect_ratiostring可选默认值: "adaptive"Output aspect ratio. Image-to-video uses adaptive so the video follows the first frame.
adaptiveoutput_formatstring可选默认值: "mp4"mp4 is the compatible default; mov is intended for professional post-production.
mp4movgenerate_audioboolean可选默认值: trueGenerate synchronized dialogue, effects, and background audio.
last_frame_urlstring可选Optional last-frame image URL, data URL, or asset ID. It uses the same file constraints as first_frame_url. If its aspect ratio differs, it is center-cropped to match the first frame.
first_frame_urlstring可选First-frame image URL, data URL, or asset ID. Supported formats: jpeg, png, webp, bmp, tiff, gif, heic, and heif; under 30 MB; each side 300-6000 px; aspect ratio 0.4-2.5.
reference_audio_urlsarray可选maxItems 10Up to 10 reference audio URLs. Supported formats: wav and mp3; under 15 MB each; each clip 2-30 seconds; combined duration must not exceed 30 seconds. Reference media cannot be combined with first_frame_url or last_frame_url; omit this array or pass an empty array when either frame is provided.
Array [ string ]
reference_image_urlsarray可选maxItems 30Up to 30 reference image URLs. Supported formats: jpeg, png, webp, bmp, tiff, gif, heic, and heif; under 30 MB each; each side 300-6000 px; aspect ratio 0.4-2.5. Reference media cannot be combined with first_frame_url or last_frame_url; omit this array or pass an empty array when either frame is provided.
Array [ string ]
callbackobject可选
终态通知配置;为空则不回调,由调用方自行查询。详见下方回调说明。
创建任务时提供 callback.url,任务终态时 HiAPI 主动 POST 通知你的服务,可免去轮询。回调请求体与任务详情数据结构同构;签名校验、投递重试与幂等说明见统一异步接口介绍页的回调说明。
urlstring必填callback 存在时必填;任务终态后向该 URL 发起 POST,须为合法 http(s) URL。
whenstring可选默认值: "final"当前仅支持 final,即 success / fail 均回调。
finalstoragestring可选默认值: "temp"产物存储档位:temp(默认,保留约 7 天)或 persistent(长期保存,按大小计费)。余额不足或超出存储上限会静默降级为 temp;实际生效档位见任务详情响应。
temppersistent请求示例
# 提交异步任务,成功立即返回 taskId(不等待生成完成)
curl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.5/image-to-video",
"input": {
"prompt": "…",
"duration": 5,
"watermark": false,
"resolution": "720p",
"web_search": false,
"aspect_ratio": "adaptive",
"output_format": "mp4",
"generate_audio": true
}
}' const res = await fetch("https://api.hiapi.ai/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "seedance-2.5/image-to-video",
input: {
"prompt": "…",
"duration": 5,
"watermark": false,
"resolution": "720p",
"web_search": false,
"aspect_ratio": "adaptive",
"output_format": "mp4",
"generate_audio": true
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.ai/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "seedance-2.5/image-to-video",
"input": {
"prompt": "…",
"duration": 5,
"watermark": false,
"resolution": "720p",
"web_search": false,
"aspect_ratio": "adaptive",
"output_format": "mp4",
"generate_audio": true
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} 获取任务详情
https://api.hiapi.ai/v1/tasks/:id 响应字段
taskIdstring必填任务 ID,前缀固定 tk-hiapi-。
modelstring必填解析后的模型全名。用 route 参数提交的任务返回 base@线路(如 gpt-image-2/text-to-image@ext);否则与创建时传入的模型名一致。
routestring可选仅当任务用显式 route 参数提交时出现,回显提交时的原值。
statusstring必填任务状态。
queued 已入队,尚未开始。
handling 处理中。
archiving 处理完成,产物准备中。
success 终态:完成,产物可用(返回 output)。
fail 终态:失败(返回 error)。
提交后按 status 判断:success 或 fail 为终态,其余为非终态,建议按 1~3 秒间隔轮询直至终态。成功终态后从 output[].url 下载产物,并在 expireAt 前完成下载或转存;需要长期保留时在创建任务时使用 storage: "persistent"。
creatednumber必填任务创建时间(Unix 秒)。
completednumber必填进入终态的 Unix 秒;非终态固定为 0。
outputarray可选
仅 status == success 时出现。产物列表,始终为数组,同一任务可能同时返回多个 type(如 video + first_frame)。
Array [ object ]
数组元素
urlstring必填资源 URL,可直接下载。
typestring必填当前可能值:video、image、audio、first_frame、last_frame、thumbnail,后续可能会扩展。
expireAtnumber必填资源可访问截止时间(Unix 秒);过期前请完成下载或转存。
errorobject可选
仅 status == fail 时出现。
codestring必填业务错误码。
messagestring必填错误描述。
响应示例
成功
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} 处理中(非终态)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} 失败
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
}