Image-to-Video
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Fixed value i2v
Model name, supported: kling-v1-6 kling-v2 kling-v2-1 kling-v2-1-master kling-v2-5-turbo kling-v2-6
Image information, required when generating video from a single image, includes the imageUrl field (image URL, must be publicly accessible). The image file size must not exceed 10MB. Supported formats are .jpg/.jpeg/.png. The width and height must not be less than 300px, and the aspect ratio must be between 1:2.5 and 2.5:1.
Image Link
First and last frame image information, required when generating a video from the first and last frames (not supported by kling-v2, kling-v2-1, and kling-v2-1-master). Includes headImage.imageUrl (first frame image) and tailImage.imageUrl (last frame image).
First Frame Image Information
Image Link
Last Frame Image Information
Image Link
Reference image information, required for reference-based video generation (only supported by kling-v1-6, up to 4 images). Each element contains the imageUrl field.
Image Link
Prompt, maximum length 2500 characters
Negative prompt, used to describe elements you do not want to appear in the generated image
Video duration, unit: s, supported values: 5, 10
Video resolution (only supported by kling-v1-6), supported resolutions: 360p, 540p, 720p, 1080p
Aspect ratio (supported only by kling-v1-6 reference generation), default 16:9, supported: 16:9, 9:16, 1:1
Degree of freedom, default 0.5, range [0, 1]. The higher the value, the lower the model's degree of freedom and the stronger the relevance to the prompt.
Generation mode (only supported by kling-v1-6), default: std, supported: std, pro
Mode (supported by kling-v2-5-turbo and kling-v2-6) kling-v2-5-turbo defaults to std; kling-v2-6 defaults to pro, supporting: std and pro (when generating videos from first and last frames, kling-v2-5-turbo only supports pro mode).
Audio switch (only supported by kling-v2-6), defaults to off, supported values: off, on
Timbre toggle (only supported by kling-v2-6), default: off, supported values: off, on
Voice list (only supported by kling-v2-6), allowing up to 2 voices to be referenced per video generation task.
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Number of Images
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 "Content-Type: application/json" \ -d '{ "_action": "string", "model": "string", "image": { "imageUrl": "string" }, "headtailImages": {}, "characterImages": [ { "imageUrl": "string" } ], "prompt": "string" }'{
"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"
}