Video Generation

Generate videos from text or images asynchronously, with optional audio, resolution and aspect-ratio control.

POST/v1/videos/generations

Video generation runs asynchronously: the endpoint returns a 202 with a job.id immediately, and the video renders in the background. Poll GET /v1/jobs/:id (see Async Jobs) until status becomes completed or failed. The SDK's createAndWait(...) helper does both in one call.

Billing is per second of output and depends on the model and resolution:

ModelRates (credits / second)
grok-imagine-video-1.5-lite480p = 44 · 720p = 66 · 1080p = 308: +22 per input image
wan-3480p = 55 · 720p = 110 · 1080p = 220: audio included at the same rate
veo-3.1-lite720p = 66 (110 with audio) · 1080p = 110 (176 with audio)
hailuo-3-max480p = 106 · 768p = 170
hailuo-2.31080p = 173: 6s or 10s only
seedance-2-fast480p = 176 · 720p = 373
veo-3.1-fast720p = 176 (219 with audio) · 1080p = 219 (263 with audio)
seedance-2480p = 219 · 720p = 483
wan-2.6720p = 219 · 1080p = 329
seedance-2.5480p = 230 · 720p = 508: audio included at the same rate
hailuo-32K = 276: audio included at the same rate
heygen-avatar-6-turbo1080p = 115.783 · 2K = 202.621: billed as a reserve, see below
heygen-avatar-61080p = 231.567 · 2K = 335.772: billed as a reserve, see below
kling-v3-motion-control720p = 277 · 1080p = 369: billed as a reserve, see below
kling-v4720p = 338 · 1080p = 505, with an input video: 202 / 303 per billed second, see below
kling-v3720p = 369 (553 with audio) · 1080p = 492 (738 with audio) · 4K = 922
veo-3.1720p and 1080p = 439 (878 with audio)

Each model's page shows its current rates. The table above is a snapshot. If a job fails after billing (upstream error, timeout), the charged credits are automatically refunded.

Concurrent jobs

An account can have 5 generation jobs running at once, counting everything still pending or processing. Music jobs share this limit, so five queued tracks will refuse a video. A sixth submission returns 429 rate_limit_exceeded with a Retry-After header telling you how many seconds to wait. That figure is a minimum backoff, not a promise that a slot will be free: a job can finish a second after we answer, so poll the jobs you already have and submit again as they finish.

This cap is separate from the RPM and TPM limits: video submissions are not counted against them. It can be raised for an account whose traffic shows it needs it, see Raising a limit.

Model limits

Every model takes the universal core (prompt, duration, resolution, aspect_ratio, image_url) with its own bounds. The default resolution is the one billed when you omit the field.

ModelDuration (s)Resolutions (default first)Aspect ratiosAudioExtras
seedance-21–15, or -1 auto480p, 720p16:9, 9:16, 1:1, 4:3, 3:4, adaptivegenerate_audio, same rateseed, last_frame_image_url, reference_* arrays
seedance-2-fast1–15, or -1 auto480p, 720p16:9, 9:16, 1:1, 4:3, 3:4, adaptivegenerate_audio, same rateseed, last_frame_image_url, reference_* arrays
seedance-2.54–15480p, 720p16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptivegenerate_audio, same rateseed, last_frame_image_url, reference_images, reference_audios
wan-2.65 or 10 only720p, 1080p16:9, 9:16generate_audio, same rateseed; first frame only
wan-32–15720p, 480p, 1080p16:9, 9:16, 1:1, 4:3, 3:4Always on, same rateseed, negative_prompt; first frame only
hailuo-3-max5–15768p, 480p21:9, 16:9, 4:3, 1:1, 3:4, 9:16No audiolast_frame_image_url
hailuo-35–152K21:9, 16:9, 4:3, 1:1, 3:4, 9:16generate_audio, same ratelast_frame_image_url
hailuo-2.36 or 10 only1080p16:9No audioFirst frame only
kling-v43–30720p, 1080p16:9, 9:16, 1:1, 21:9Always on, same ratemiddle_images, base_video_url, last_frame_image_url, reference_images, reference_videos: see below
kling-v33–15720p, 1080p, 4K16:9, 9:16, 1:1generate_audio, surcharge except at 4Knegative_prompt, last_frame_image_url
heygen-avatar-6-turboFollows the recording (1 to 60)1080p, 2KFollows the photoCarries the recordingaudio_url: see below
heygen-avatar-6Follows the recording (1 to 60)1080p, 2KFollows the photoCarries the recordingaudio_url: see below
kling-v3-motion-controlFollows reference video1080p, 720pDerived from inputskeep_original_soundreference_video_url, character_orientation: see below
veo-3.14, 6 or 8 only720p, 1080p16:9, 9:16generate_audio, surchargelast_frame_image_url
veo-3.1-fast4, 6 or 8 only720p, 1080p16:9, 9:16generate_audio, surchargelast_frame_image_url
veo-3.1-lite4, 6 or 8 only720p, 1080p16:9, 9:16generate_audio, surchargelast_frame_image_url
grok-imagine-video-1.5-lite1–15720p, 480p, 1080p16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3No switchFirst frame only; +22 credits per input image

