Picsart API Platform

Guides

Video generation

74 video models cover text-to-video, image-to-video, and video editing. Video takes longer than an image, so the SDK lets you either block on generate() or submit a job and poll.

These snippets reuse an ai client — see Quickstart for the createClient setup.

Standard parameters

The parameters most video models share. Exact params vary per model — each model page lists its full schema.

ParameterTypeDescription
promptrequiredstringText description of what to generate.
durationnumberLength in seconds.
aspectRatiostringOutput aspect ratio, e.g. 16:9, 1:1, 9:16.
resolutionstringOutput resolution, e.g. 720p, 1080p.
generateAudiobooleanAlso generate a matching audio track.
imageUrlsstring[]Input / reference image URLs.
startFramestringFirst-frame image URL.
endFramestringLast-frame image URL.

Text to video

Set the prompt, duration (seconds), and aspectRatio. Prefer submit() + result()so a slow job can't time out.

ts
// Video is long-running — submit the job, then poll for the result.
const handle = await ai.submit('veo-3.1', {
  prompt: 'A drone shot flying over a canyon at sunrise',
  duration: 8,
  aspectRatio: '16:9',
});

const result = await ai.result(handle, 'veo-3.1');
console.log(result.url); // video URL

Using start/end frame

Give the model a first and/or last keyframe and it fills in the motion between them. Pass each frame as a URL via startFrame and endFrame.

ts
// Animate between two keyframes — pass each as an image URL.
const handle = await ai.submit('kling-v3', {
  prompt: 'Smooth cinematic transition between the two frames',
  startFrame: 'https://cdn.example.com/first.jpg',
  endFrame: 'https://cdn.example.com/last.jpg',
  duration: 5,
});

const result = await ai.result(handle, 'kling-v3');
console.log(result.url);

Using reference images

Animate a still or steer the subject/style with one or more reference images passed through imageUrls. The CLI uploads a local file for you.

ts
// Animate a still / guide the subject with one or more reference images.
const handle = await ai.submit('veo-3.1', {
  prompt: 'Slow zoom out, gentle wind in the trees',
  imageUrls: ['https://cdn.example.com/frame.jpg'],
  duration: 5,
});

const result = await ai.result(handle, 'veo-3.1');
console.log(result.url);

Track progress

Subscribe to a submitted job for live status and progress updates before reading the final result.

ts
// Stream live status while a job runs.
const handle = await ai.submit('kling-v3', {
  prompt: 'a fox running through autumn leaves',
  duration: 5,
});

for await (const update of ai.subscribe(handle)) {
  console.log(update.status, update.progress);
}

const result = await ai.result(handle, 'kling-v3');
console.log(result.url);