Generate Video

POST /api/v1/generate/video/

Create a new video generation task using Veo3. Credits are deducted immediately when generation starts.

Authentication Required: This endpoint requires authentication via Bearer or API Key.

Video Model Options

veo3_fast (Standard)

Faster generation, supports both text-to-video and image-to-video.

Credit Cost: 240 credits
Standard quality, faster processing
• Text-to-video + Image-to-video
• Faster generation (45-60 seconds)
• Standard quality

veo3 (Premium)

Higher quality, supports both text-to-video and image-to-video.

Credit Cost: 500 credits
Premium quality, more features
• Text-to-video + Image-to-video
• Longer generation (60-120 seconds)
• Premium quality

Model Capabilities

  • • veo3_fast: Text-to-video + Image-to-video - 240 credits, faster processing
  • • veo3: Text-to-video + Image-to-video - 500 credits, premium quality
  • • Both models now support source_image_urls for image-to-video generation

Request

Headers

Content-Type application/json
Authorization Bearer <your_token>

Body required

prompt required
string

Description of the video you want to generate. Max 1000 characters.

Example: "A cat playing in a garden with colorful flowers"
video_model optional
string

Video generation model to use. Defaults to 'veo3_fast' if not specified.

Options:
  • • "veo3_fast" - 240 credits, text-to-video + image-to-video
  • • "veo3" - 500 credits, text-to-video + image-to-video (premium quality)
Example: "veo3_fast"
source_image_urls optional
array

Array of image URLs to use as source for image-to-video generation. Supported with both 'veo3_fast' and 'veo3' models.

Both Models Supported: Works with "veo3_fast" (240 credits) and "veo3" (500 credits)
Example: ["https://example.com/cat.jpg", "https://example.com/garden.jpg"]
aspect_ratio optional
string

Video aspect ratio for different screen formats. Controls the width-to-height ratio of the generated video.

Possible values:
  • • "16:9" - Landscape/widescreen format (default)
  • • "9:16" - Portrait/vertical format (social media)
Example: "16:9"

Example Requests

veo3_fast - Text-to-Video with Aspect Ratio (240 credits)

{
  "prompt": "A cat playing in a garden with colorful flowers, sunny day",
  "video_model": "veo3_fast",
  "aspect_ratio": "16:9"
}

Default (veo3_fast) - Portrait Video (240 credits)

{
  "prompt": "A beautiful sunset over mountains with birds flying",
  "aspect_ratio": "9:16"
}

Note: Perfect for social media content like Instagram Stories, TikTok

veo3_fast - Image-to-Video (240 credits)

{
  "prompt": "The cat starts running and jumping through the garden",
  "video_model": "veo3_fast",
  "source_image_urls": [
    "https://example.com/cat-in-garden.jpg"
  ],
  "aspect_ratio": "16:9"
}

Note: veo3_fast now supports image-to-video at 240 credits vs 500 for veo3

veo3 - Portrait Video Premium (500 credits)

{
  "prompt": "A cat gracefully jumping through tall grass in slow motion",
  "video_model": "veo3",
  "aspect_ratio": "9:16"
}

veo3 - Image-to-Video Premium (500 credits)

{
  "prompt": "The cat starts running and playing with the flowers",
  "video_model": "veo3",
  "source_image_urls": [
    "https://example.com/cat-in-garden.jpg"
  ],
  "aspect_ratio": "16:9"
}

Responses

201 veo3_fast generation started

veo3_fast video generation started successfully

{
  "success": true,
  "data": {
    "generation_id": "uuid-here",
    "status": "processing",
    "generation_type": "video",
    "video_model": "veo3_fast",
    "estimated_time": "45-60 seconds",
    "credits_used": 240,
    "credits_remaining": 260,
    "mode": "text-to-video",
    "message": "Video generation started successfully"
  }
}
201 veo3 text-to-video started

veo3 text-to-video generation started successfully

{
  "success": true,
  "data": {
    "generation_id": "uuid-here",
    "status": "processing",
    "generation_type": "video",
    "video_model": "veo3",
    "estimated_time": "60-90 seconds",
    "credits_used": 500,
    "credits_remaining": 0,
    "mode": "text-to-video",
    "message": "Premium video generation started successfully"
  }
}
201 veo3 image-to-video started

veo3 image-to-video generation started successfully

{
  "success": true,
  "data": {
    "generation_id": "uuid-here",
    "status": "processing",
    "generation_type": "video",
    "video_model": "veo3",
    "estimated_time": "90-120 seconds",
    "credits_used": 500,
    "credits_remaining": 0,
    "mode": "image-to-video",
    "source_images_count": 1,
    "message": "Premium image-to-video generation started successfully"
  }
}
402 Payment Required (veo3_fast)

Insufficient credits for veo3_fast model

{
  "success": false,
  "error": "Insufficient credits. Need 240, have 100",
  "credits_needed": 240,
  "credits_balance": 100,
  "video_model": "veo3_fast",
  "generation_type": "video"
}
402 Payment Required (veo3)

Insufficient credits for veo3 premium model

{
  "success": false,
  "error": "Insufficient credits. Need 500, have 250",
  "credits_needed": 500,
  "credits_balance": 250,
  "video_model": "veo3",
  "generation_type": "video"
}
400 Bad Request

