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"]
}'
import requests
url = "https://app.hoox.video/api/public/v1/script/generate"
headers = {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
}
data = {
"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"]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://app.hoox.video/api/public/v1/script/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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"]
})
});
const data = await response.json();
console.log(data);
{
"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"
]
}
{
"error": "Validation failed",
"details": [
{
"code": "MISSING_FIELD",
"message": "Prompt is required",
"field": "prompt"
}
]
}
{
"error": "Insufficient credits. Required: 15, Available: 8",
"code": "INSUFFICIENT_CREDITS"
}
Script
Generate Script
Generate a video script from a prompt with cost estimation
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"]
}'
import requests
url = "https://app.hoox.video/api/public/v1/script/generate"
headers = {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
}
data = {
"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"]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://app.hoox.video/api/public/v1/script/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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"]
})
});
const data = await response.json();
console.log(data);
{
"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"
]
}
{
"error": "Validation failed",
"details": [
{
"code": "MISSING_FIELD",
"message": "Prompt is required",
"field": "prompt"
}
]
}
{
"error": "Insufficient credits. Required: 15, Available: 8",
"code": "INSUFFICIENT_CREDITS"
}
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
string
required
Text prompt describing the video content (max 10,000 characters).
number
default:"60"
Target video duration in seconds (10-600).
array
Array of web URLs to extract content from (max 10).
boolean
default:"false"
Enable web search to find additional relevant content.
Response
string
The generated video script.
number
Credits consumed for script generation.
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"]
}'
import requests
url = "https://app.hoox.video/api/public/v1/script/generate"
headers = {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
}
data = {
"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"]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://app.hoox.video/api/public/v1/script/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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"]
})
});
const data = await response.json();
console.log(data);
{
"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"
]
}
{
"error": "Validation failed",
"details": [
{
"code": "MISSING_FIELD",
"message": "Prompt is required",
"field": "prompt"
}
]
}
{
"error": "Insufficient credits. Required: 15, Available: 8",
"code": "INSUFFICIENT_CREDITS"
}
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: trueto 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
/voice/listand/avatar/listto select voice and avatar - Generate Video: Use the script in
/generation/startendpoint - Monitor Progress: Check status with
/generation/status/{job_id} - Export Video: Use
/export/startendpoint to export the video in the desired format - Monitor Export Progress: Check status with
/export/status/{job_id}
Was this page helpful?

