Skip to content
API Reference
API Reference

Kling Image-to-Video

Use the image to video endpoint to create an asynchronous Task.

01

Overview

Use the image to video endpoint with a supported model. Use the returned Task ID to retrieve its state, or provide callback_url for the deliveries documented below.

Quick start

  1. Create an API key and set it as RUNAPI_API_KEY.
  2. Choose a supported model and send a POST request whose body matches that model's schema.
  3. Store the returned task ID, then poll until a terminal state or handle the callbacks documented below.

Endpoint

POST /api/v1/kling/image_to_video
Base URL
https://runapi.ai
API version
v1
Authentication
Authorization: Bearer YOUR_API_TOKEN
02

Supported models

Open a model page for current pricing, rate limits, and commercial-usage details.

03

Request schema

JSON body

Fields and allowed values depend on the selected model. When supplied, callback_url receives the Task deliveries documented below.

kling-o113 fields
aspect_ratiostring
Optional

Output aspect ratio.

Allowed values: 16:9, 9:16, 1:1 Default: 16:9
callback_urlstring
Optional

Webhook URL for async notifications.

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 5 Default: 5
enable_soundboolean
Optional

Sound generation must remain disabled.

Default: false
first_frame_image_urlstring
Required

Public HTTP(S) JPG, JPEG, or PNG first-frame image URL.

last_frame_image_urlstring
Optional

Public HTTP(S) JPG, JPEG, or PNG final-frame image URL; cannot be combined with reference_image_urls or reference_video_url.

modestring
Optional

Generation mode.

Allowed values: std, pro Default: std
modelstring
Required

Model slug.

preserve_reference_video_audioboolean
Optional

Preserve the reference video's original audio.

Default: false
promptstring
Required

Video description; reference media with matching numbered markers.

Range: 1 - 2500
reference_image_urlsarray
Optional

Ordered public HTTP(S) JPG, JPEG, or PNG reference image URLs; cannot be combined with last_frame_image_url.

Item range: 1 - 7
reference_video_typestring
Optional

Use the video as a base edit or feature reference.

Allowed values: base, feature Default: base
reference_video_urlstring
Optional

Public HTTP(S) MP4 or MOV reference video URL; cannot be combined with last_frame_image_url.

kling-v2.1-master-image-to-video9 fields
aspect_ratiostring
Optional

Output aspect ratio.

callback_urlstring
Optional

Webhook URL for async notifications.

cfg_scalenumber
Optional

Guidance scale (0-1).

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 5, 10
first_frame_image_urlstring
Required

First frame image URL.

last_frame_image_urlstring
Optional

Final frame image URL for supported image-to-video models.

modelstring
Required

Model slug.

negative_promptstring
Optional

Negative prompt.

promptstring
Required

Video description.

kling-v2.1-pro9 fields
aspect_ratiostring
Optional

Output aspect ratio.

callback_urlstring
Optional

Webhook URL for async notifications.

cfg_scalenumber
Optional

Guidance scale (0-1).

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 5, 10
first_frame_image_urlstring
Required

First frame image URL.

last_frame_image_urlstring
Optional

Final frame image URL for supported image-to-video models.

modelstring
Required

Model slug.

negative_promptstring
Optional

Negative prompt.

promptstring
Required

Video description.

kling-v2.1-standard9 fields
aspect_ratiostring
Optional

Output aspect ratio.

callback_urlstring
Optional

Webhook URL for async notifications.

cfg_scalenumber
Optional

Guidance scale (0-1).

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 5, 10
first_frame_image_urlstring
Required

First frame image URL.

last_frame_image_urlstring
Optional

Final frame image URL for supported image-to-video models.

modelstring
Required

Model slug.

negative_promptstring
Optional

Negative prompt.

promptstring
Required

Video description.

kling-v2.5-turbo-image-to-video-pro9 fields
aspect_ratiostring
Optional

Output aspect ratio.

callback_urlstring
Optional

Webhook URL for async notifications.

cfg_scalenumber
Optional

Guidance scale (0-1).

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 5, 10
first_frame_image_urlstring
Required

First frame image URL.

last_frame_image_urlstring
Optional

Final frame image URL for supported image-to-video models.

modelstring
Required

Model slug.

negative_promptstring
Optional

Negative prompt.

promptstring
Required

Video description.

kling-v2.69 fields
aspect_ratiostring
Optional

Output aspect ratio.

Allowed values: 16:9, 9:16, 1:1 Default: 16:9
callback_urlstring
Optional

Webhook URL for async notifications.

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 5, 10 Default: 5
enable_soundboolean
Optional

Enable sound generation; requires pro mode.

Default: false
first_frame_image_urlstring
Required

First frame image URL.

last_frame_image_urlstring
Optional

