Script to video
POST
/v1/script-to-videoFirst, generate AI text-to-speech and relevant background footage. Then, the apiFileId of the generated video is returned. Pass the apiFileId into the GET /get-file endpoint to poll for the exported video, which will take approximately as long as the duration of the exported video.
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.
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.
Minimum dimension of the video in pixels. Height and width will be calculated based on minDimensionPixels and aspectRatio.
{
"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"
}