---
title: "Kling 4K I2V - Generate video from image"
method: POST
path: "/v1/ai/video/kling-4k-i2v"
tags: ["video", "kling-4k-i2v", "background_tasks"]
---

# Kling 4K I2V - Generate video from image

`POST /v1/ai/video/kling-4k-i2v`

## Request

- Base URL: `https://api.magnific.com`
- URL: `https://api.magnific.com/v1/ai/video/kling-4k-i2v`
- Auth: API key in header `x-magnific-api-key`

Generate AI video in 4K resolution from an image using Kling 4K Image-to-Video.

**Features:**
- **Image-to-video**: Use a reference image to guide 4K video generation
- **End frame control**: Optionally specify an end frame image
- **Motion brush**: Use static and dynamic masks for precise motion control

**Duration:** 3-15 seconds
**Resolution:** 4K output quality.

## Request body

- Kling4kI2vRequest
  - `webhook_url` string, uri: Optional callback URL that receives asynchronous notifications when the task changes status. The payload includes the task status and result URL when completed.
  - `image` string, required: Reference image for video generation. Supports Base64 encoding or URL (ensure accessibility). For URL, must be publicly accessible. **Image requirements:** - Minimum: 300x300 pixels - Maximum: 10MB file size - Aspect ratio: 1:2.5 to 2.5:1 - Formats: JPG, JPEG, PNG
  - `image_tail` string: Optional end frame control image. Supports Base64 encoding or URL. For URL, must be publicly accessible. Must follow the same format requirements as the `image` field. **Image requirements:** - Same as `image` field
  - `prompt` string: Text prompt describing the desired video content. Maximum 2500 characters. **Tips for better results:** - Be specific about motion, camera angles, and actions - Describe the scene, characters, and atmosphere
  - `negative_prompt` string: Undesired elements to avoid in the generated video. Maximum 2500 characters.
  - `cfg_scale` number, float: Guidance scale controlling prompt adherence versus creative freedom. Range: 0 to 1. - **0**: Maximum creative freedom, loosest interpretation of the prompt - **0.5** (default): Balanced between prompt adherence and creativity - **1**: Strongest adherence to the prompt, least creative variation
  - `duration` '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15': Duration of the generated video in seconds. **Range:** 3-15 seconds
  - `static_mask` string: Static mask image for defining motion brush application areas. ● Supports both Base64 encoding and image URLs (ensure URLs are publicly accessible and follow the same format requirements as the `image` field). ● Supported image formats include .jpg / .jpeg / .png. ● The aspect ratio of the mask image MUST match the input image (`image` field); otherwise, the task will fail. ● The resolutions of the `static_mask` image and the `dynamic_masks.mask` images must be identical; otherwise, the task will fail. ● The static brush feature allows you to define areas where motion will be applied in the generated video.
  - `dynamic_masks` ItvkpRequestContentDynamicMasksInner[]
    - `mask` string, required: Dynamic mask image for defining motion brush application areas with trajectories. ● Support inputting image Base64 encoding or image URL (ensure the URL is accessible and follows the same format requirements as the image field). ● Supported image formats include .jpg / .jpeg / .png ● The aspect ratio of the mask image must match the input image (image field); otherwise, the task will fail (failed). ● The resolutions of the static_mask image and the dynamic_masks.mask image must be identical; otherwise, the task will fail (failed).
    - `trajectories` ItvkpRequestContentDynamicMasksInnerTrajectoriesInner[], required: Motion Trajectory Coordinate Sequence
      - `x` integer, required: Horizontal coordinate (X-coordinate) in 2D pixel system.
      - `y` integer, required: Vertical coordinate (Y-coordinate) in 2D pixel system.

## Response `200`

OK - Task created successfully

- unknown

## Other responses

- `400`: Bad Request - The server could not understand the request due to invalid syntax.
- `401`: Unauthorized - The client must authenticate itself to get the requested response.
- `500`: Internal Server Error - The server has encountered a situation it doesn't know how to handle.
- `503`: Service Unavailable

---

[API](https://skmtc.dev/magnific/apis/magnific-api.md) · [All operations](https://skmtc.dev/magnific/apis/magnific-api/llms.txt) · [OpenAPI document](https://skmtc.dev/magnific/apis/magnific-api/revisions/60711fb082c7?raw)