Final frame image URL; requires pro mode and 5 seconds.

modestring
Optional

Generation mode.

Allowed values: std, pro Default: std
modelstring
Required

Model slug.

promptstring
Required

Video description.

Range: 1 - 2500
kling-v3-omni9 fields
aspect_ratiostring
Optional

Output aspect ratio.

Allowed values: 16:9, 9:16, 1:1 Default: 16:9
callback_urlstring
Optional

Webhook URL for async notifications.

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 Default: 5
enable_soundboolean
Optional

Enable synchronized sound generation.

Default: false
first_frame_image_urlstring
Required

First frame image URL.

last_frame_image_urlstring
Optional

Final frame image URL; requires a 5-second duration.

modelstring
Required

Model slug.

output_resolutionstring
Optional

Output resolution.

Allowed values: 720p, 1080p, 4k Default: 720p
promptstring
Required

Video description.

Range: 1 - 2500
kling-v3-turbo-image-to-video6 fields
callback_urlstring
Optional

Webhook URL for async notifications.

duration_secondsinteger
Optional

Duration in seconds.

Allowed values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 Default: 5
first_frame_image_urlstring
Required

First frame image URL.

modelstring
Required

Model slug.

output_resolutionstring
Optional

Output resolution.

Allowed values: 720p, 1080p Default: 720p
promptstring
Required

Video description.

Range: 1 - 2500

Conditional rules

These requirements apply when all listed conditions match.

  1. When model = kling-o1
    Required
    Not accepted
    output_resolution, negative_prompt, cfg_scale
  2. When model = kling-v2.1-master-image-to-video
    Required
    Not accepted
    output_resolution, enable_sound, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
  3. When model = kling-v2.1-pro
    Required
    Not accepted
    output_resolution, enable_sound, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
  4. When model = kling-v2.1-standard
    Required
    Not accepted
    output_resolution, enable_sound, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
  5. When model = kling-v2.5-turbo-image-to-video-pro
    Required
    Not accepted
    output_resolution, enable_sound, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
  6. When model = kling-v2.6
    Required
    Not accepted
    output_resolution, negative_prompt, cfg_scale, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
  7. When model = kling-v3-omni
    Required
    Not accepted
    negative_prompt, cfg_scale, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
  8. When model = kling-v3-turbo-image-to-video
    Required
    Not accepted
    enable_sound, aspect_ratio, negative_prompt, cfg_scale, last_frame_image_url, reference_image_urls, reference_video_url, reference_video_type, preserve_reference_video_audio
04

Create acceptance

HTTP 202

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
05

Polling processing

HTTP 200

GET /api/v1/kling/image_to_video/:id

Response schema
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
06

Polling completed

HTTP 200

GET /api/v1/kling/image_to_video/:id

Response schema
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed",
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
07

Polling failed

HTTP 200

GET /api/v1/kling/image_to_video/:id

Response schema
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
08

Customer callback: completed

HTTP 200

POST callback_url

Response schema
JSON
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
09

Customer callback: failed

HTTP 200

POST callback_url

Response schema
JSON
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
10

Errors

HTTP 401

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "Authentication required"
}
11

Errors

HTTP 401

GET /api/v1/kling/image_to_video/:id

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "Authentication required"
}
12

Errors

HTTP 400

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Human-readable error message.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Human-readable validation summary.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Validation messages keyed by public request field, with an array of human-readable strings for each field.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

Response example

JSON
{
  "error": "model must be one of: kling-o1, kling-v2.1-master-image-to-video, kling-v2.1-pro, kling-v2.1-standard, kling-v2.5-turbo-image-to-video-pro, kling-v2.6, kling-v3-omni, kling-v3-turbo-image-to-video"
}
13

Errors

HTTP 402

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "Insufficient balance"
}
14

Errors

HTTP 429

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "API key credit limit exceeded"
}
15

Errors

HTTP 409

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "The request uses features that are not supported for the selected model"
}
16

Errors

HTTP 429

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "Rate limit reached. Please retry later."
}
17

Errors

HTTP 503

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "Service under maintenance, please try again later"
}
18

Errors

HTTP 504

POST /api/v1/kling/image_to_video

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "The request timed out"
}
19

Errors

HTTP 404

GET /api/v1/kling/image_to_video/:id

Response schema
JSON
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Response example

JSON
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
20

Generated Code Samples

Use cURL directly, or install an SDK for your language. Each sample submits the validated request shown in this reference.

Install

Shell
pip install runapi-kling
PYTHON
import os
from runapi.kling import KlingClient

client = KlingClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.image_to_video.create(
  model="kling-o1",
  prompt="A gentle camera pan across the scene.",
  first_frame_image_url="https://file.runapi.ai/first-frame.png"
)