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

Prompt to script

POST
/v1/prompt-to-script
v1
Generate a video script from a prompt. This script can then be passed into POST /script-to-video to generate a video.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
prompt
string 
required
AI prompt that controls the script generation.
targetScriptWordCount
integer 
optional
Target word count for the generated script. Not exact, but VideoGen's AI will attempt to generate a script close to this word count.
outputLanguageCode
string 
optional
Two letter language code. See https://detectlanguage.com/languages for a list of supported language codes.
websiteUrls
array[string]
optional
List of website URLs to be scanned by VideoGen's AI and included along with the AI prompt to generate the script.
Example
{
  "prompt": "Best restaurants in San Francisco",
  "targetScriptWordCount": 50,
  "websiteUrls": [
    "https://www.chezmamanrestos.com/"
  ]
}

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/prompt-to-script' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "Best restaurants in San Francisco",
    "targetScriptWordCount": 50,
    "websiteUrls": [
        "https://www.chezmamanrestos.com/"
    ]
}'

Responses

🟢200Successfully generated script
application/json
Body
script
string 
required
Generated video script.
Example
{
  "script": "When I think of San Francisco’s culinary scene, Chez Maman instantly comes to mind. It’s not just a restaurant; it’s a cozy embrace of French nostalgia. The burgers with guacamole? Divine. The Brie and wine? A match made in heaven. It’s that perfect blend of comfort and elegance, inviting you to linger."
}
🟠400Failed to generate script
Modified at 2025-04-14 20:37:40
Previous
Script to video
Next
Get file