Overview
This endpoint generates a video script from a text prompt. It’s useful for getting an accurate cost estimate before committing to full video generation, and for reviewing/editing the script before proceeding.Authentication
This endpoint requires API key authentication and consumes credits from your account.
Request Body
Text prompt describing the video content (max 10,000 characters).
Target video duration in seconds (10-600).
Array of web URLs to extract content from (max 10).
Enable web search to find additional relevant content.
Response
The generated video script.
Credits consumed for script generation.
Array of image URLs extracted from web sources (strings).
Credit Costs
Script generation costs are based on:- Base cost: 0.1 credits every 60 seconds
- Web search: +0.1 credits when enabled
- URL processing: +0.1 credits per URL
Script generation costs are separate from video generation costs.
Usage Tips
1. Content Enhancement
- Use
webSearch: true
to find relevant, up-to-date information - Provide specific URLs to extract content from predefined pages (like product page or article)
- Review extracted images to see what visual content was found
2. Script Customization
- Edit the generated script before using it in video generation
- Adjust prompt to match your brand voice and pacing
- Add specific product mentions or calls-to-action
Error Codes
MISSING_FIELD
: Prompt is requiredINVALID_TYPE
: Invalid parameter typeINVALID_VALUE
: Parameter value out of allowed rangeINSUFFICIENT_CREDITS
: Not enough credits for script generationSCRIPT_GENERATION_FAILED
: Failed to generate script
Next Steps
After generating a script:- Review and Edit: Modify the script to match your needs
- Choose Resources: Use
/resources/voices
and/resources/avatars
to select voice and avatar - Generate Video: Use the script in
/generation/start
endpoint - Monitor Progress: Check status with
/generation/status/{job_id}
- Export Video: Use
/export/start
endpoint to export the video in the desired format - Monitor Export Progress: Check status with
/export/status/{job_id}