VideoGen API
  1. Text to Video
VideoGen API
  • Text to Video
    • Prompt to video
    • Prompt to outline
    • Outline to video
    • Get file
  • Resources
    • Get voices
    • Get languages
    • Get fonts
  • Examples
    • Interacting with the Video Outline
    • Polling vs Webhooks
  • v1
    • Text to Video
      • Script to video
        POST
      • Prompt to script
        POST
      • Get file
        GET
    • Resources
      • Get voices
      • Get languages
      • Get fonts
    • Examples
      • Generate a Video
  1. Text to Video

Script to video

POST
/v1/script-to-video
v1
First, 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

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
script
string 
required
Script of the video. Supports VideoGen Markup Language (VGML).
voice
string 
optional
Name of the voice for AI narration.
Default:
Matilda
voiceVolume
number 
optional
Volume level for the voice narration, ranging from 0 (silent) to 1 (loudest).
>= 0<= 1
Default:
1
musicUrl
string 
optional
URL of the background music.
musicVolume
number 
optional
Volume level for the background music, ranging from 0 (silent) to 1 (loudest).
>= 0<= 1
Default:
0.15
captionFontName
string 
optional
Font name for the captions text.
captionFontSize
number 
optional
Font size for the captions text. 35 is tiny, 50 is small, 75 is medium, and 100 is large.
captionFontWeight
number 
optional
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.
captionTextColor
object (Color) 
optional
Color of the captions text.
red
integer 
required
Red component of the color (0-255).
>= 0<= 255
green
integer 
required
Green component of the color (0-255).
>= 0<= 255
blue
integer 
required
Blue component of the color (0-255).
>= 0<= 255
captionTextJustification
enum<string> 
optional
Text justification of the captions.
Allowed values:
LEFTCENTERRIGHT
captionVerticalAlignment
enum<string> 
optional
Vertical alignment of the captions.
Allowed values:
TOPMIDDLEBOTTOM
captionStrokeColor
object (Color) 
optional
Stroke color of the captions text.
captionStrokeWeight
number 
optional
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).
captionBackgroundStyleType
enum<string> 
optional
Style of the background behind the captions text.
Allowed values:
RECTWRAPPED
captionBackgroundColor
object (Color) 
optional
Color of the background behind the captions text.
captionBackgroundBorderRadius
number 
optional
Border radius of the background behind the captions text, as a proportion of the smaller side length.
>= 0<= 1
captionBackgroundOpacity
number 
optional
Opacity of the background behind the captions, ranging from 0 (fully hidden) to 1 (fully visible).
captionIsHidden
boolean 
optional
Captions are hidden for the entire video. Use VGML for more fine-grained control.
aspectRatio
object (Aspect Ratio) 
optional
Aspect ratio of the video.
width
number 
required
Width component of the aspect ratio.
height
number 
required
Height component of the aspect ratio.
minDimensionPixels
integer 
optional
Minimum dimension of the video in pixels. Height and width will be calculated based on minDimensionPixels and aspectRatio.
<= 1080> 0
Default:
1080
webhookUrl
string 
optional
URL for your webhook, which will receive a POST request with JSON body { apiFileId: string; apiFileSignedUrl: string } once the video is generated.
Example
{
  "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

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://ext.videogen.io/v1/script-to-video' \
--header 'Content-Type: application/json' \
--data-raw '{
    "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."
}'

Responses

🟢200Successfully initiated video generation
application/json
Body
apiFileId
string 
required
Primary ID of video file to be generated.
Examples
{
  "apiFileId": "874d3150-f0e3-435c-be3d-0936d892b7e7"
}
🟠400Failed to initiate video generation
Modified at 2025-04-14 20:37:40
Previous
Polling vs Webhooks
Next
Prompt to script