Skip to content

Image to Video

Create a Kling-compatible image-to-video task.

Create Task

Request

http
POST /v1/videos/image2video
FieldTypeRequiredSupported values and limitsDescription
model_namestringYeskling-v2-5-turbo, kling-v3Model name. kling-v2-5-turbo is suited for basic image-to-video, while kling-v3 supports multi-shot generation, reference elements, and longer durations.
imagestringYesPublic URL or raw Base64First-frame reference image. Supports .jpg, .jpeg, and .png, with a maximum size of 10MB, minimum side length of 300px, and an aspect ratio between 1:2.5 and 2.5:1. If you use Base64, pass only the raw content without the data:image/...;base64, prefix.
image_tailstringNoPublic URL or raw Base64End-frame reference image. Supports .jpg, .jpeg, and .png, with a maximum size of 10MB and minimum side length of 300px; there is no aspect ratio restriction. Do not provide an end frame without a first frame. Under kling-v2-5-turbo, using both first and end frame together is supported only when mode=pro.
promptstringNoUp to 2500 charsUnder kling-v3, it is required when multi_shot=false and is used to describe how the video should evolve from the first frame, including action and camera behavior; when multi_shot=true, this field is ignored. Under kling-v2-5-turbo, it is optional.
multi_shotbooleanNoOnly kling-v3; true, falseEnables multi-shot generation. Default is false. When multi_shot=true, prompt is ignored; when multi_shot=false, shot_type and multi_prompt are ignored. kling-v2-5-turbo does not support this field.
shot_typestringNoOnly kling-v3; only customize is supportedRequired when multi_shot=true; ignored when multi_shot=false. Only custom storyboards are supported. intelligence is not supported.
multi_promptarrayNoOnly kling-v3; 1 to 6 itemsRequired when multi_shot=true and shot_type=customize; ignored when multi_shot=false. Used to define prompt and duration for each shot.
multi_prompt[].indexintegerYesOnly kling-v3Shot index. Using 1,2,3... in order is recommended.
multi_prompt[].promptstringYesOnly kling-v3; up to 512 charsPrompt for the current shot.
multi_prompt[].durationstringYesOnly kling-v3; at least 1 secondDuration of the current shot. The sum of all shot durations must equal the total duration.
negative_promptstringNoUp to 2500 charsNegative prompt used to restrict unwanted content or effects.
element_listarrayNoOnly kling-v3Reference element list. Up to 3 elements are supported. kling-v2-5-turbo does not support this field.
element_list[].element_idintegerYesOnly kling-v3Element ID from the element library.
soundstringNoOnly kling-v3; on, offWhether to generate audio together with the video. Default is off. kling-v2-5-turbo does not support this field.
modestringNostd, proGeneration mode. std is the standard mode. pro is the higher-quality mode. 4k is not supported.
aspect_ratiostringNo16:9, 9:16, 1:1If provided, only these three values are supported.
durationstringNokling-v2-5-turbo: 5, 10; kling-v3: 3 to 15Total video duration in seconds.
watermark_infoobjectNo{"enabled": boolean}Whether to return a watermarked result in parallel.
external_task_idstringNoCustom stringCustom task ID for later query use. It must be unique within the same account.

Response

json
{
  "code": 0,
  "message": "success",
  "request_id": "req_abc123",
  "data": {
    "task_id": "sg_vid_xxxxxxxx",
    "task_status": "submitted",
    "created_at": 1776209922,
    "updated_at": 1776209922
  }
}

Example

Basic Example

bash
curl -sS "https://api.exchangetoken.ai/v1/videos/image2video" \
  -H "Authorization: Bearer sk-xxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v3",
    "image": "https://example.com/first-frame.png",
    "prompt": "The person turns toward the camera and smiles, gentle handheld camera movement",
    "mode": "std",
    "sound": "off",
    "duration": "5",
    "watermark_info": {"enabled": false}
  }'

First and End Frame Example

bash
curl -sS "https://api.exchangetoken.ai/v1/videos/image2video" \
  -H "Authorization: Bearer sk-xxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v3",
    "image": "https://example.com/first-frame.png",
    "image_tail": "https://example.com/end-frame.png",
    "prompt": "Smoothly transform the first frame into the final frame",
    "mode": "pro",
    "sound": "off",
    "duration": "5"
  }'

Query Task

Request

http
GET /v1/videos/image2video/{task_id}

Use data.task_id for polling.

Response

json
{
  "code": 0,
  "message": "success",
  "request_id": "req_abc123",
  "data": {
    "task_id": "sg_vid_xxxxxxxx",
    "task_status": "succeed",
    "watermark_info": {
      "enabled": false
    },
    "task_result": {
      "videos": [
        {
          "url": "https://example.com/output.mp4"
        }
      ]
    },
    "created_at": 1776209922,
    "updated_at": 1776210072
  }
}

Status Values

task_statusMeaning
submittedTask accepted but not yet running.
processingTask is queued or running.
succeedTask completed and task_result.videos may be present.
failedTask failed or was cancelled. Check task_status_msg when present.

Example

bash
curl -sS "https://api.exchangetoken.ai/v1/videos/image2video/sg_vid_xxxxxxxx" \
  -H "Authorization: Bearer sk-xxxxxx"