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, resolution-dependent: 480p = 260 cr/sec · 720p = 580 cr/sec. A typical 10-second 480p clip costs 2,600 credits. If a job fails after billing (upstream error, timeout), the charged credits are automatically refunded.

Parameters

ParameterTypeRequiredDescription
modelstringYesseedance-2 (ByteDance Seedance 2.0) or kling-v3 (Kuaishou Kling V3).
promptstringYesText description of the scene and motion.
durationintegerNoSeconds, 1–15. Use -1 for auto (billed at 10s). Default 5.
resolutionstringNo"480p" or "720p". Default "480p".
aspect_ratiostringNo16:9, 9:16, 1:1, 4:3, 3:4, or adaptive. Default "16:9".
generate_audiobooleanNoSynthesize a soundtrack (dialogue, SFX, music). Default true.
seedintegerNoFixes output for reproducibility.
image_urlstringNoFirst-frame reference (HTTP URL). Enables image-to-video.
last_frame_image_urlstringNoLast-frame target. Requires image_url.
reference_imagesstring[]NoUp to 9 URLs. Mutually exclusive with image_url. Referenced in the prompt as [Image1], [Image2], …
reference_videosstring[]NoUp to 3 URLs (combined ≤ 15 s). Referenced as [Video1], …
reference_audiosstring[]NoUp to 3 URLs. Requires image_url or reference_images. Referenced as [Audio1], …

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