A parameter a model does not accept returns 400 bad_request naming the parameter: nothing is silently dropped or emulated. Models that make only a few lengths (veo-3.1 (4, 6 or 8 s), wan-2.6 (5 or 10), hailuo-2.3 (6 or 10)) refuse any other with a 400 before anything is charged.

Parameters

ParameterTypeRequiredDescription
modelstringYesAny video model ID from the table above.
promptstringYesText description of the scene and motion.
durationintegerNoSeconds, within the model's bounds. seedance-2 and seedance-2-fast also accept -1 for auto (billed at 10s). Not accepted by kling-v3-motion-control (output length follows the reference video) nor by kling-v4 when base_video_url is set (the output follows that video). Default 5, or the next length the model makes (6 on the Veo 3.1 models and hailuo-2.3).
resolutionstringNoOne of the model's resolutions. Omitted, the model's default is used and billed.
aspect_ratiostringNoOne of the model's aspect ratios. Default "16:9". Not accepted by kling-v3-motion-control (framing derives from the inputs) nor by kling-v4 when image_url, middle_images, last_frame_image_url or base_video_url is set.
generate_audiobooleanNoSynthesize a soundtrack (dialogue, SFX, music). Default true. Not accepted by models without an audio switch (wan-3 and kling-v4 always have sound; hailuo-3-max, hailuo-2.3 and grok-imagine-video-1.5-lite have none). Omit it there; on kling-v3-motion-control use keep_original_sound.
negative_promptstringNoWhat to avoid in the output. kling-v3 and wan-3 only.
seedintegerNoFixes output for reproducibility. Seedance models, wan-2.6 and wan-3 only.
image_urlstringNo*First-frame reference (HTTP URL). Enables image-to-video. *Required for kling-v3-motion-control (the character to animate). Each input image adds 22 credits on grok-imagine-video-1.5-lite.
last_frame_image_urlstringNoLast-frame target. Requires image_url. Not accepted by wan-2.6, wan-3, hailuo-2.3, grok-imagine-video-1.5-lite or kling-v3-motion-control.
middle_imagesstring[]Nokling-v4 only: keyframes between the first and last frame, in order. Counts toward the 10-image total.
base_video_urlstringNokling-v4 only: a video to edit (3–30 s, MP4 or MOV). The output follows it, so do not send duration. It is @video_1 in the prompt.
reference_imagesstring[]NoUp to 9 URLs. Mutually exclusive with image_url. Referenced in the prompt as [Image1], [Image2], … Seedance models, and kling-v4: up to 10 images in total with the frames, no exclusion with image_url.
reference_videosstring[]NoUp to 3 URLs (combined ≤ 15 s). Referenced as [Video1], … seedance-2 and seedance-2-fast; on kling-v4, up to 5 videos in total with base_video_url, each 3–30 s and 30 s all together, referenced as @video_N.
reference_audiosstring[]NoUp to 3 URLs. Requires image_url or reference_images. Referenced as [Audio1], … Seedance models only.
reference_video_urlstringYes*kling-v3-motion-control only: 3–30s motion reference video whose movement is transferred onto the character image.
character_orientationstringNokling-v3-motion-control only: output framing follows "image" (max 10s) or "video" (max 30s). Default "image".
keep_original_soundbooleanNokling-v3-motion-control only: keep the reference video's audio track. Default true.
audio_urlstringYes*heygen-avatar-6 and heygen-avatar-6-turbo only: the speech recording the photo will say, 1 to 60 seconds, MP3, WAV or M4A.

