task_id(任务 ID)和 request_id;status = succeeded,从 videos[].url 获取视频地址。{"task_id": "...", "created": ..., "request_id": "..."},查询返回任务对象(含 task_id / status / videos / usage 等字段)。任务状态统一为:queued(等待调度)/ running(生成中)/ succeeded(成功)/ failed(失败)。模型名称 | model 参数值(模型 ID) | 支持能力 | 视频时长(秒) | 清晰度档位 | 画面宽高比 | 选型建议 |
Hy-Video-1.5 | hy-video-v1.5 | 文生 / 图生 | 5 | 720p | 16:9、9:16、1:1、4:3、3:4(仅文生可指定) | 混元视频通用款,文生 / 图生一体化 |
image 或 image_url 即图生视频,否则为文生视频;aspect_ratio 参数。image(Base64)或 image_url(图片 URL)即为图生视频。POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/generation参数名 | 必选 | 类型 | 描述 |
model | 是 | string | 模型版本。取值: hy-video-v1.5 |
prompt | 条件必选 | string | 文本提示词。文生视频必选;图生视频可选(用于描述图片中主体的运动)。 |
negative_prompt | 否 | string | 负向提示词,描述不希望出现的内容。 |
image | 否 | string | 输入图片 Base64 编码,携带即为图生视频。与 image_url 二选一;同时传入时以 image 为准。 |
image_url | 否 | string | 输入图片公网可访问 URL,携带即为图生视频。与 image 二选一。 |
n | 否 | int | 输出视频数量。 |
duration | 否 | number | 视频时长(秒),小数将截断为整数。当前版本固定生成 5 秒。 |
aspect_ratio | 否 | string | 画面宽高比,仅文生视频有效。枚举:16:9 / 9:16 / 1:1 / 4:3 / 3:4。 |
resolution | 否 | string | 清晰度。当前版本固定输出 720p。 |
revise | 否 | bool | 是否开启提示词智能改写(扩展参数,原样透传至模型服务)。 |
moderation | 否 | bool | 内容审核开关(扩展参数,原样透传至模型服务)。 |
seed | 否 | int | 随机种子(扩展参数,原样透传至模型服务,是否生效以模型侧为准)。 |
footnote | 否 | string | 业务自定义水印内容,限制 16 个字符长度(不区分中英文,会去换行与空格字符),生成在视频右下角。 |
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/generation' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"model": "hy-video-v1.5","prompt": "一只小狗在草地上奔跑,阳光明媚","negative_prompt": "模糊、变形","aspect_ratio": "16:9"}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/generation' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"model": "hy-video-v1.5","prompt": "让图片中的主体自然转头,微风吹动头发","image_url": "https://example.com/start.jpg"}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/generation' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"model": "hy-video-v1.5","prompt": "镜头缓慢推进","image": "<BASE64_ENCODED_IMAGE>"}'
字段 | 类型 | 说明 |
task_id | string | 系统生成的任务 ID,用于后续任务查询。 |
created | integer | 任务创建时间,Unix 秒级时间戳。 |
request_id | string | 本次请求的唯一 ID,用于问题排查与技术支持定位。 |
字段 | 类型 | 说明 |
task_id | string | 任务 ID(未能创建时为空字符串)。 |
status | string | 固定 failed。 |
error.code | string | |
error.message | string | 错误描述信息。 |
{"task_id": "251435731-WandVideo-05c42d57d3a74c1fa39d56ff59b31e20","created": 1787108411,"request_id": "835a268e-af02-4615-a30b-7e4b815e8839"}
{"task_id": "","status": "failed","error": {"code": "1300","message": "Trigger the platform strategy"}}
{"task_id":"","status":"failed","error":{...}} 信封,具体错误码及处理建议请参见 附录:统一错误码。任务提交成功后,生成阶段的任务状态通过 查询任务结果 接口获取:status | 含义 | 处理建议 |
queued | 已提交等待调度 | 继续轮询 |
running | 生成中 | 继续轮询 |
succeeded | 生成成功 | 从查询结果 videos[].url 获取视频地址 |
failed | 生成失败 | 查看 error.message 失败原因,修改后重试;持续失败请联系技术支持 |
GET https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/tasks/{task_id}{task_id} 即提交任务时返回的 task_id(示例中以 YOUR_TASK_ID 占位)。视频生成约需数分钟,建议每 3~5 秒轮询一次。响应为模型侧回包透传并叠加平台归一化字段,可能包含下表之外的原厂字段,以实际返回为准。参数名 | 必选 | 类型 | 描述 |
task_id | 是 | string | 任务 ID(路径参数),即提交任务时返回的 task_id。 |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/tasks/YOUR_TASK_ID' \\-H 'Authorization: Bearer YOUR_API_KEY'
字段 | 类型 | 说明 |
task_id | string | 任务 ID。 |
status | string | 任务状态:queued(等待调度)/ running(生成中)/ succeeded(成功)/ failed(失败) |
created | integer | 任务创建时间,Unix 秒级时间戳。 |
videos | array | 视频结果数组(成功时返回)。 |
videos[].url | string | 视频文件地址,为临时地址,请及时下载转存。 |
videos[].audio_url | string | 音频文件地址(无音频时为空字符串)。 |
videos[].generate_info | string | 模型侧生成附加信息(无则空字符串)。 |
tokenhub_usage | object | 用量消耗(任务到达终态并完成计费后返回)。 |
tokenhub_usage.total_tokens | integer | 本次任务消耗的 token 数,用于计费 / 对账。 |
error | object | 失败信息(status=failed 时返回),含 code / message;未失败为 null。 |
error.code | string | 错误码。 |
error.message | string | 错误描述信息。 |
request_id | string | 本次请求的唯一 ID,用于问题排查与技术支持定位。 |
{"created": 1787108411,"error": null,"task_id": "251435731-WandVideo-05c42d57d3a74c1fa39d56ff59b31e20","status": "running","request_id": "252e94a8-dbce-4440-8747-e36f52e0fc29"}
{"created": 1787108411,"error": null,"task_id": "251435731-WandVideo-05c42d57d3a74c1fa39d56ff59b31e20","status": "succeeded","videos": [{"audio_url": "","generate_info": "","url": "https://aigc-output-video-1326893053.cos.ap-guangzhou.myqcloud.com/251435731/251435731-WandVideo-05c42d57d3a74c1fa39d56ff59b31e20_0.mp4?q-sign-algorithm=sha1&..."}],"tokenhub_usage": {"total_tokens": 150000},"request_id": "252e94a8-dbce-4440-8747-e36f52e0fc29"}
{"created": 1787108411,"task_id": "251435731-WandVideo-05c42d57d3a74c1fa39d56ff59b31e20","status": "failed","error": {"code": "InternalServiceError","message": "generate video failed"},"request_id": "252e94a8-dbce-4440-8747-e36f52e0fc29"}
HTTP 状态码 | 业务码 | 错误信息 | 说明 |
200 | 0 | success | 请求成功。 |
401 | 1000 | Authentication failed | Authorization 缺失或 apikey 非法。 |
401 | 1001 | Authorization is empty | 未携带 Authorization 头。 |
401 | 1002 | Authorization is invalid | apikey 无效或已失效。 |
401 | 1003 | Authorization is not yet valid | apikey 尚未生效。 |
401 | 1004 | Authorization has expired | apikey 已过期。 |
429 | 1100 | Account exception | 账号异常(可能欠费、被封禁或被暂停)。 |
429 | 1101 | Account in arrears (postpaid) | 后付费账号欠费。 |
429 | 1102 | Resource pack depleted or expired | 资源包已用完或已过期。 |
403 | 1103 | Access denied for the requested resource | 请求资源无访问权限(未订阅对应模型/能力)。 |
400 | 1200 | Invalid request parameters | 请求参数非法(缺失必选项、类型错误、枚举越界等)。 |
400 | 1201 | Invalid parameters | 参数值不合法,请对照文档参数取值范围检查。 |
404 | 1202 | The requested method is invalid | HTTP 方法错误。 |
404 | 1203 | The requested resource does not exist | 端点路径错误或资源不存在。 |
400 | 1300 | Trigger the platform strategy | 触发平台策略(如内容审核不通过、违规输入)。 |
400 | 1301 | Trigger platform sensitive word list | 命中敏感词或违规提示词。 |
429 | 1302 | Too frequent API calls | 调用过于频繁,触发限流。 |
429 | 1303 | Concurrency or QPS exceeds the limit | 并发或 QPS 超过预设配额。 |
400 | 1304 | Trigger IP strategy | 触发 IP 策略拦截。 |
500 | 5000 | Internal server error | 服务器内部错误。 |
503 | 5001 | Server is temporarily unavailable | 服务暂不可用(多为忙碌或维护中)。 |
504 | 5002 | Server internal timeout | 服务内部超时。 |
image / image_url 即为文生视频;携带任一图片参数即为图生视频。image 与 image_url 同时传入时以 image(Base64)为准。aspect_ratio 仅文生视频可指定(16:9 / 9:16 / 1:1 / 4:3 / 3:4),图生视频的画面比例由输入图片决定。queued(等待调度)/ running(生成中)/ succeeded(成功)/ failed(失败)。仅 succeeded 时 videos[].url 有值;failed 时查看 error 字段获取失败原因。usage.total_tokens、request_id),可能包含其他原厂字段,均属正常,以实际返回为准。文档反馈