POST
/
kling-v2-6
/
generate
Generate Video
curl --request POST \
  --url https://api.unifically.com/kling-v2-6/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "image_url": "<string>",
  "aspect_ratio": "<string>",
  "duration": 123,
  "motion_id": "<string>",
  "negative_prompt": "<string>",
  "enhance_prompt": true,
  "sound": true,
  "callback_url": "<string>"
}
'
{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}
Generate high-quality AI videos using the Kling 2.6 model with text-to-video and image-to-video capabilities, motion presets, and audio generation.

Key Capabilities

  • Text-to-video generation
  • Image-to-video generation (animate static images)
  • Motion presets for consistent animation styles
  • Audio/sound generation with video
  • Prompt enhancement for better results
  • Negative prompts for content exclusion

Pricing

For current pricing, see the Pricing page.

Request (Text-to-Video)

curl --location 'https://api.unifically.com/kling-v2-6/generate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
  "prompt": "A majestic eagle soaring through mountain peaks",
  "aspect_ratio": "16:9",
  "duration": 5,
  "motion_id": "7077cde8-7947-46d6-aea2-dbf2ff9d441c",
  "negative_prompt": "blurry, low quality, distorted",
  "enhance_prompt": true,
  "sound": true
}'

Request (Image-to-Video)

curl --location 'https://api.unifically.com/kling-v2-6/generate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
  "prompt": "Animate this scene with gentle movement",
  "image_url": "https://example.com/my-image.jpg",
  "duration": 5,
  "sound": true
}'

Parameters

Required Parameters

prompt
string
required
Text description of the video to generate

Optional Parameters

image_url
string
URL of reference image to animate. When provided, aspect ratio is automatically determined from image dimensionsMaximum: 1 image per request
aspect_ratio
string
Output video aspect ratio (only used when image_url is not provided)Options: 1:1, 16:9, `9:16’Default: 1:1
duration
integer
Video duration in secondsDefault: 5
motion_id
string
Motion preset ID from the motions endpointDefault: 7077cde8-7947-46d6-aea2-dbf2ff9d441c
negative_prompt
string
Text describing what to avoid in the videoDefault: null
enhance_prompt
boolean
Whether to enhance the prompt for better resultsDefault: true
sound
boolean
Whether to generate audio with the videoDefault: true
callback_url
string
URL to receive webhook notification on completion

Validation Rules

  • Aspect Ratio: Must be one of 1:1, 16:9, or 9:16
  • Image URL: Maximum of 1 image allowed per request
  • Automatic Aspect Ratio: When image_url is provided, aspect ratio is automatically calculated from image dimensions and the aspect_ratio parameter is ignored

Response

{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Response Fields

code
integer
default:"200"
HTTP status code (200 for success)
data
object
Response data
task_id
string
Unique identifier (UUID) for this generation task

Error Response

{
  "code": 400,
  "success": false,
  "data": {
    "message": "Error description",
    "code": "ERROR_CODE"
  }
}

Best Practices

Use Prompt Enhancement

Enable enhance_prompt: true for best quality results

Motion Presets

Use specific motion presets via motion_id for consistent results

High-Quality Images

Provide high-quality source images with clear subjects for image-to-video

Concise Prompts

Keep prompts concise and descriptive for better results
When image_url is provided, the aspect ratio is automatically determined from the image dimensions. The aspect_ratio parameter will be ignored.
Use negative prompts to exclude unwanted elements like “blurry, low quality, distorted” for better results.