Kling V4

kling-v4 is one model for every kind of input: a text prompt, a first and a last frame, keyframes in between, reference images, reference videos, or a video to edit. Output is 3–30 s (any whole second), 720p (default) or 1080p, 24 fps, in 16:9, 9:16, 1:1 or 21:9. Sound is always generated, so there is no generate_audio. seed, negative_prompt and audio inputs are not accepted. A generation can take several minutes.

Inputs. Up to 10 images in total across image_url (first frame), middle_images, last_frame_image_url and reference_images: unlike the other models, frames and reference images can be combined. Up to 5 videos in total across base_video_url and reference_videos, each 3–30 s and 30 s all together, MP4 or MOV. The prompt takes up to 26,000 characters in English or 11,000 in other languages (mixed text counts proportionally).

Naming inputs in the prompt. Images are @image_1, @image_2, … numbered in this order: the first frame, then the middle images, then the last frame, then the reference images. Only the images you send are counted. Videos are @video_1, … with the video to edit first, then the reference videos.

Ratio and duration. With image_url, middle_images, last_frame_image_url or base_video_url, the ratio comes from your inputs: do not send aspect_ratio. With base_video_url, the output follows the video: do not send duration. Either one returns a 400.

Billing. Without an input video: 338 credits per second of output at 720p, 505 at 1080p. With any input video (reference videos or a video to edit), the rate is 202 (720p) or 303 (1080p) credits per billed second, where billed seconds are the output length plus the longer of the total input video length and the output length. A 5 s output with a 7 s reference video bills 5 + 7 = 12 s, so 12 × 202 = 2,424 credits at 720p. Editing a 6 s video bills 6 + 6 = 12 s.

@tchavi/sdk
const job = await client.videos.generations.createAndWait({
  model: 'kling-v4',
  prompt: '@image_1 turns toward the camera and smiles, wearing the jacket from @image_2',
  resolution: '720p',
  duration: 5,
  image_url: 'https://your-host.example.com/first-frame.jpg', // @image_1
  reference_images: ['https://your-host.example.com/jacket.jpg'], // @image_2
  // no `aspect_ratio` (it comes from the image), no `generate_audio` (sound is always on)
});

Motion control billing

kling-v3-motion-control has no duration parameter. Sending one returns a 400. The output length is decided by the reference video (capped at 10s with character_orientation: "image", 30s with "video"), so credits are billed reserve-then-refund:

  1. At submit, the reference video's length is read and that many seconds × the per-second rate is held (e.g. a 3s reference at 1080p → 3 × 369 = 1,107 credits). If the length cannot be read, the orientation cap is held instead (10 × 369 = 3,690 for "image"). Your balance must cover the hold.
  2. On completion, the actual output length is measured and the hold is settled both ways: an unused part is refunded, and an overrun is charged before the video is released. If your balance cannot cover an overrun, the job fails with error.code: "reserve_exceeded", the hold is kept and no video is delivered. This only happens when a reference video's metadata understates its real length.
  3. The completed job reports the net charge: tchavi.credits_used (net) and tchavi.credits_refunded, with output.duration set to the actual length. If the job fails, the full reserve is refunded.
@tchavi/sdk
const job = await client.videos.generations.createAndWait({
  model: 'kling-v3-motion-control',
  prompt: 'The character performs the dance, keeping its exact appearance',
  resolution: '1080p',
  image_url: 'https://your-host.example.com/character.png',
  reference_video_url: 'https://your-host.example.com/motion-reference.mp4',
  character_orientation: 'image', // max 10s output
  keep_original_sound: true,
  // no `duration` — output length follows the reference video
});

