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

# Prompt to Video Example

> Create videos from prompts with AI-generated scripts and media

## Overview

Transform text prompts into engaging videos with AI-generated scripts, voice narration and auto-generated or custom visuals. Prompt to Video is perfect for quick content creation, educational videos, social media content, and marketing materials without writing scripts.

## With AI-Generated Images

```javascript theme={null}
const response = await fetch('https://api.hooked.so/v1/project/create/prompt-to-video', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: 'Create an engaging video about the top 5 productivity tips for remote workers. Include practical advice and make it motivational.',
    voiceId: 'confident_voice_id',
    targetDuration: 60,
    mediaType: "ai-images",
    presetSettings: {
      preset: "realistic",
      quality: "pro"
    },
    musicId: "2",
    aspectRatio: 'ratio_9_16',
    caption: {
      preset: 'beast',
      alignment: 'bottom',
      disabled: false
    },
    addStickers: true,
    audio: {
      speed: 1,
      stability: 0.5,
      similarityBoost: 0.75,
      style: 0,
      useSpeakerBoost: true
    },
    webhook: 'https://yoursite.com/webhook',
    metadata: {
      contentType: 'educational',
      topic: 'productivity'
    }
  })
});

const data = await response.json();
console.log('Video ID:', data.data.videoId);
console.log('Project ID:', data.data.projectId);
```

## With AI-Generated Videos

```javascript theme={null}
const createAIVideoFromPrompt = async () => {
  const response = await fetch('https://api.hooked.so/v1/project/create/prompt-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'AI Technology Explainer',
      prompt: 'Explain how artificial intelligence is transforming the way we work and live. Cover smart assistants, self-driving cars, and future applications.',
      voiceId: 'confident_voice_id',
      targetDuration: 60,
      mediaType: 'ai-videos',
      presetSettings: {
        preset: 'anime',
        quality: 'base'
      },
      musicId: 'music_ambient_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'modern',
        alignment: 'bottom',
        disabled: false
      },
      addStickers: true,
      audio: {
        speed: 1,
        stability: 0.5,
        similarityBoost: 0.75,
        style: 0,
        useSpeakerBoost: true
      },
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        contentType: 'educational',
        topic: 'artificial-intelligence'
      }
    })
  });

  return await response.json();
};
```

## With Custom Media

```javascript theme={null}
const createCustomMediaVideo = async () => {
  const response = await fetch('https://api.hooked.so/v1/project/create/prompt-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Product Showcase',
      prompt: 'Create a compelling product introduction video. Highlight the revolutionary features that make life easier and more productive.',
      voiceId: 'enthusiastic_voice_id',
      targetDuration: 45,
      mediaType: 'media'
      media: ['intro_shot', 'demo_shot', 'feature_image'],
      musicId: 'music_upbeat_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'wrap1',
        alignment: 'bottom',
        disabled: false
      },
      addStickers: true,
      audio: {
        speed: 1,
        stability: 0.5,
        similarityBoost: 0.75,
        style: 0,
        useSpeakerBoost: true
      },
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        contentType: 'marketing',
        topic: 'product-launch'
      }
    })
  });

  return await response.json();
};
```

## With Gameplay

```javascript theme={null}
const createGamingVideo = async () => {
  const response = await fetch('https://api.hooked.so/v1/project/create/prompt-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Gaming Tips Video',
      prompt: 'Create a video with three pro tips to level up gaming skills and dominate opponents. Make it energetic and engaging for gamers.',
      voiceId: 'energetic_voice_id',
      targetDuration: 45,
      mediaType: 'GAMEPLAY',
      gameplaySettings: {
        selectedGame: 'minecraft',
        selectedVideo: 'parkour_gameplay_01'
      },
      musicId: 'music_upbeat_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'beast',
        alignment: 'top',
        disabled: false
      },
      addStickers: true,
      audio: {
        speed: 1,
        stability: 0.5,
        similarityBoost: 0.75,
        style: 0,
        useSpeakerBoost: true
      },
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        contentType: 'gaming',
        topic: 'tips'
      }
    })
  });

  return await response.json();
};
```

## Tips for Prompt to Video

<Tip>**Be specific**: Include topic, tone, and target audience in your prompt for better script generation</Tip>
<Tip>**Match media to content**: Use AI\_IMAGES for explainers, GAMEPLAY for gaming, custom media for brands</Tip>
<Tip>**Choose duration wisely**: 30s for quick tips, 60s for standard content, 90s for comprehensive guides, 120s for extended content</Tip>
<Tip>**Choose the right voice**: Match voice tone to your content - energetic for gaming, professional for business</Tip>
<Tip>**Use background music**: Add music to enhance engagement without overpowering the narration</Tip>

## Visual Style Presets

Available presets for the `presetSettings.preset` field (used with `ai-images` and `ai-videos` media types):

