Video Generation
Create video generation tasks from a text prompt or a source image. The endpoint is asynchronous: create a task, then poll Task Status until it completes.
Generation consumes credits (base credits × duration × quality × output-count multipliers, see Pricing & Credits) and requires a valid Authorization: Bearer <API_KEY> header.
Create a video task
One endpoint covers every input shape: a single image_url (image-to-video), image_url + last_image_url (first/last frame), or image_url_list / video_url_list / audio_url_list (multiple reference images / videos / audios); omit all of them for text-to-video. The chosen model code must support that mode — see the Models page (Frame / Reference / Ref video / Ref audio columns). last_image_url is mutually exclusive with the three reference lists, and audio_url_list must accompany image or video references.
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Static video model code, e.g. "kling-3.0". The Models page lists every code with its allowed parameter values. |
| prompt | string | Required | Text description of the video to generate. Max length is per model (see Models page). |
| image_url | string | Optional | Public URL of the source image. When present the task runs as image-to-video. In first/last-frame mode this is the first frame; in reference mode it is merged into image_url_list. Image count / size / format limits are per model. |
| last_image_url | string | Optional | Public URL of the last frame image. First/last-frame mode only: must be sent together with image_url (first frame), and the model must support Frame (see Models page). Mutually exclusive with image_url_list. |
| image_url_list | array<string> | Optional | Multiple reference image URLs (a JSON array, or a comma-separated string). Reference mode only: the model must support Reference (see Models page); the total count (including image_url) must stay within the model's image limit. Mutually exclusive with last_image_url. |
| video_url_list | array<string> | Optional | Reference video URLs (a JSON array, or a comma-separated string; .mp4 / .mov). Reference mode only: the model must support Ref video (see Models page); the count must stay within the model's video limit. Mutually exclusive with last_image_url. |
| audio_url_list | array<string> | Optional | Reference audio URLs (a JSON array, or a comma-separated string; .mp3 / .wav). Reference mode only: the model must support Ref audio (see Models page); the count must stay within the model's audio limit. Must be sent together with image_url / image_url_list / video_url_list. Mutually exclusive with last_image_url. |
| ratio | string | Optional | Aspect ratio, e.g. "16:9", "9:16", "1:1". Allowed values and default vary by model. |
| quality | string | Optional | Output resolution tier (normalized to lowercase). Allowed values and default vary by model. |
| duration | int | Optional | Clip length in seconds. Allowed values and default vary by model. |
| video_num | int | Optional | Number of variants to generate, up to the model's max (1–4). Default 1. |
| sound | int | Optional | Sound effect switch: 1 on, 0 off. Only accepted on models marked with Sound on the Models page. |
| seed | int | Optional | Reproducibility seed. 0 = random. |
| negative_prompt | string | Optional | What to avoid in the output. |
curl -X POST "https://litvideo-api.litmedia.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "litai-5",
"prompt": "A neon-lit city street at night, cinematic drone shot",
"ratio": "16:9",
"duration": 5,
"quality": "720p"
}'
curl -X POST "https://litvideo-api.litmedia.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "kling-3.0",
"prompt": "Slow zoom-in, hair moving in the wind",
"image_url": "https://example.com/portrait.jpg",
"duration": 5,
"quality": "std"
}'
curl -X POST "https://litvideo-api.litmedia.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "vidu-q3-pro",
"prompt": "The scene morphs smoothly from dawn to dusk",
"image_url": "https://example.com/first.jpg",
"last_image_url": "https://example.com/last.jpg",
"duration": 5,
"quality": "1080p"
}'
curl -X POST "https://litvideo-api.litmedia.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "kling-3-omni",
"prompt": "A character walking through a neon alley",
"image_url_list": [
"https://example.com/ref-1.jpg",
"https://example.com/ref-2.jpg",
"https://example.com/ref-3.jpg"
],
"duration": 5,
"quality": "std"
}'
curl -X POST "https://litvideo-api.litmedia.ai/v1/videos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer lvsk-xxxxxxxxxxxxxxxx" \
-d '{
"model": "seedance-2.5",
"prompt": "Recreate the camera movement and rhythm of the reference video with the character from the reference images",
"image_url_list": [
"https://example.com/character-1.jpg",
"https://example.com/character-2.jpg"
],
"video_url_list": [
"https://example.com/motion-ref.mp4"
],
"audio_url_list": [
"https://example.com/voice-ref.mp3"
],
"duration": 10,
"quality": "720p"
}'
Response
On success, data carries the unique task identifier used to poll progress (tsk_ + 32 random hex characters, bound to your account):
{
"code": 200,
"msg": "success",
"data": {
"task_id": "tsk_9f2c8a17b34d6e05a1c2d3e4f5067890"
}
}
The model code and every parameter value are validated against the Models catalog before the task is created. Unknown codes, unsupported modes, oversized prompts or out-of-range values fail the request with an error envelope (code 1046).
Recommended flow
- Pick a model code from the Models page and check its supported parameter values.
- POST to
/v1/videosand store the returnedtask_id. - Poll Task Status (
GET /v1/tasks/{task_id}) every few seconds until the task succeeds or fails. - Download or display the result video URL from the status payload.