console.log(job.output?.duration); // actual seconds rendered
console.log(job.tchavi?.credits_used); // net charge after refund
console.log(job.tchavi?.credits_refunded); // unused part of the reserve

HeyGen Avatar 6

heygen-avatar-6 and heygen-avatar-6-turbo are made by HeyGen. They turn one photo of a person and one speech recording into a video of that person saying it, lips moving with the words. You write no script and choose no voice: the recording is the voice, and its length sets the length of the video. On Tchavi, Avatar 6 Turbo costs half as much per second as Avatar 6 at 1080p; HeyGen states no other difference between them, and we have measured only Turbo.

Consent. Use only photos of people who have agreed to it: no photos of minors, and no public figures without their consent. That is HeyGen's own policy. Your photo, your recording and the finished video are deleted after 24 hours, so download the video.

What you send.

  • image_url, required: the photo. Send the largest one you have, a clear face looking at the camera, eyes visible, mouth closed. A small photo is enlarged and looks soft.
  • audio_url, required: the recording, 1 to 60 seconds, MP3, WAV or M4A, 12 MB at most. End it with 0.2 to 0.3 seconds of silence, because the video can stop about 0.1 s before the recording does. You can make the recording with one of our speech models.
  • prompt, optional: a direction for gestures and expression, for example a smile or a nod.
  • resolution, optional: 1080p (default) or 2K.

These are refused with a 400 naming the parameter: duration, aspect_ratio, generate_audio, seed, negative_prompt and every reference_* field. The video keeps the shape of your photo.

Billing. Per second of output, rounded up to the whole second, charged as a reserve like motion control:

  1. At submit, the recording's length is read and that many seconds × the per-second rate is held, with a margin of 0.05 s so frame rounding cannot leave the hold short, never above 60 s (a 10 s recording at Turbo 1080p holds 11 × 115.783 = 1,273.613 credits, the extra second is refunded on completion). Your balance must cover the hold.
  2. On completion, the real video is measured (the same 0.05 s margin applies before rounding up) and the hold is settled both ways: an unused part is refunded, an overrun is charged before the video is released.
  3. If the job fails, the full reserve is refunded.

What we measured, on Turbo only. One run on 2026-11-20, a French line of 2.24 s, 1080p, a 4:5 photo: the video came back in 38 s. The lips closed on five of the six b, m and p sounds, on time except one word, about a tenth of a second late. Asked for a smile and an open hand on the last words, it did both. One run is not a guarantee. For Avatar 6, HeyGen reports from its own study that 84.4% of results were judged indistinguishable from real footage side by side; we have not tested that.

@tchavi/sdk
const job = await client.videos.generations.createAndWait({
  model: 'heygen-avatar-6-turbo',
  prompt: 'She looks at the customer, smiles slightly, then opens her left hand toward him',
  resolution: '1080p',
  image_url: 'https://your-host.example.com/portrait.png',
  audio_url: 'https://your-host.example.com/line.mp3',
  // no `duration` or `aspect_ratio`: the recording and the photo decide
});

console.log(job.output?.duration); // actual seconds rendered
console.log(job.tchavi?.credits_used); // net charge after refund

Example

import Tchavi from '@tchavi/sdk';

const client = new Tchavi({ apiKey: 'YOUR_API_KEY' });

// One-liner: submit + poll until completed/failed
const job = await client.videos.generations.createAndWait({
  model: 'seedance-2',
  prompt: 'A cinematic shot of the Cotonou Amazone statue at golden hour',
  duration: 5,
  resolution: '480p',
  aspect_ratio: '9:16',
  generate_audio: true,
});

if (job.status === 'completed') {
  console.log('Video URL:', job.output?.video_url);
  console.log('Credits used:', job.tchavi?.credits_used);
} else {
  console.error('Failed:', job.error?.message);
}

On this page