Skip to main content
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

ParameterTypeRequiredDescription
model_namestringNoModel to use (default: kling-v1). See models below.
imagestringYesFirst-frame image — public HTTPS URL or base64 string.
image_tailstringNoLast-frame image — drives the ending pose/composition.
promptstringNoText description to guide the animation.
negative_promptstringNoElements to suppress in the output.
cfg_scalenumberNoGeneration freedom [0, 1]. Only kling-v1, kling-v1-5, kling-v1-6.
modestringNostd or pro. Default: std.
soundstringNoon or off. Only kling-v2-6.
voice_listarrayNoVoice configs for audio generation. Only kling-v2-6, max 2 entries. Requires sound: on.
static_maskstringNoMask image defining static (non-moving) regions.
dynamic_masksarrayNoBrush trajectory configs for motion regions. Max 6 groups.
camera_controlobjectNoCamera movement configuration.
aspect_ratiostringNo16:9, 9:16, or 1:1. Default: 16:9.
durationstringNo"5" or "10". Default: "5".
watermark_infoobjectNoWatermark settings.
callback_urlstringNoWebhook URL for completion notifications.
external_task_idstringNoYour own task ID for idempotency.

Supported Models

ModelNotes
kling-v1Baseline first-frame animation
kling-v1-5Improved quality
kling-v1-6Multi-image reference, multimodal editing support
kling-v2-masterAdvanced video generation
kling-v2-1Professional generation
kling-v2-1-masterProfessional with enhanced quality
kling-v2-5Latest generation
kling-v2-5-turboLatest generation, faster
kling-v2-6Audio and motion control support

Mutual Exclusivity Constraints

The following three input modes are mutually exclusive — choose exactly one:
ModeFields Used
First + tail frameimage + image_tail
Dynamic brushimage + dynamic_masks (or static_mask)
Camera controlimage + 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.