Script to video
POST
/v1/script-to-videoFirst, generate the AI text-to-speech and corresponding background footage. Once the video is created, an apiFileId will be returned. You can then use this apiFileId with the GET /get-file endpoint to check the export status of the video. The export process typically takes about the same time as the video's duration.
Alternatively, you can provide a webhook URL to automatically receive the export status, eliminating the need to manually poll the /get-file endpoint.
Request
Script of the video. Supports VideoGen Markup Language (VGML).
Name of the voice for AI narration.
Volume level for the voice narration, ranging from 0 (silent) to 1 (loudest).
URL of the background music.
Volume level for the background music, ranging from 0 (silent) to 1 (loudest).
Font name for the captions text.
Font size for the captions text. 35 is tiny, 50 is small, 75 is medium, and 100 is large.
Font weight for the captions text. Some fonts support 400 (normal) and 700 (bold), whereas other fonts don't support multiple font weights. The rendered font weight will be the supported font weight closest to captionFontWeight.
Color of the captions text.
Red component of the color (0-255).
Green component of the color (0-255).
Blue component of the color (0-255).
Text justification of the captions.
Vertical alignment of the captions.
Stroke color of the captions text.
Stroke weight of the captions text. This determines the thickness of the border around each character of text. Normally ranges from 0 (no stroke) to 8 (thick stroke).
Style of the background behind the captions text.
Color of the background behind the captions text.
Border radius of the background behind the captions text, as a proportion of the smaller side length.
Opacity of the background behind the captions, ranging from 0 (fully hidden) to 1 (fully visible).
Captions are hidden for the entire video. Use VGML for more fine-grained control.
Aspect ratio of the video.
Width component of the aspect ratio.
Height component of the aspect ratio.
Minimum dimension of the video in pixels. Height and width will be calculated based on minDimensionPixels and aspectRatio.
URL for your webhook, which will receive a POST request with JSON body { apiFileId: string; apiFileSignedUrl: string } once the video is generated.
{
"script": "Machine learning is a technique where algorithms learn from data to make predictions or decisions without explicit programming... It powers applications like image recognition, natural language processing, and predictive analytics, continuously improving as it processes more data."
}
Request samples
Responses
Primary ID of video file to be generated.
{
"apiFileId": "874d3150-f0e3-435c-be3d-0936d892b7e7"
}