The Kling image-to-video endpoint animates a reference image into a video clip. Provide a first-frame image and an optional text prompt, and Kling generates fluid motion that extends from that starting frame. You can also supply a tail frame, dynamic brush trajectories, or camera motion controls for more precise animation direction.
export TOKEN="oh-xxxxxxxxxxxxxxxx"
Authorization: Bearer <TOKEN>
Content-Type: application/json
Endpoint
POST https://aiapi.fhddos.com/kling/v1/videos/image2video
Request Parameters
| Parameter | Type | Required | Description |
|---|
model_name | string | No | Model to use (default: kling-v1). See models below. |
image | string | Yes | First-frame image — public HTTPS URL or base64 string. |
image_tail | string | No | Last-frame image — drives the ending pose/composition. |
prompt | string | No | Text description to guide the animation. |
negative_prompt | string | No | Elements to suppress in the output. |
cfg_scale | number | No | Generation freedom [0, 1]. Only kling-v1, kling-v1-5, kling-v1-6. |
mode | string | No | std or pro. Default: std. |
sound | string | No | on or off. Only kling-v2-6. |
voice_list | array | No | Voice configs for audio generation. Only kling-v2-6, max 2 entries. Requires sound: on. |
static_mask | string | No | Mask image defining static (non-moving) regions. |
dynamic_masks | array | No | Brush trajectory configs for motion regions. Max 6 groups. |
camera_control | object | No | Camera movement configuration. |
aspect_ratio | string | No | 16:9, 9:16, or 1:1. Default: 16:9. |
duration | string | No | "5" or "10". Default: "5". |
watermark_info | object | No | Watermark settings. |
callback_url | string | No | Webhook URL for completion notifications. |
external_task_id | string | No | Your own task ID for idempotency. |
Supported Models
| Model | Notes |
|---|
kling-v1 | Baseline first-frame animation |
kling-v1-5 | Improved quality |
kling-v1-6 | Multi-image reference, multimodal editing support |
kling-v2-master | Advanced video generation |
kling-v2-1 | Professional generation |
kling-v2-1-master | Professional with enhanced quality |
kling-v2-5 | Latest generation |
kling-v2-5-turbo | Latest generation, faster |
kling-v2-6 | Audio and motion control support |
Mutual Exclusivity Constraints
The following three input modes are mutually exclusive — choose exactly one:
| Mode | Fields Used |
|---|
| First + tail frame | image + image_tail |
| Dynamic brush | image + dynamic_masks (or static_mask) |
| Camera control | image + camera_control |
You cannot combine image_tail, dynamic_masks/static_mask, and camera_control in the same request. Use only one motion control approach per request.
Dynamic Brush Configuration
Dynamic brush lets you draw motion trajectories over specific regions of the image:
{
"dynamic_masks": [
{
"mask": "<base64-encoded-mask-image>",
"trajectories": [
{"x": 100, "y": 200},
{"x": 150, "y": 250},
{"x": 200, "y": 300}
]
}
]
}
mask: Base64-encoded image that marks the region to animate. Must match the dimensions of image.
trajectories: Array of pixel coordinates defining the motion path. Use the bottom-left corner as the origin. Minimum 2 points, maximum 77 points.
- You can define up to 6 brush groups in
dynamic_masks.
static_mask marks regions that should remain still. It must also match the image dimensions.
Examples
First-Frame Animation
Animate a still image with a descriptive prompt:
curl --request POST \
--url https://aiapi.fhddos.com/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v1",
"image": "https://example.com/first-frame.jpg",
"prompt": "A mouse runs toward the camera, smiling and blinking",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9"
}'
First Frame + Tail Frame
Interpolate motion between a starting and ending image:
curl --request POST \
--url https://aiapi.fhddos.com/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v1",
"image": "https://example.com/child.jpg",
"image_tail": "https://example.com/adult.jpg",
"prompt": "A little girl grows up into a young woman",
"mode": "pro",
"duration": "10",
"aspect_ratio": "16:9"
}'
Camera Control
Apply a zoom motion while animating a landscape image:
curl --request POST \
--url https://aiapi.fhddos.com/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v2-master",
"image": "https://example.com/mountain-landscape.jpg",
"prompt": "Camera slowly zooms in on the mountain peak",
"camera_control": {
"type": "simple",
"config": {
"zoom": 5
}
},
"duration": "10",
"aspect_ratio": "16:9"
}'
Vertical Video (Portrait Mode)
Generate a portrait-format animation from a vertical reference image:
curl --request POST \
--url https://aiapi.fhddos.com/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v1-6",
"image": "https://example.com/portrait-reference.jpg",
"prompt": "The person turns their head and smiles at the camera",
"mode": "std",
"duration": "5",
"aspect_ratio": "9:16"
}'
Audio-Enhanced Animation (kling-v2-6)
Combine image animation with audio generation:
curl --request POST \
--url https://aiapi.fhddos.com/kling/v1/videos/image2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-v2-6",
"image": "https://example.com/concert-stage.jpg",
"prompt": "The band plays an energetic rock performance, crowd cheering",
"sound": "on",
"mode": "std",
"duration": "5"
}'
Response
{
"code": 0,
"message": "success",
"request_id": "req_1735558800_xyz789",
"data": {
"task_id": "task_01JGHM...",
"task_status": "submitted",
"created_at": 1735558800000,
"updated_at": 1735558800000
}
}
The response also contains a platform_id field (Fhddos tracking ID in video_<ULID> format) alongside task_id. Use either to query the task status.
Polling for Completion
curl "https://aiapi.fhddos.com/kling/v1/videos/image2video/$TASK_ID" \
-H "Authorization: Bearer $TOKEN"
When task_status reaches succeed, the task_result.videos array contains the generated video URL. See Task Query for the full response schema and status lifecycle.
Tips
Match the aspect ratio of your reference image to the aspect_ratio parameter for best results. For example, use a portrait-cropped image (9:16 proportions) when generating a 9:16 video.
When using dynamic_masks, ensure the mask image has the exact same pixel dimensions as image. A dimension mismatch will likely cause an upstream processing error.