Skip to main content

Overview

This guide covers the whole lifecycle of an API video: choosing resources, creating the project, following it until the video is ready, and downloading it.

Step-by-step workflow

1. Authentication setup

.env
Get a key in Settings → Developer API.

2. Choose a format

Each format has its own endpoint, POST /v1/project/create/{format}: talking avatar, UGC Studio, script to video, prompt to video, slideshow, scenes and more. You send your script (or prompt) and the ids the format needs, so each video can be completely different. Creating videos lists every endpoint.

The workflow

Step 1: Fetch resources

The avatar and voice lists are paginated with limit (up to 100) and offset and return a total; the music list returns every track. They change rarely, so cache them.

Step 2: Select resources

Send the voice’s id as voiceId in create requests. A voice with unavailable: true is a cloned voice that only works in the key mode it was cloned in. Which ones a format needs: musicId is optional for most formats.

Step 3: Create the video

Store projectId right away. To resend a create that timed out, send it with the same Idempotency-Key; without one, check first.

Step 4: Monitor progress

Polling with GET /v1/project/{projectId}:
Use the project endpoint, not the video list: a project only appears in GET /v1/video/list once its render has started, and one that fails before that never appears there. Webhook: if you passed webhook, you get a POST with status: "COMPLETED" and data.url, or status: "FAILED". See Webhooks.

Step 5: Download

The link can be signed and expire. Keep your own copy; for a fresh link call GET /v1/project/{projectId} again.

Personalized videos

To make one video per customer, build the script from your data and tag the project with your own id:
The webhook payload and GET /v1/project/{projectId} both return the metadata, so you always know which customer a video belongs to. See Personalization for writing scripts per recipient. For many recipients, loop over your data with a small concurrency and your own ids in metadata. See Bulk Generation.

Re-rendering a project

If you edit a project in the dashboard editor after it was generated, render it again for free:
Then poll GET /v1/video/{videoId}, or wait for the webhook. Re-rendering never costs credits. A project whose editor timeline is still empty answers 400.

Complete example

Best practices summary

It is the only handle you need: GET /v1/project/{projectId} gives status, progress and the video.
Webhooks are tried 3 times and then dropped. Poll any project you have not heard about after a while.
Retry GETs freely. Retry a create only with the same Idempotency-Key; without one, check before re-sending.
Download finished videos to your storage; links can expire.

Next steps

Bulk Generation

Generate at scale

Error Handling

React to every error