---
title: "Kling 2.1 Master - Create video from image"
method: POST
path: "/v1/ai/image-to-video/kling-v2-1-master"
tags: ["image-to-video"]
---

# Kling 2.1 Master - Create video from image

`POST /v1/ai/image-to-video/kling-v2-1-master`

## Request

- Base URL: `https://api.magnific.com`
- URL: `https://api.magnific.com/v1/ai/image-to-video/kling-v2-1-master`
- Auth: API key in header `x-magnific-api-key`

Generate a video from an image using the Kling 2.1 Master model.

## Request body

- union
  - Itvkv21RequestContent
    - `webhook_url` string, uri: Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.
    - `image` string: Reference Image. Supports Base64 encoding or URL (ensure accessibility). For URL, must be publicly accessible. The image file size cannot exceed 10MB, and the resolution should not be less than 300x300px. Aspect ratio should be between 1:2.5 ~ 2.5:1.
    - `prompt` string: (`Required when image is not provided`) Text prompt describing the desired motion, cannot exceed 2500 characters
    - `negative_prompt` string: Text prompt describing what to avoid in the generated video, cannot exceed 2500 characters
    - `duration` '5' | '10', required: Duration of the generated video in seconds
    - `cfg_scale` number, float: Flexibility in video generation; The higher the value, the lower the model's degree of flexibility, and the stronger the relevance to the user's prompt.
    - `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.
  - Ttvkv21RequestContent
    - `webhook_url` string, uri: Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.
    - `prompt` string: Text prompt describing the desired motion, cannot exceed 2500 characters
    - `negative_prompt` string: Text prompt describing what to avoid in the generated video, cannot exceed 2500 characters
    - `duration` '5' | '10', required: Duration of the generated video in seconds
    - `aspect_ratio` 'widescreen_16_9' | 'social_story_9_16' | 'square_1_1': (`Only works when image is not provided`) Aspect ratio for the generated video
    - `cfg_scale` number, float: Flexibility in video generation; The higher the value, the lower the model's degree of flexibility, and the stronger the relevance to the user's prompt.

## Response `200`

OK - Get the status of the kling-std task

- CreateImageFromTextFlux200Response
  - `data` Task, required
    - `task_id` string, uuid, required: Task identifier
    - `status` 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED', required: Task status

## 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)
