Skip to main content
POST
/
api
/
public
/
v1
/
script
/
generate
curl -X POST "https://app.hoox.video/api/public/v1/script/generate" \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Create an educational video about renewable energy sources, focusing on solar and wind power",
    "duration": 90,
    "webSearch": true,
    "urls": ["https://www.energy.gov/renewable-energy"]
  }'
{
  "script": "In today's world, renewable energy has become more crucial than ever. Let's explore two of the most promising sources: solar and wind power.\n\nSolar energy harnesses the power of the sun through photovoltaic panels. These panels convert sunlight directly into electricity, providing a clean and abundant energy source. The technology has advanced significantly, making solar power more affordable and efficient than ever before.\n\nWind power, on the other hand, captures the kinetic energy of moving air through wind turbines. These towering structures can generate substantial amounts of electricity, especially in areas with consistent wind patterns.\n\nBoth technologies offer significant environmental benefits, reducing our dependence on fossil fuels and helping combat climate change. As we move forward, these renewable sources will play an increasingly important role in our energy future.",
  "cost": 15,
  "extractedImages": [
    "https://example.com/solar-panels.jpg",
    "https://example.com/wind-turbines.jpg",
    "https://example.com/renewable-energy-chart.png"
  ]
}

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

prompt
string
required
Text prompt describing the video content (max 10,000 characters).
duration
number
default:"60"
Target video duration in seconds (10-600).
urls
array
Array of web URLs to extract content from (max 10).
Enable web search to find additional relevant content.

Response

script
string
The generated video script.
cost
number
Credits consumed for script generation.
extractedImages
array
Array of image URLs extracted from web sources (strings).
curl -X POST "https://app.hoox.video/api/public/v1/script/generate" \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Create an educational video about renewable energy sources, focusing on solar and wind power",
    "duration": 90,
    "webSearch": true,
    "urls": ["https://www.energy.gov/renewable-energy"]
  }'
{
  "script": "In today's world, renewable energy has become more crucial than ever. Let's explore two of the most promising sources: solar and wind power.\n\nSolar energy harnesses the power of the sun through photovoltaic panels. These panels convert sunlight directly into electricity, providing a clean and abundant energy source. The technology has advanced significantly, making solar power more affordable and efficient than ever before.\n\nWind power, on the other hand, captures the kinetic energy of moving air through wind turbines. These towering structures can generate substantial amounts of electricity, especially in areas with consistent wind patterns.\n\nBoth technologies offer significant environmental benefits, reducing our dependence on fossil fuels and helping combat climate change. As we move forward, these renewable sources will play an increasingly important role in our energy future.",
  "cost": 15,
  "extractedImages": [
    "https://example.com/solar-panels.jpg",
    "https://example.com/wind-turbines.jpg",
    "https://example.com/renewable-energy-chart.png"
  ]
}

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 required
  • INVALID_TYPE: Invalid parameter type
  • INVALID_VALUE: Parameter value out of allowed range
  • INSUFFICIENT_CREDITS: Not enough credits for script generation
  • SCRIPT_GENERATION_FAILED: Failed to generate script

Next Steps

After generating a script:
  1. Review and Edit: Modify the script to match your needs
  2. Choose Resources: Use /resources/voices and /resources/avatars to select voice and avatar
  3. Generate Video: Use the script in /generation/start endpoint
  4. Monitor Progress: Check status with /generation/status/{job_id}
  5. Export Video: Use /export/start endpoint to export the video in the desired format
  6. Monitor Export Progress: Check status with /export/status/{job_id}
I