> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hoox.video/llms.txt
> Use this file to discover all available pages before exploring further.

# Script Generation

> Generate high-quality video scripts with AI, enhanced by web content extraction

## How Script Generation Works

The Hoox Script Generation API creates compelling video scripts using AI-powered text generation:

1. **Content Analysis**: Process your prompt and any provided URLs
2. **Web Enhancement**: Optionally search the web for additional context
3. **Script Creation**: Generate natural, engaging scripts tailored to your duration
4. **Image Extraction**: Extract relevant images from web sources for visual elements

## Result

The API returns a generated script along with cost information and extracted images when URLs are provided.

```json theme={null}
{
  "script": "Imagine having your entire world on your wrist. Our new smartwatch collection offers unparalleled health monitoring, fitness tracking, and connectivity.\n\nThe Series 11 starts at 449€, featuring advanced health sensors that detect hypertension, monitor sleep quality, and even track your menstrual cycle with wrist temperature readings.\n\nOur SE 3 delivers essential health features at just 269€, while the Ultra 3 offers premium adventure capabilities at 899€ with satellite communication and up to 72 hours of battery life.\n\nAll models include 5G connectivity, water resistance, and customizable bands in various styles and colors. With Apple Pay, music streaming, and thousands of apps, these watches truly complement your lifestyle.\n\nShare your thoughts below!",
  "cost": 0.2,
  "extractedImages": [
    "https://www.apple.com/v/watch/bs/images/overview/select/product_s11__c23ym6fc09me_large.png",
    "https://www.apple.com/v/watch/bs/images/overview/select/product_se__cbhd710p3auq_large.png",
    "https://www.apple.com/fr/watch/images/overview/select/product_u3__eh9hc0els5g2_large.png",
    "https://www.apple.com/v/watch/bs/images/overview/incentive/incentive_trade_in__dj8ydvx9fx4y_large.jpg"
  ]
}
```

### Image Extraction

When you provide URLs in your request, the system automatically extracts relevant images from those web pages. These extracted image URLs are returned in the `extractedImages` array.

**Why is this useful?** You can directly pass these extracted image URLs to the [Video Generation API](/api-reference/generation/start) using the `media_urls` parameter. This automatically incorporates the images from your source URLs into the generated video, creating a seamless content workflow.

## Parameters

### Required Parameters

#### Prompt

Your main instruction describing what the script should be about. Be specific about the tone, target audience, and key points you want covered.

```json theme={null}
{
  "prompt": "Create an educational script about artificial intelligence that explains its benefits and challenges for everyday users."
}
```

### Optional Parameters

#### Duration

Target script length in seconds (10-600). Defaults to 60 seconds.

```json theme={null}
{
  "prompt": "Create a comprehensive overview of renewable energy sources, covering solar, wind, and hydroelectric power.",
  "duration": 180
}
```

#### URLs

Array of web sources to incorporate into your script (max 10 URLs). The system automatically scrapes and analyzes these URLs without needing to enable web search.

```json theme={null}
{
  "prompt": "Create a compelling product presentation for our new smartwatch collection, highlighting the innovative health tracking features and battery life.",
  "urls": [
    "https://company.com/smartwatch-specs",
    "https://company.com/health-features"
  ]
}
```

<Tip>
  URLs are processed automatically - you don't need to enable `webSearch` for URL content extraction.
</Tip>

#### Web Search

Enable additional web research to enhance script content with current information.

```json theme={null}
{
  "prompt": "Create an informative script covering the latest developments in artificial intelligence",
  "webSearch": true
}
```

## Cost Structure

Transparent credit-based pricing:

* **Base Cost**: 0.1 credit per started 60-second segment
* **URL Processing**: +0.1 credit per URL
* **Web Search**: +0.1 credit when enabled

## Next Steps

<CardGroup cols={2}>
  <Card title="Video Generation" icon="video" href="/video-generation/overview">
    Learn how to generate videos from your scripts
  </Card>

  <Card title="Script Generation API" icon="code" href="/api-reference/script/generate">
    View the complete API documentation
  </Card>
</CardGroup>
