Skip to main content

Overview

Transform written scripts into engaging videos with voice narration and auto-generated or custom visuals. Script to Video is perfect for educational content, social media videos, and marketing materials.

With AI-Generated Images

const response = await fetch('https://api.hooked.ai/v1/project/create/script-to-video', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    script: 'Artificial intelligence is transforming the way we work and live. From smart assistants to self-driving cars, AI is everywhere.',
    voiceId: 'confident_voice_id',
    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: 'artificial-intelligence'
    }
  })
});

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

With AI-Generated Videos

const createAIImageVideo = async () => {
  const response = await fetch('https://api.hooked.ai/v1/project/create/script-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'AI Technology Explainer',
      script: 'Artificial intelligence is transforming the way we work and live. From smart assistants to self-driving cars, AI is everywhere. Let\'s explore how this technology is shaping our future.',
      voiceId: 'confident_voice_id',
      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

const createCustomMediaVideo = async () => {
  const response = await fetch('https://api.hooked.ai/v1/project/create/script-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Product Showcase',
      script: 'Introducing our revolutionary new product. It\'s designed to make your life easier and more productive. Watch as we demonstrate its incredible features.',
      voiceId: 'enthusiastic_voice_id',
      media: ['intro_shot', 'demo_shot', 'feature_image'],
      musicId: 'music_upbeat_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'wrap1',
        alignment: 'bottom',
        disabled: false
      },
      mediaType: 'media',
      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 Gameplay

const createGamingVideo = async () => {
  const response = await fetch('https://api.hooked.ai/v1/project/create/script-to-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Gaming Tips Video',
      script: 'Want to level up your gaming skills? Here are three pro tips that will help you dominate your opponents. Tip one: always check your surroundings...',
      voiceId: 'energetic_voice_id',
      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: 'educational',
        topic: 'artificial-intelligence'
      }
    })
  });

  return await response.json();
};

Tips for Script to Video

Structure your script: Break content into clear sections with natural pauses for better pacing
Match media to content: Use AI_IMAGES for explainers, GAMEPLAY for gaming, custom media for brands
Keep it concise: 30-90 seconds works best for social media content
Choose the right voice: Match voice tone to your content - energetic for gaming, professional for business
Use background music: Add music to enhance engagement without overpowering the narration

Visual Style Presets

Available presets for the presetSettings.preset field (used with ai-images and ai-videos media types):
PresetDescription
realisticPure photorealistic style with natural lighting and lifelike details
animeClassic anime style with large expressive eyes, vibrant colors, clean line art
cinematicHollywood movie cinematography with dramatic lighting and wide shots
fantasyEpic fantasy art with magical elements, mythical creatures, enchanted environments
cyberpunk-animeFuturistic anime style with neon colors, cybernetic elements, dystopian atmosphere
pixar3D animated style inspired by Pixar with smooth rendering and expressive characters
comic-bookAmerican comic book style with bold colors, dynamic action, superhero aesthetics
real-animeRealistic anime style blending photorealistic elements with anime aesthetics
ghibli-studioStudio Ghibli animation style with soft colors, whimsical characters, magical atmosphere
sketch-black-and-whiteMonochrome pencil sketch with detailed shading and artistic line work
art-styleFine art style with painterly techniques, artistic composition, classical aesthetics
retro-anime1980s-90s anime aesthetic with vintage color palette and classic animation style
80s-fantasy-movieRetro 80s fantasy film aesthetic with practical effects, vibrant colors
cartoonClassic cartoon style with bold outlines, flat colors, exaggerated features
creativeAbstract creative style with experimental techniques and innovative artistic approaches
gta-vGrand Theft Auto V video game style with urban aesthetic and satirical tone
sketch-colorColored sketch with vibrant markers and artistic illustration techniques
japanese-inkTraditional Japanese sumi-e ink painting with black ink, red accents, flowing brushstrokes
space-marines-40kWarhammer 40K Space Marines style with power armor, gothic architecture, grimdark atmosphere
haunted-lineworkGothic horror style with intricate linework, dark atmosphere, supernatural elements
ink-styleModern ink art with dynamic strokes, abstract elements, energetic composition
neon-futuristicCyberpunk aesthetic with bright neon colors, futuristic technology, sci-fi atmosphere
minecraftBlocky pixel art style inspired by Minecraft with cubic shapes and vibrant colors
pixel-art8-bit and 16-bit pixel art style with retro gaming aesthetics and limited color palette
collageMixed media collage with newspaper elements, geometric shapes, layered textures
legoLEGO brick style with plastic toy aesthetic and modular construction elements
technical-blueprintsEngineering blueprint style with technical drawings, measurements, schematic details

Media Types

TypeBest For
ai-imagesEducational content, explainers, storytelling
ai-videosDynamic content, trailers, teasers
mediaStock footage for generic content
gameplayGaming tips, tutorials, compilations
Custom mediaBrand content, product showcases

Caption Presets

Available caption presets for the caption.preset field:
PresetDescription
defaultDefault caption style with bold text and shadow effects
beastBold uppercase style with Komika font
umiYellow glowing text style
tiktokViral & trendy style, perfect for social media
wrap1Wrapped style with red background highlight
wrap2Wrapped style with blue background highlight (uppercase)
arielBold uppercase style with purple highlight
hookedBrand style with purple background
classicClean, simple captions with black background (Default)
activeGreen background with bold text
bubbleWhite background bubble style
glassGlassmorphic transparency effect
comicComic Sans font with colorful style
glowPink and orange glow effects
pastelSoft pastel pink background
neonGreen neon glow effect
retroTVRetro TV style with cyan glow
redRed glow effect with white text
markerYellow marker/highlighter style
modernContemporary white background style
blueBlue background style
vividVibrant pink background with uppercase text

Use Cases

  • 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

// 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');
});