Title: Next-Gen AI Video & AI Image Generator URL Source: https://app.klingai.com/global/dev/document-api/apiReference/model/imageToVideo Markdown Content: - * * Create Task ----------- POST/v1/videos/image2video - Please note that in order to maintain naming consistency, the original model field has been changed to model_name. Please use this field to specify the model version in the future. - We maintain backward compatibility. If you continue using the original model field, it will not affect API calls and will be equivalent to the default behavior when model_name is empty (i.e., calling the V1 model). ### Request Header Data Exchange Format Authentication information, refer to API authentication ### Request Body Model Name Enum values:kling-v1 kling-v1-5 kling-v1-6 kling-v2-master kling-v2-1 kling-v2-1-master kling-v2-5-turbo kling-v2-6 Reference Image - Supports image Base64 encoding or image URL (ensure accessibility) - Important: When using Base64, do NOT add any prefix like data:image/png;base64,. Submit only the raw Base64 string. - Correct Base64 format: - Incorrect Base64 format (with data: prefix): - Supported image formats: .jpg / .jpeg / .png - File size: ≤10MB, dimensions: min 300px, aspect ratio: 1:2.5 ~ 2.5:1 - At least one of image or image_tail must be provided; both cannot be empty - image + image_tail, dynamic_masks/static_mask, and camera_control are mutually exclusive - only one can be used at a time - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. Reference Image - End frame control - Supports image Base64 encoding or image URL (ensure accessibility) - Important: When using Base64, do NOT add any prefix like data:image/png;base64,. Submit only the raw Base64 string. - Supported image formats: .jpg / .jpeg / .png - File size: ≤10MB, dimensions: min 300px - At least one of image or image_tail must be provided; both cannot be empty - image + image_tail, dynamic_masks/static_mask, and camera_control are mutually exclusive - only one can be used at a time - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. Positive text prompt - Cannot exceed 2500 characters - Use <<>> to specify voice, with the sequence matching the voice_list parameter order - A video generation task can reference up to 2 voices; when specifying a voice, the sound parameter must be "on" - The simpler the syntax structure, the better. Example: The man<<>> said: "Hello" - When voice_list is not empty and prompt references voice ID, the task will be billed as "with specified voice" - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. Negative text prompt - Cannot exceed 2500 characters List of voices referenced when generating videos - A video generation task can reference up to 2 voices - When voice_list is not empty and prompt references voice ID, the task will be billed as "with specified voice" - voice_id is returned through the voice customization API, or use system preset voices. See Custom Voices API (https://app.klingai.com/global/dev/document-api/apiReference/model/customVoices); NOT the voice_id of Lip-Sync API Example: - Only V2.6 and later models support this parameter Whether to generate sound when generating video Enum values:on off - Only V2.6 and later models support this parameter Flexibility in video generation; higher value means lower model flexibility and stronger relevance to user prompt - Value range: [0, 1] - kling-v2.x models do not support this parameter Video generation mode Enum values:std pro - std: Standard Mode - basic mode, cost-effective - pro: Professional Mode (High Quality) - high performance mode, better video quality - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. Static brush mask area (mask image created by user using motion brush) - The "Motion Brush" feature includes Dynamic Brush (dynamic_masks) and Static Brush (static_mask) - Supports image Base64 encoding or image URL (same format requirements as image field) - Supported image formats: .jpg / .jpeg / .png - Aspect ratio must match the input image (image field), otherwise task will fail - Resolution of static_mask and dynamic_masks.mask must be identical, otherwise task will fail - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. Dynamic brush configuration list - Can configure multiple groups (up to 6), each containing "mask area" and "motion trajectory" sequence - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. ▾Hide child attributes Dynamic brush mask area (mask image created by user using motion brush) - Supports image Base64 encoding or image URL (same format requirements as image field) - Supported image formats: .jpg / .jpeg / .png - Aspect ratio must match the input image (image field), otherwise task will fail - Resolution of static_mask and dynamic_masks.mask must be identical, otherwise task will fail Motion trajectory coordinate sequence - For 5s video, trajectory length ≤77, coordinate count range: [2, 77] - Coordinate system uses bottom-left corner of image as origin - Note 1: More coordinate points = more accurate trajectory. 2 points = straight line between them - Note 2: Trajectory direction follows input order. First coordinate is start point, subsequent coordinates are connected sequentially ▾Hide child attributes X coordinate of trajectory point (pixel coordinate with image bottom-left as origin) Y coordinate of trajectory point (pixel coordinate with image bottom-left as origin) Camera movement control protocol (if not specified, model will intelligently match based on input text/images) - Support varies by model version and video mode. See Capability Map (https://app.klingai.com/global/dev/document-api/apiReference/model/skillsMap) for details. ▾Hide child attributes Predefined camera movement type Enum values:simple down_back forward_up right_turn_forward left_turn_forward - simple: Simple camera movement, can choose one of six options in "config" - down_back: Camera descends and moves backward ➡️ Pan down and zoom out. config parameter not required - forward_up: Camera moves forward and tilts up ➡️ Zoom in and pan up. config parameter not required - right_turn_forward: Rotate right then move forward ➡️ Right rotation advance. config parameter not required - left_turn_forward: Rotate left then move forward ➡️ Left rotation advance. config parameter not required Contains 6 fields to specify camera movement in different directions - Required when type is "simple"; leave empty for other types - Choose only one parameter to be non-zero; rest must be 0 ▾Hide child attributes Horizontal movement - camera translation along x-axis - Value range: [-10, 10]. Negative = left, Positive = right Vertical movement - camera translation along y-axis - Value range: [-10, 10]. Negative = down, Positive = up Horizontal pan - camera rotation around y-axis - Value range: [-10, 10]. Negative = rotate left, Positive = rotate right Vertical tilt - camera rotation around x-axis - Value range: [-10, 10]. Negative = tilt down, Positive = tilt up Roll - camera rotation around z-axis - Value range: [-10, 10]. Negative = counterclockwise, Positive = clockwise Zoom - controls camera focal length change, affects field of view - Value range: [-10, 10]. Negative = longer focal length (narrower FOV), Positive = shorter focal length (wider FOV) Video duration in seconds Enum values:5 10 Whether to generate watermarked results simultaneously - Defined by the enabled parameter, format: - true: generate watermarked result, false: do not generate - Custom watermarks are not currently supported Callback notification URL for task result. If configured, server will notify when task status changes. - For specific message schema, see Callback Protocol (https://app.klingai.com/global/dev/document-api/apiReference/callbackProtocol) Customized Task ID - Will not overwrite system-generated task ID, but supports querying task by this ID - Must be unique within a single user account - * * Query Task (Single) ------------------- GET/v1/videos/image2video/{id} ### Request Header Data Exchange Format Authentication information, refer to API authentication ### Path Parameters Task ID for image to video - Request path parameter, fill value directly in request path - Choose one between task_id and external_task_id for querying Customized Task ID for image to video - The external_task_id provided when creating the task - Choose one between task_id and external_task_id for querying - * * Query Task (List) ----------------- GET/v1/videos/image2video ### Request Header Data Exchange Format Authentication information, refer to API authentication ### Query Parameters Page number - Value range: [1, 1000] Data volume per page - Value range: [1, 500]