task_id (task ID) and a request_id upon success.status = succeeded, and obtain the video URL from videos[].url.{"task_id": "...", "created": ..., "request_id": "..."}, and a query returns the task object (including fields such as task_id / status / videos / usage). Task status values are unified as: queued (waiting for scheduling) / running (generating) / succeeded (successful) / failed (failed).Model Name | Model Parameter Value (Model ID) | Supported Capability | Video Duration (s) | Resolution Tier | Aspect Ratio | Selection Recommendations |
Hy-Video-1.5 | hy-video-v1.5 | Text-to-video / image-to-video | 5 | 720p | 16:9, 9:16, 1:1, 4:3, 3:4 (only text-to-video can specify) | A general-purpose Hunyuan video model with integrated text-to-video/image-to-video capabilities. |
image or image_url is provided, it is image-to-video; otherwise, it is text-to-video.aspect_ratio parameter is not supported.image (Base64) or image_url (image URL) is provided, it is an image-to-video task.POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/generationParameter Name | Required | Type | Description |
model | Yes | string | Model version. Value: hy-video-v1.5 |
prompt | Conditionally required | string | Text prompt. Required for text-to-video generation; optional for image-to-video generation (used to describe the motion of the subject in the image). |
negative_prompt | No | string | Negative prompt, describing content that is not expected to appear. |
image | No | string | Base64-encoded input image. If this parameter is carried, image-to-video generation is used. Use either this parameter or image_url; if both are passed, image takes precedence. |
image_url | No | string | Publicly accessible URL of the input image. If the URL is carried, image-to-video generation is used. Use either this parameter or image. |
n | No | int | Number of output videos. |
duration | No | number | Video duration in seconds. Decimal values are truncated to integers. The current version generates a fixed duration of 5 seconds. |
aspect_ratio | No | string | Aspect ratio, valid only for text-to-video generation. Enumerated values: 16:9 / 9:16 / 1:1 / 4:3 / 3:4. |
resolution | No | string | Resolution. The current version outputs a fixed resolution of 720p. |
revise | No | bool | Whether to enable intelligent prompt rewriting (an extended parameter passed through to the model service as is). |
moderation | No | bool | Content moderation switch (an extended parameter passed through to the model service as is). |
seed | No | int | Random seed (an extended parameter passed through to the model service as is; whether it takes effect depends on the model side). |
footnote | No | string | Custom watermark content, limited to 16 characters (regardless of Chinese or English, with line breaks and spaces removed), generated in the lower right corner of the video. |
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": "A puppy is running on the grass under bright sunshine.""negative_prompt": "blurry, distorted""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": "Make the subject in the image turn its head naturally, with a gentle breeze blowing through its hair.""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": "The camera slowly moves in","image": "<BASE64_ENCODED_IMAGE>"}'
Field | Type | Description |
task_id | string | Task ID generated by the system, used for subsequent task queries. |
created | integer | Task creation time, Unix timestamp in seconds. |
request_id | string | Unique ID of this request, used for troubleshooting and technical support. |
Field | Type | Description |
task_id | string | Task ID (empty string if creation fails). |
status | string | Fixed failed. |
error.code | string | |
error.message | string | Error description. |
{"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":{...}} is returned. For specific error codes and handling suggestions, see Appendix: Unified Error Codes. After a task is submitted successfully, the task status during the generation phase can be obtained through the Query Task Result API:status | Description | Handling Recommendation |
queued | Submitted and waiting for scheduling | Keep polling. |
running | Generating | Keep polling. |
succeeded | Generation succeeded | Obtain the video URL from the query result videos[].url. |
failed | Generation failed | Check the failure cause in error.message, make modifications, and retry. If the failure persists, contact technical support. |
GET https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/tasks/{task_id}{task_id} in the path is the task_id returned when the task was submitted (represented by YOUR_TASK_ID in the example). Video generation takes approximately several minutes, so polling every 3 to 5 seconds is recommended. The response is a pass-through of the model-side return packet with platform-normalized fields added, and may contain original vendor fields not listed in the following table. The actual returned response prevails.Parameter Name | Required | Type | Description |
task_id | Yes | string | Task ID (path parameter), which is the task_id returned when the task is submitted. |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/hunyuan-video/tasks/YOUR_TASK_ID' \\-H 'Authorization: Bearer YOUR_API_KEY'
Field | Type | Description |
task_id | string | Task ID. |
status | string | Task status: queued (pending scheduling) / running (generating) / succeeded (successful) / failed (failed) |
created | integer | Task creation time, Unix timestamp in seconds. |
videos | array | Array of video results (returned on success). |
videos[].url | string | The video file URL is temporary. Download and save it promptly. |
videos[].audio_url | string | Audio file URL (empty string when no audio is available). |
videos[].generate_info | string | Additional information generated on the model side (empty string if none). |
tokenhub_usage | object | Usage consumption (returned after the task reaches a final state and billing is completed). |
tokenhub_usage.total_tokens | integer | Number of tokens consumed by this task, used for billing/reconciliation. |
error | object | Failure information (returned when status=failed), including code / message; null if no failure. |
error.code | string | Error code. |
error.message | string | Error description. |
request_id | string | Unique ID of this request, used for troubleshooting and technical support. |
{"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 Status Code | Business Code | Error Message | Description |
200 | 0 | success | Request succeeded. |
401 | 1000 | Authentication failed | Authorization is missing or the apikey is invalid. |
401 | 1001 | Authorization is empty | The Authorization header is not carried. |
401 | 1002 | Authorization is invalid | The apikey is invalid or has expired. |
401 | 1003 | Authorization is not yet valid | The apikey is not yet valid. |
401 | 1004 | Authorization has expired | The apikey has expired. |
429 | 1100 | Account exception | Account exception (possibly due to overdue payment, suspension, or ban). |
429 | 1101 | Account in arrears (postpaid) | The postpaid account has an overdue payment. |
429 | 1102 | Resource pack depleted or expired | The resource pack has been used up or has expired. |
403 | 1103 | Access denied for the requested resource | No access to the requested resource (the corresponding model/capability is not subscribed). |
400 | 1200 | Invalid request parameters | Invalid request parameters (missing required fields, incorrect types, out-of-range enum values, and so on). |
400 | 1201 | Invalid parameters | Invalid parameter value. Check the valid value range in the documentation. |
404 | 1202 | The requested method is invalid | The HTTP method is incorrect. |
404 | 1203 | The requested resource does not exist | The endpoint path is incorrect or the resource does not exist. |
400 | 1300 | Trigger the platform strategy | Triggers a platform policy (such as failed content moderation or non-compliant input). |
400 | 1301 | Trigger platform sensitive word list | The content contains sensitive words or non-compliant prompts. |
429 | 1302 | Too frequent API calls | The calls are too frequent, triggering rate limiting. |
429 | 1303 | Concurrency or QPS exceeds the limit | The concurrency or QPS exceeds the preset quota. |
400 | 1304 | Trigger IP strategy | Triggers IP address policy-based interception. |
500 | 5000 | Internal server error | Internal server error. |
503 | 5001 | Server is temporarily unavailable | The service is temporarily unavailable (usually due to high load or maintenance). |
504 | 5002 | Server internal timeout | Internal server timeout. |
image / image_url is provided, it is text-to-video; if either image parameter is provided, it is image-to-video. When both image and image_url are provided, image (Base64) takes precedence.aspect_ratio can be specified only for text-to-video (16:9 / 9:16 / 1:1 / 4:3 / 3:4), while the aspect ratio of image-to-video is determined by the input image.queued (waiting for scheduling) / running (generating) / succeeded (successful) / failed (failed). videos[].url has a value only when the status is succeeded. When the status is failed, check the error field to obtain the failure reason.usage.total_tokens and request_id). It may also contain other vendor-specific fields, which is normal. The actual response prevails.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan