Skip to main content
These endpoints let you call the LLM directly to generate a script or search terms without triggering a full video generation task. Useful for previewing or customizing content before submitting to /api/v1/videos.

POST /api/v1/scripts

Generate a video script for a given topic.
curl -X POST http://localhost:8080/api/v1/scripts \
  -H "Content-Type: application/json" \
  -d '{
    "video_subject": "benefits of morning exercise",
    "video_language": "en",
    "paragraph_number": 1
  }'
{
  "status": 200,
  "message": "success",
  "data": {
    "video_script": "Starting your day with exercise is one of the most powerful habits you can build. Morning workouts boost energy, sharpen focus, and set a positive tone for the hours ahead..."
  }
}

Request parameters

video_subject
string
required
The topic or keyword for the script.
video_language
string
default:""
Language for the generated script (e.g. "en", "zh", "fr"). Leave empty for the LLM to decide based on the subject.
paragraph_number
integer
default:"1"
Number of paragraphs to generate. More paragraphs produce a longer script suitable for longer videos.

Response

video_script
string
The generated script text. Pass this as video_script in a /api/v1/videos request to use it directly.

POST /api/v1/terms

Generate footage search terms from a subject and script. These terms are used to query Pexels or Pixabay for relevant video clips.
curl -X POST http://localhost:8080/api/v1/terms \
  -H "Content-Type: application/json" \
  -d '{
    "video_subject": "benefits of morning exercise",
    "video_script": "Starting your day with exercise is one of the most powerful habits...",
    "amount": 5
  }'
{
  "status": 200,
  "message": "success",
  "data": {
    "video_terms": ["morning run", "gym workout", "sunrise fitness", "stretching", "healthy lifestyle"]
  }
}

Request parameters

video_subject
string
required
The topic of the video.
video_script
string
required
The video script to extract terms from.
amount
integer
default:"5"
Number of search terms to generate.

Response

video_terms
array of strings
List of search keywords. Pass this as video_terms in a /api/v1/videos request to control which footage is retrieved.

You can use these two endpoints to preview and refine your script and search terms before submitting to /api/v1/videos. This helps ensure the footage matches your intent without wasting a full generation run.

Build docs developers (and LLMs) love