Reference-based Video Generation
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Configuration parameters for asynchronous processing. HTTP requests only support asynchronous processing and must be set to enable.
Request Body
application/json
Model name, fixed value: happyhorse-1.0-r2v
Basic input information, including reference images and prompts.
Text prompt. Used to describe the elements and visual characteristics expected to be included in the generated video. Supports input in any language, with a maximum length of 5,000 non-Chinese characters or 2,500 Chinese characters; any excess will be automatically truncated. Reference indication: In the prompt, use identifiers such as "[Image 1]" and "[Image 2]" to refer to the reference images at the corresponding positions in the media array, in the same order as the media array. When using them, specify the exact object in the reference image, for example, "the woman in the red qipao in [Image 1]".
List of media assets used to specify reference images. Each element in the array is a media object containing the type and url fields. The array order defines the sequence of character references in the prompt. The first reference_image in the array corresponds to [Image 1], the second to [Image 2], and so on.
Media asset type. Fixed value: reference_image: reference image. Asset limits: Number of reference images: 1 to 9.
Reference image URL or Base64-encoded data.
Video processing parameters, such as setting video resolution, setting video duration, enabling intelligent prompt rewriting, adding watermarks, etc.
Video resolution, supported: 720p, 1080p (default).
Aspect ratio of the generated video. Available values: 16:9: Default. 9:16 3:4 4:3 1:1
Video duration in seconds, an integer in the range [3, 15], default 5.
Whether to add a watermark in the bottom right corner of the video (with the text fixed as "Happy Horse"), default true
Random seed, range [0, 2147483647]. A fixed seed value improves the reproducibility of generated results.
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Image Count
Video Duration in Seconds
Input Token Count
Total Tokens
Output Token Count
Validity Period
Task ID
Task Status
Status Information
Request ID
curl -X POST "https://api.ygw.ai/api/v1/video/generation" \ -H "Authorization: string" \ -H "X-DashScope-Async: string" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "input": {}, "parameters": {} }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}