Generation
Start Video Generation
Start generating a video from a prompt, script, or media files
POST
Overview
This endpoint initiates video generation using various input methods. You can generate videos from text prompts, custom scripts, or by providing your own media files (voice, avatar, images).Authentication
This endpoint requires API key authentication. Include your API key in the
Authorization header.Request Body
string
Text prompt describing the video content. Required if no script is provided.
number
Video duration in seconds (10-600). Required when using prompt.
string
Custom video script. Alternative to prompt-based generation.
string
ID of the voice to use. Get available voices from
/resources/voices endpoint.string
URL to a custom voice file (audio format: mp3, wav, m4a).
string
ID of the avatar look to use. Get available avatars from
/resources/avatars endpoint.string
URL to a custom avatar image/video file.
string
default:"vertical"
Video format:
vertical (9:16), square (1:1), ads (4:5), horizontal (16:9), or custom.number
Custom video width in pixels (max 5000). Only used when format is
custom. Defaults to 1080.number
Custom video height in pixels (max 5000). Only used when format is
custom. Defaults to 1920.array
Array of URLs to media files (images, videos) to include in the video.
array
Array of web URLs to extract content from (max 10).
object
boolean
default:"false"
Whether to animate static images using AI.
number
Maximum number of images to animate.
string
URL to receive webhook notifications when generation completes.
boolean
default:"true"
Whether to use media from your space library.
boolean
default:"true"
Whether to save generated media to your space library.
Response
string
Unique identifier for the generation job.
string
Current job status:
pending.number
Estimated credit cost for this generation.
Example
Input Methods
1. Prompt-based Generation
Provide aprompt and duration. The AI will generate a script and find relevant media.
2. Script-based Generation
Provide a customscript along with voice_id or voice_url.
3. Media-based Generation
Providevoice_url and/or avatar_url with custom media files.
Credit Costs
Generation costs depend on several factors:- Base cost: 5 credits every 30 seconds (with 15 seconds of buffer)
- Image animation: +5 credits per image
Next Steps
- Monitor Progress: Check status with
/generation/status/{job_id} - Export Video: Use
/export/startendpoint to export the video in the desired format - Monitor Export Progress: Check status with
/export/status/{job_id}
Error Codes
MISSING_CONTENT: No prompt, script, voice_url, or avatar_url providedMISSING_FIELD: Required duration missing when using promptMISSING_VOICE: No voice specified when using custom scriptINSUFFICIENT_CREDITS: Not enough credits availableINVALID_VOICE_ID: Voice ID not foundINVALID_AVATAR_ID: Avatar ID not foundINVALID_FORMAT: Invalid video format

