v2-master/image-to-video
Model Overview
Compared to v1.6, this Kling model better aligns with the prompt and delivers more dynamic and visually appealing results.
Setup your API Key
If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.
How to Make a Call
API Schemas
Create a video generation task and send it to the server
The text prompt to guide video generation
The duration of the generated video in seconds. Possible values: 5, 10
The description of elements to avoid in the generated video
The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt
POST /v2/generate/video/kling/generation HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 146
{
"model": "klingai/v2-master-image-to-video",
"image_url": "https://example.com",
"prompt": "text",
"duration": 5,
"negative_prompt": "text",
"cfg_scale": 1
}
No content
Retrieve the generated video from the server
After sending a request for video generation, this task is added to the queue. Based on the service's load, the generation can be completed in seconds or take a bit more.
GET /v2/generate/video/kling/generation HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Accept: */*
No content
Code Example (Python)
The code below creates a video generation task, then automatically polls the server every 10 seconds until it finally receives the video URL.
This model produces highly detailed and natural-looking videos, so generation may take around 5–6 minutes for a 5-second video and 11-14 minutes for a 10-second video.
Last updated
Was this helpful?