Invalid request parameters

{
  "success": false,
  "error": "Prompt is required",
  "details": {
    "prompt": "This field is required"
  }
}

Credit Costs by Model

Video generation costs vary by model selection and features:

Model Credits Supported Modes Generation Time Quality
veo3_fast 240 Text-to-video + Image-to-video 45-60 seconds Standard
veo3 500 Text-to-video + Image-to-video 60-120 seconds Premium

veo3_fast (Standard)

  • • 240 credits per video
  • • Text-to-video + Image-to-video
  • • Faster processing
  • • Default model when not specified

veo3 (Premium)

  • • 500 credits per video
  • • Text-to-video + Image-to-video
  • • Higher quality output
  • • Premium quality processing

Reference: Image Generation

For comparison, image generation costs 24 credits regardless of size (1:1, 3:2, or 2:3).

Video Features

Generation Capabilities

  • High-quality video generation with Veo3
  • Text-to-video and image-to-video modes
  • Multiple source images supported
  • Same status checking as image generation

Technical Details

  • Powered by Google Veo3 model
  • Automatic credit refund on failure
  • Complete audit trail and logging
  • Videos stored for 30 days

Integration Example

Complete example showing video generation and status checking:

// Generate with veo3_fast (standard, 240 credits)
const generateVideoFast = async (aspectRatio = "16:9") => {
  const response = await fetch('/api/v1/generate/video/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Token YOUR_TOKEN_HERE'
    },
    body: JSON.stringify({
      prompt: 'A cat playing in a colorful garden on a sunny day',
      video_model: 'veo3_fast',  // Or omit for default
      aspect_ratio: aspectRatio
    })
  });

  const data = await response.json();
  
  if (data.success) {
    console.log('veo3_fast generation started:', data.data.generation_id);
    console.log('Credits used:', data.data.credits_used);
    console.log('Model:', data.data.video_model);
    console.log('Aspect ratio:', aspectRatio);
    return data.data.generation_id;
  } else {
    console.error('Error:', data.error);
    return null;
  }
};

// Generate with veo3 premium (500 credits, supports image-to-video)
const generateVideoPremium = async (sourceImageUrls = null, aspectRatio = "16:9") => {
  const requestBody = {
    prompt: 'A cat gracefully jumping through tall grass in slow motion',
    video_model: 'veo3',
    aspect_ratio: aspectRatio
  };
  
  // Add source images if provided (image-to-video mode)
  if (sourceImageUrls) {
    requestBody.source_image_urls = sourceImageUrls;
  }

  const response = await fetch('/api/v1/generate/video/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Token YOUR_TOKEN_HERE'
    },
    body: JSON.stringify(requestBody)
  });

  const data = await response.json();
  
  if (data.success) {
    console.log('veo3 premium generation started:', data.data.generation_id);
    console.log('Credits used:', data.data.credits_used);
    console.log('Mode:', data.data.mode);
    console.log('Aspect ratio:', aspectRatio);
    return data.data.generation_id;
  } else {
    console.error('Error:', data.error);
    return null;
  }
};

// Check status (same endpoint as images)
const checkStatus = async (generationId) => {
  const response = await fetch(`/api/v1/generate/${generationId}/`, {
    headers: {
      'Authorization': 'Token YOUR_TOKEN_HERE'
    }
  });

  const data = await response.json();
  
  if (data.generation_type === 'video') {
    console.log('Model used:', data.video_model);
    
    if (data.status === 'completed' && data.video_url) {
      console.log('Video ready:', data.video_url);
      return data;
    } else if (data.status === 'processing') {
      console.log('Still processing... checking again in 10 seconds');
      setTimeout(() => checkStatus(generationId), 10000);
    }
  }
};

// Usage examples
// Landscape video (16:9) - great for YouTube, presentations
const landscapeId = await generateVideoFast("16:9");
if (landscapeId) checkStatus(landscapeId);

// Portrait video (9:16) - perfect for social media
const portraitId = await generateVideoFast("9:16");
if (portraitId) checkStatus(portraitId);

// Premium landscape text-to-video (500 credits)
const premiumLandscapeId = await generateVideoPremium(null, "16:9");
if (premiumLandscapeId) checkStatus(premiumLandscapeId);

// Premium portrait image-to-video (500 credits)
const imageToVideoPortraitId = await generateVideoPremium(['https://example.com/cat.jpg'], "9:16");
if (imageToVideoPortraitId) checkStatus(imageToVideoPortraitId);

Important Notes

  • • Model Selection: Choose between veo3_fast (240 credits) or veo3 (500 credits)
  • • Default Model: If video_model is not specified, defaults to veo3_fast
  • • Aspect Ratio: Choose "16:9" for landscape/widescreen or "9:16" for portrait/vertical videos
  • • Image-to-Video: Now supported with both veo3_fast (240 credits) and veo3 (500 credits)
  • • veo3_fast Update: Now supports both text-to-video and image-to-video modes
  • • Credits are deducted immediately when video generation starts
  • • Credits are automatically refunded if generation fails
  • • Video generation takes longer than image generation (45-120 seconds)
  • • Maximum prompt length is 1000 characters
  • • Use the same status endpoint as images to check progress
  • • Videos are provided as direct download URLs