Skip to main content
POST
/
v1
/
project
/
create
/
extend-video
Extend Video
curl --request POST \
  --url https://b8e35428b2f8.ngrok-free.app/api/v1/project/create/extend-video \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "media": "media_video123",
  "prompt": "The camera slowly zooms out revealing a beautiful sunset over the ocean",
  "targetDuration": 4,
  "generateAudio": true
}
'
{
  "success": true,
  "data": {
    "videoId": "vid_extend_abc123xyz",
    "projectId": "proj_extend_abc123xyz",
    "status": "STARTED"
  }
}
Try it out! Use the API playground on the right to test the Extend Video endpoint directly.

Overview

Extend Video uses AI (Veo 3.1) to intelligently continue and extend your videos. Perfect for:
  • Creating longer content from short clips
  • Generating smooth video continuations
  • Extending storytelling sequences
  • Producing extended versions of marketing videos
  • Automating video length optimization
Extensions are generated in segments of 4-8 seconds each. The AI analyzes the last frame of your video and generates a seamless continuation based on your prompt.

Endpoint

POST /v1/project/create/extend-video

Required Fields

media
string
required
Media ID of the video to extend (as a string)
prompt
string
required
Describe how the AI should continue the video (1-2000 characters)Example: “The camera continues to zoom out, revealing a cityscape at sunset with birds flying across the sky”

Optional Fields

name
string
Custom name for the project (max 100 characters)
targetDuration
number
default:4
Total duration to extend in seconds (4-60 seconds, must be multiple of 4)
  • Minimum: 4 seconds
  • Maximum: 60 seconds
  • Default: 4 seconds
generateAudio
boolean
default:true
Whether to generate audio for the extended portion
webhook
string
Webhook URL for status notifications (max 500 characters, must be HTTPS)
metadata
object
Custom metadata object (max 5KB JSON)

Request Examples

Basic Video Extension

const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.HOOKED_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    media: 'media_video123',
    prompt: 'The camera slowly zooms out revealing a beautiful sunset over the ocean',
    targetDuration: 8,
    generateAudio: true
  })
});

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

Extended Duration with Webhook

const extendVideoLonger = async () => {
  const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      media: 'media_marketing_clip',
      prompt: 'The product rotates smoothly as the background transitions from blue to purple with subtle particle effects',
      targetDuration: 16, // 16 seconds extension
      generateAudio: true,
      webhook: 'https://yoursite.com/webhook',
      metadata: {
        campaignId: 'product-launch-2024',
        videoType: 'marketing'
      }
    })
  });

  return await response.json();
};

Multiple Extensions

const extendVideoMultiple = async () => {
  const response = await fetch('https://api.tryhooked.ai/v1/project/create/extend-video', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.HOOKED_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Extended Story Video',
      media: 'media_story_video',
      prompt: 'The scene continues with smooth camera movement, transitioning through different environments while maintaining visual consistency',
      targetDuration: 32, // Will be processed in 4 segments of 8 seconds each
      generateAudio: true
    })
  });

  return await response.json();
};

Response

{
  "success": true,
  "data": {
    "videoId": "vid_extend_abc123xyz",
    "projectId": "proj_extend_abc123xyz",
    "status": "STARTED"
  }
}

Webhook Notification

When your extended video is ready, we’ll POST to your webhook URL (if configured):
Webhook Payload
{
  "status": "COMPLETED",
  "data": {
    "videoId": "vid_extend_abc123xyz",
    "status": "COMPLETED",
    "url": "https://cdn.tryhooked.ai/videos/abc123xyz.mp4",
    "shareUrl": "https://cdn.tryhooked.ai/shared/abc123xyz.mp4",
    "metadata": {
      "projectId": "proj_extend_abc123xyz",
      "originalDuration": "5s",
      "extendedDuration": "13s"
    }
  },
  "message": "Video completed"
}

How It Works

1

Upload Source Video

Provide your source video that you want to extend
2

AI Analysis

Veo 3.1 analyzes the last frame and video motion patterns
3

Generate Extensions

AI generates extension segments (8 seconds each) based on your prompt
4

Seamless Concatenation

All segments are seamlessly concatenated with the source video
5

Final Output

Receive your extended video with smooth transitions

Best Practices

Clear Prompts

Describe the continuation clearly and specifically for best results

Match Style

Reference the visual style of your source video in the prompt

Realistic Durations

Start with 8-16 seconds to ensure quality, then scale up

Audio Consistency

Enable generateAudio for better continuity with the source

Prompt Writing Tips

Good Prompts

✅ “The camera continues to pan right, revealing a mountain range at golden hour with soft clouds drifting across the sky” ✅ “The dancer spins gracefully as the lighting shifts from warm orange to cool blue” ✅ “The product rotates smoothly on the pedestal while particles float upward in the background”

Avoid

❌ “Continue the video” (too vague) ❌ “Make it longer” (no direction) ❌ “Add random stuff” (unclear intent)

Error Handling

ErrorDescriptionSolution
media: A video is requiredMissing or invalid media IDProvide a valid video media ID
Media not foundMedia ID doesn’t existCheck that the media ID is correct and exists
Media is not a videoMedia is not a video typeEnsure the media ID points to a video, not an image
prompt: Prompt is requiredMissing promptProvide a descriptive prompt for the extension
targetDuration: Target duration must be at least 4 secondsDuration too shortUse minimum 4 seconds
targetDuration: Target duration cannot exceed 60 secondsDuration too longUse maximum 60 seconds
aspectRatio: Invalid enum valueInvalid aspect ratioUse ratio_9_16, ratio_16_9, or ratio_1_1
Not enough creditsInsufficient creditsTop up your account credits

Processing Time

Extension processing time varies based on:
  • Target Duration: Longer extensions take more time (each 8-second segment ~2-3 minutes)
  • Audio Generation: Enabling audio adds processing time
  • Queue Load: Peak times may have longer waits
Typical processing times:
  • 8 seconds: 2-3 minutes
  • 16 seconds: 4-6 minutes
  • 32 seconds: 8-12 minutes
  • 60 seconds: 15-20 minutes

Next Steps

Authorizations

x-api-key
string
header
required

Body

application/json
media
string
required

Media ID from uploaded video

prompt
string
required

Describe how the AI should continue the video

Required string length: 1 - 2000
targetDuration
number
default:4

Total duration to extend in seconds (must be multiple of 4)

Required range: 4 <= x <= 60
generateAudio
boolean
default:true

Whether to generate audio for the extended portion

name
string

Custom name for the project

Maximum string length: 100
webhook
string

HTTPS URL for status notifications (max 500 characters)

Maximum string length: 500
metadata
object

Custom metadata object (max 5KB)

Response

Extend Video created successfully

success
boolean
data
object