Kling AI Video Generator
POST /api/v1/kling-ai-video-generator/submit
prompt is required.
Required inputs
promptstring- Text prompt describing the video to generate (max 2500 chars).
Edit the sample inputs for your own task before submitting.
# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/kling-ai-video-generator/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"prompt":"A cinematic tracking shot follows a cyclist through a quiet forest as morning fog drifts between the trees","duration":"5","aspectRatio":"16:9","sound":true,"negativePrompt":"Flickering, blur, distorted limbs, watermark, low resolution.","cfgScale":0.5,"multiShot":false,"shotType":"customize"}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Parameters and input rules12 fields
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
prompt | string | Yes | Not specified | Text prompt describing the video to generate (max 2500 chars). Minimum length: 1 · Maximum length: 2500 |
imageUrl | string | No | Not specified | Optional input image URL. When provided, the task runs in image-to-video mode. In that mode, output ratio is inferred from the input image. No additional field constraint listed. |
lastFrameUrl | string | No | Not specified | Optional public URL for the final frame in image-to-video mode. No additional field constraint listed. |
duration | string | No | "5" | Video duration in seconds. Values: "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" · Default: "5" |
aspectRatio | string | No | "16:9" | Output aspect ratio for modes that expose a ratio parameter. Ignored when imageUrl selects a mode whose ratio is inferred from the input image. Values: "16:9", "9:16", "1:1" · Default: "16:9" |
sound | boolean | No | true | Generate synchronized audio along with the video. Enabling sound adds a per-second credit surcharge. Default: true |
negativePrompt | string | No | "Flickering, blur, distorted limbs, watermark, low resolution." | Describe unwanted video content or artifacts. Default: "Flickering, blur, distorted limbs, watermark, low resolution." · Minimum length: 0 · Maximum length: 2500 |
cfgScale | number | No | 0.5 | Prompt guidance strength. Default: 0.5 · Minimum: 0 · Maximum: 1 · Multiple of: 0.1 |
multiShot | boolean | No | false | Generate a video composed of multiple shots. Default: false |
shotType | string | No | "customize" | Use custom or automatically planned shot structure. Values: "customize", "intelligence" · Default: "customize" |
multiPrompt | string[] | No | [] | Additional prompts for complex multi-shot compositions. Default: [] · Maximum items: 6 |
elementList | string[] | No | [] | Element references to preserve across the generated shot. Default: [] · Maximum items: 3 |
Mode-specific fields & media limits
Text To Video rules
| Control | Mode-specific rule |
|---|---|
prompt | Required; minimum 1 characters; maximum 2500 characters |
duration | Values: "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"; mode default: "5" |
aspectRatio | Values: "16:9", "9:16", "1:1"; mode default: "16:9" |
sound | Boolean control; default true |
negativePrompt | Maximum characters: 2500; Default: "Flickering, blur, distorted limbs, watermark, low resolution." |
cfgScale | Range: 0 to 1; Default: 0.5 |
multiShot | Default: false |
shotType | Values: "customize", "intelligence"; Default: "customize" |
multiPrompt | Maximum items: 6; Default: [] |
Image To Video rules
| Control | Mode-specific rule |
|---|---|
prompt | Required; minimum 1 characters; maximum 2500 characters |
duration | Values: "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"; mode default: "5" |
sound | Boolean control; default true |
imageUrl | Image input |
lastFrameUrl | Optional final-frame image input |
negativePrompt | Maximum characters: 2500 |
cfgScale | Range: 0 to 1; Default: 0.8 |
multiShot | Default: false |
shotType | Values: "customize", "intelligence"; Default: "customize" |
multiPrompt | Maximum items: 6; Default: [] |
elementList | Maximum items: 3; Default: [] |
Retrieve the result
Save taskId from the accepted submission and send it to this endpoint:
POST /api/v1/kling-ai-video-generator/query
Use the same Bearer API key. On completion, read the videoUrl result field.
curl -X POST "https://vidmage.ai/api/v1/kling-ai-video-generator/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "videoUrl": "https://..." } }