| Preset                   | Description                                                                                  |
| ------------------------ | -------------------------------------------------------------------------------------------- |
| `realistic`              | Pure photorealistic style with natural lighting and lifelike details                         |
| `anime`                  | Classic anime style with large expressive eyes, vibrant colors, clean line art               |
| `cinematic`              | Hollywood movie cinematography with dramatic lighting and wide shots                         |
| `fantasy`                | Epic fantasy art with magical elements, mythical creatures, enchanted environments           |
| `cyberpunk-anime`        | Futuristic anime style with neon colors, cybernetic elements, dystopian atmosphere           |
| `pixar`                  | 3D animated style inspired by Pixar with smooth rendering and expressive characters          |
| `comic-book`             | American comic book style with bold colors, dynamic action, superhero aesthetics             |
| `real-anime`             | Realistic anime style blending photorealistic elements with anime aesthetics                 |
| `ghibli-studio`          | Studio Ghibli animation style with soft colors, whimsical characters, magical atmosphere     |
| `sketch-black-and-white` | Monochrome pencil sketch with detailed shading and artistic line work                        |
| `art-style`              | Fine art style with painterly techniques, artistic composition, classical aesthetics         |
| `retro-anime`            | 1980s-90s anime aesthetic with vintage color palette and classic animation style             |
| `80s-fantasy-movie`      | Retro 80s fantasy film aesthetic with practical effects, vibrant colors                      |
| `cartoon`                | Classic cartoon style with bold outlines, flat colors, exaggerated features                  |
| `creative`               | Abstract creative style with experimental techniques and innovative artistic approaches      |
| `gta-v`                  | Grand Theft Auto V video game style with urban aesthetic and satirical tone                  |
| `sketch-color`           | Colored sketch with vibrant markers and artistic illustration techniques                     |
| `japanese-ink`           | Traditional Japanese sumi-e ink painting with black ink, red accents, flowing brushstrokes   |
| `space-marines-40k`      | Warhammer 40K Space Marines style with power armor, gothic architecture, grimdark atmosphere |
| `haunted-linework`       | Gothic horror style with intricate linework, dark atmosphere, supernatural elements          |
| `ink-style`              | Modern ink art with dynamic strokes, abstract elements, energetic composition                |
| `neon-futuristic`        | Cyberpunk aesthetic with bright neon colors, futuristic technology, sci-fi atmosphere        |
| `minecraft`              | Blocky pixel art style inspired by Minecraft with cubic shapes and vibrant colors            |
| `pixel-art`              | 8-bit and 16-bit pixel art style with retro gaming aesthetics and limited color palette      |
| `collage`                | Mixed media collage with newspaper elements, geometric shapes, layered textures              |
| `lego`                   | LEGO brick style with plastic toy aesthetic and modular construction elements                |
| `technical-blueprints`   | Engineering blueprint style with technical drawings, measurements, schematic details         |

## Media Types

| Type           | Best For                                      |
| -------------- | --------------------------------------------- |
| `ai-images`    | Educational content, explainers, storytelling |
| `ai-videos`    | Dynamic content, trailers, teasers            |
| `media`        | Stock footage for generic content             |
| `gameplay`     | Gaming tips, tutorials, compilations          |
| Custom `media` | Brand content, product showcases              |

## Caption Presets

Available caption presets for the `caption.preset` field:

| Preset    | Description                                              |
| --------- | -------------------------------------------------------- |
| `default` | Default caption style with bold text and shadow effects  |
| `beast`   | Bold uppercase style with Komika font                    |
| `umi`     | Yellow glowing text style                                |
| `tiktok`  | Viral & trendy style, perfect for social media           |
| `wrap1`   | Wrapped style with red background highlight              |
| `wrap2`   | Wrapped style with blue background highlight (uppercase) |
| `ariel`   | Bold uppercase style with purple highlight               |
| `hooked`  | Brand style with purple background                       |
| `classic` | Clean, simple captions with black background (Default)   |
| `active`  | Green background with bold text                          |
| `bubble`  | White background bubble style                            |
| `glass`   | Glassmorphic transparency effect                         |
| `comic`   | Comic Sans font with colorful style                      |
| `glow`    | Pink and orange glow effects                             |
| `pastel`  | Soft pastel pink background                              |
| `neon`    | Green neon glow effect                                   |
| `retroTV` | Retro TV style with cyan glow                            |
| `red`     | Red glow effect with white text                          |
| `marker`  | Yellow marker/highlighter style                          |
| `modern`  | Contemporary white background style                      |
| `blue`    | Blue background style                                    |
| `vivid`   | Vibrant pink background with uppercase text              |

***

## Target Duration Guide

| Duration | Use Case                              | Processing Time |
| -------- | ------------------------------------- | --------------- |
| 30s      | Quick tips, single facts, viral hooks | 2-4 minutes     |
| 45s      | Short tutorials, product highlights   | 3-5 minutes     |
| 60s      | Standard explainers, listicles        | 4-6 minutes     |
| 90s      | Comprehensive guides, deep dives      | 6-10 minutes    |
| 120s     | Extended content, detailed tutorials  | 8-15 minutes    |

***

## Use Cases

* **Quick Content Creation**: Generate videos from simple descriptions without writing scripts
* **Educational Content**: Explainers, tutorials, how-to videos
* **Social Media**: TikTok, Instagram Reels, YouTube Shorts
* **Marketing**: Product showcases, brand stories, promotions
* **Gaming**: Tips, tutorials, compilations
* **News & Updates**: Company announcements, industry updates

## Handling the Webhook Response

```javascript theme={null}
// Express.js webhook handler
app.post('/webhook', (req, res) => {
  const { data, status, message } = req.body;

  if (status === "COMPLETED") {
    const { videoId, status: videoStatus, url, shareUrl, metadata } = data;
    console.log('Video completed!');
    console.log('Video ID:', videoId);
    console.log('Download URL:', url);
    console.log('Share URL:', shareUrl);
    console.log('Content Type:', metadata.contentType);

    // Save to your database, notify team, etc.
  }

  res.status(200).send('OK');
});
```
