Skip to main content

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

const response = await fetch('https://api.tryhooked.ai/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,
    presetSettings: {
      mediaType: "ai-images",
      preset: "realistic",
      quality: "pro"
    },
    musicId: "2",
    aspectRatio: 'ratio_9_16',
    caption: {
      preset: 'beast',
      alignment: 'bottom',
      disabled: false
    },
    language: 'en',
    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

const createAIVideoFromPrompt = async () => {
  const response = await fetch('https://api.tryhooked.ai/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,
      presetSettings: {
        mediaType: 'ai-videos',
        preset: 'anime',
        quality: 'base'
      },
      musicId: 'music_ambient_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'modern',
        alignment: 'bottom',
        disabled: false
      },
      language: 'en',
      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.tryhooked.ai/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,
      media: [
        {
          id: 'intro_shot',
          type: 'video',
          title: 'Product Intro',
          url: 'https://your-cdn.com/intro.mp4',
          durationInFrames: 150,
          isAIGenerated: true
        },
        {
          id: 'demo_shot',
          type: 'video',
          title: 'Product Demo',
          url: 'https://your-cdn.com/demo.mp4',
          durationInFrames: 200,
          isAIGenerated: false
        },
        {
          id: 'feature_image',
          type: 'image',
          title: 'Feature Highlight',
          url: 'https://your-cdn.com/feature.jpg',
          durationInFrames: 75,
          isAIGenerated: false
        }
      ],
      musicId: 'music_upbeat_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'wrap1',
        alignment: 'bottom',
        disabled: false
      },
      presetSettings: {
        mediaType: 'media'
      },
      language: 'en',
      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

const createGamingVideo = async () => {
  const response = await fetch('https://api.tryhooked.ai/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,
      presetSettings: {
        mediaType: 'GAMEPLAY',
      },
      gameplaySettings: {
        selectedGame: 'minecraft',
        selectedVideo: 'parkour_gameplay_01'
      },
      musicId: 'music_upbeat_01',
      aspectRatio: 'ratio_9_16',
      caption: {
        preset: 'beast',
        alignment: 'top',
        disabled: false
      },
      language: 'en',
      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

Be specific: Include topic, tone, and target audience in your prompt for better script generation
Match media to content: Use AI_IMAGES for explainers, GAMEPLAY for gaming, custom media for brands
Choose duration wisely: 30s for quick tips, 60s for standard content, 90s for comprehensive guides, 120s for extended 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

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

Target Duration Guide

DurationUse CaseProcessing Time
30sQuick tips, single facts, viral hooks2-4 minutes
45sShort tutorials, product highlights3-5 minutes
60sStandard explainers, listicles4-6 minutes
90sComprehensive guides, deep dives6-10 minutes
120sExtended content, detailed tutorials8-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

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