Video Generation
Generate videos from text or images asynchronously, with optional audio, resolution and aspect-ratio control.
/v1/videos/generationsVideo 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:
| Model | Rates (credits / second) |
|---|---|
grok-imagine-video-1.5-lite | 480p = 44 · 720p = 66 · 1080p = 308: +22 per input image |
wan-3 | 480p = 55 · 720p = 110 · 1080p = 220: audio included at the same rate |
veo-3.1-lite | 720p = 66 (110 with audio) · 1080p = 110 (176 with audio) |
hailuo-3-max | 480p = 106 · 768p = 170 |
hailuo-2.3 | 1080p = 173: 6s or 10s only |
seedance-2-fast | 480p = 176 · 720p = 373 |
veo-3.1-fast | 720p = 176 (219 with audio) · 1080p = 219 (263 with audio) |
seedance-2 | 480p = 219 · 720p = 483 |
wan-2.6 | 720p = 219 · 1080p = 329 |
seedance-2.5 | 480p = 230 · 720p = 508: audio included at the same rate |
hailuo-3 | 2K = 276: audio included at the same rate |
heygen-avatar-6-turbo | 1080p = 115.783 · 2K = 202.621: billed as a reserve, see below |
heygen-avatar-6 | 1080p = 231.567 · 2K = 335.772: billed as a reserve, see below |
kling-v3-motion-control | 720p = 277 · 1080p = 369: billed as a reserve, see below |
kling-v4 | 720p = 338 · 1080p = 505, with an input video: 202 / 303 per billed second, see below |
kling-v3 | 720p = 369 (553 with audio) · 1080p = 492 (738 with audio) · 4K = 922 |
veo-3.1 | 720p 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.
| Model | Duration (s) | Resolutions (default first) | Aspect ratios | Audio | Extras |
|---|---|---|---|---|---|
seedance-2 | 1–15, or -1 auto | 480p, 720p | 16:9, 9:16, 1:1, 4:3, 3:4, adaptive | generate_audio, same rate | seed, last_frame_image_url, reference_* arrays |
seedance-2-fast | 1–15, or -1 auto | 480p, 720p | 16:9, 9:16, 1:1, 4:3, 3:4, adaptive | generate_audio, same rate | seed, last_frame_image_url, reference_* arrays |
seedance-2.5 | 4–15 | 480p, 720p | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive | generate_audio, same rate | seed, last_frame_image_url, reference_images, reference_audios |
wan-2.6 | 5 or 10 only | 720p, 1080p | 16:9, 9:16 | generate_audio, same rate | seed; first frame only |
wan-3 | 2–15 | 720p, 480p, 1080p | 16:9, 9:16, 1:1, 4:3, 3:4 | Always on, same rate | seed, negative_prompt; first frame only |
hailuo-3-max | 5–15 | 768p, 480p | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | No audio | last_frame_image_url |
hailuo-3 | 5–15 | 2K | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | generate_audio, same rate | last_frame_image_url |
hailuo-2.3 | 6 or 10 only | 1080p | 16:9 | No audio | First frame only |
kling-v4 | 3–30 | 720p, 1080p | 16:9, 9:16, 1:1, 21:9 | Always on, same rate | middle_images, base_video_url, last_frame_image_url, reference_images, reference_videos: see below |
kling-v3 | 3–15 | 720p, 1080p, 4K | 16:9, 9:16, 1:1 | generate_audio, surcharge except at 4K | negative_prompt, last_frame_image_url |
heygen-avatar-6-turbo | Follows the recording (1 to 60) | 1080p, 2K | Follows the photo | Carries the recording | audio_url: see below |
heygen-avatar-6 | Follows the recording (1 to 60) | 1080p, 2K | Follows the photo | Carries the recording | audio_url: see below |
kling-v3-motion-control | Follows reference video | 1080p, 720p | Derived from inputs | keep_original_sound | reference_video_url, character_orientation: see below |
veo-3.1 | 4, 6 or 8 only | 720p, 1080p | 16:9, 9:16 | generate_audio, surcharge | last_frame_image_url |
veo-3.1-fast | 4, 6 or 8 only | 720p, 1080p | 16:9, 9:16 | generate_audio, surcharge | last_frame_image_url |
veo-3.1-lite | 4, 6 or 8 only | 720p, 1080p | 16:9, 9:16 | generate_audio, surcharge | last_frame_image_url |
grok-imagine-video-1.5-lite | 1–15 | 720p, 480p, 1080p | 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3 | No switch | First 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
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Any video model ID from the table above. |
prompt | string | Yes | Text description of the scene and motion. |
duration | integer | No | Seconds, 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). |
resolution | string | No | One of the model's resolutions. Omitted, the model's default is used and billed. |
aspect_ratio | string | No | One 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_audio | boolean | No | Synthesize 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_prompt | string | No | What to avoid in the output. kling-v3 and wan-3 only. |
seed | integer | No | Fixes output for reproducibility. Seedance models, wan-2.6 and wan-3 only. |
image_url | string | No* | 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_url | string | No | Last-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_images | string[] | No | kling-v4 only: keyframes between the first and last frame, in order. Counts toward the 10-image total. |
base_video_url | string | No | kling-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_images | string[] | No | Up 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_videos | string[] | No | Up 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_audios | string[] | No | Up to 3 URLs. Requires image_url or reference_images. Referenced as [Audio1], … Seedance models only. |
reference_video_url | string | Yes* | kling-v3-motion-control only: 3–30s motion reference video whose movement is transferred onto the character image. |
character_orientation | string | No | kling-v3-motion-control only: output framing follows "image" (max 10s) or "video" (max 30s). Default "image". |
keep_original_sound | boolean | No | kling-v3-motion-control only: keep the reference video's audio track. Default true. |
audio_url | string | Yes* | 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.
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:
- 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. - 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. - The completed job reports the net charge:
tchavi.credits_used(net) andtchavi.credits_refunded, withoutput.durationset to the actual length. If the job fails, the full reserve is refunded.
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 reserveHeyGen 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) or2K.
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:
- 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
1080pholds 11 × 115.783 = 1,273.613 credits, the extra second is refunded on completion). Your balance must cover the hold. - 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.
- 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.
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 refundExample
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);
}