Media

APIs for creating and managing media (animated videos) with comprehensive control over generation parameters.

Key Features

  • Image-to-Video: Transform static images into animated videos
  • Text-to-Video: Generate videos from text descriptions
  • Multiple Motion Types: Support for various AI models (Auto, KlingAI, LumaAI, RunwayML, etc.)
  • Audio Options: Native sound effects, narration, and background music
  • Webhook Notifications: Real-time completion notifications
  • Status Tracking: Monitor processing progress in real-time
  • Flexible Output: Customize aspect ratios, duration, and quality

Common Use Cases

  • Product Videos: Animate product images for marketing campaigns
  • Social Media Content: Create engaging short videos for platforms
  • Animation: Bring static images to life with AI-generated motion
  • Creative Expression: Generate unique video content from imagination
  • Transition Videos: Create smooth morphing effects between two images

Input Options

1. Single Image

Upload one image to generate an animated video with AI-generated motion. The system automatically creates natural movement based on the image content.

2. Two Images

Upload two images (start and end frames) to create a transition video. The system generates smooth morphing animations between the frames.

3. Text Prompt Only

Provide a text description to generate a video entirely from scratch. No images required - pure AI generation.

4. Media Items (Advanced)

Use the media_items parameter to specify complex input configurations with multiple images, videos, and precise positioning.

Create Media

Creates a new media object and initiates video generation from images, text prompts, or a combination of both.

How It Works

Input Types

  1. Two Images - Creates a transition video between start and end frames
  2. Single Image - Generates animated video from the image with AI-generated motion
  3. Text Prompt Only - Creates video from a text description without images
  4. Media Items - Advanced configuration with multiple inputs and precise control

Workflow

Once submitted, the API:

  1. Validates input parameters and checks credit availability
  2. Creates a media object with unique ID
  3. Queues the video generation job
  4. Returns immediately with media ID and initial status
  5. Processes video generation asynchronously
  6. Updates status when complete (poll or webhook)

Parameters

Parameter Type Required Default Description
title string No "" Media title for organization
description string No "" Media description
visibility_status string No "1" Access control: "0" (private), "1" (unlisted), "2" (public)
image_files array[file] No* [] Image files to upload (multipart/form-data). Deprecated - use media_items instead.
image_urls array[string] No* [] Public image URLs. Deprecated - use media_items instead.
media_items string (JSON) No* null Advanced input configuration. JSON array with type, url, and position fields.
prompt string No* "" Text description for video generation. Required if no images provided.
motion_type string No "Auto" AI model for motion: Auto, KlingAI, LumaAI, RunwayML
quantity integer No 1 Number of video variations to generate (1-4)
duration integer No 5 Video length in seconds (1-10)
loop integer No 1 Number of times to repeat motion (1-6). Ignored when narration is used.
audio_option string (JSON) No null Audio configuration (see Audio Options below)
character_animate boolean No false Enable character animation mode
model string No null Try-on model: SeedreamTryOn, NanoBananaProTryOn, FashnTryOn, ViduTryOn, KlingTryOn
aspect_ratio string No null Video dimensions: 16:9, 4:3, 1:1, 3:4, 9:16
webhook_url string No null URL for completion notification

Either prompt, image_files, image_urls, or media_items must be provided.

Example 1: Create Media with Image Files

import requests

BASE_URL = "https://api.vimmerse.net"
API_KEY = "YOUR_API_KEY"

url = f"{BASE_URL}/media"
headers = {"X-Api-Key": API_KEY}

# Prepare image files
files = [
    ("image_files", ("start_frame.png", open("path/to/start_frame.png", "rb"), "image/png")),
    ("image_files", ("end_frame.png", open("path/to/end_frame.png", "rb"), "image/png"))
]

payload = {
    "title": "Morph Animation",
    "description": "Transition between two scenes",
    "motion_type": "Auto",
    "duration": 5,
    "aspect_ratio": "16:9"
}

try:
    response = requests.post(url, headers=headers, data=payload, files=files, timeout=60)
    response.raise_for_status()

    result = response.json()
    media_data = result["data"]

    print(f"Media created! ID: {media_data['id']}")
    print(f"Status: {media_data['processing_status']}")

    # Close file handles
    for _, f in files:
        if hasattr(f[1], 'close'):
            f[1].close()

except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
    # Ensure files are closed on error
    for _, f in files:
        if hasattr(f[1], 'close'):
            f[1].close()
import requests
import json

BASE_URL = "https://api.vimmerse.net"
API_KEY = "YOUR_API_KEY"

url = f"{BASE_URL}/media"
headers = {"X-Api-Key": API_KEY}

payload = {
    "title": "Product Showcase",
    "prompt": "Smooth camera movement showcasing the product",
    "media_items": json.dumps([
        {
            "type": "image",
            "url": "https://example.com/product-front.png",
            "position": "First"
        },
        {
            "type": "image",
            "url": "https://example.com/product-back.png",
            "position": "Last"
        }
    ]),
    "motion_type": "KlingAI",
    "quantity": 2,
    "duration": 8,
    "camera_control": "HorizontalArc",
    "audio_option": json.dumps({
        "narrator": "Sarah",
        "narration": "Introducing our revolutionary product",
        "bg_music_prompt": "Upbeat, modern background music"
    }),
    "aspect_ratio": "9:16",
    "webhook_url": "https://your-domain.com/webhook/media-complete"
}

try:
    response = requests.post(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    print(f"Media created: {result['data']['id']}")

except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Example 3: Text Prompt Only

import requests
import json

BASE_URL = "https://api.vimmerse.net"
API_KEY = "YOUR_API_KEY"

url = f"{BASE_URL}/media"
headers = {"X-Api-Key": API_KEY}

payload = {
    "title": "AI Generated Video",
    "prompt": "A cute bunny jumping through a magical forest with sparkling fairy dust and glowing mushrooms",
    "motion_type": "Auto",
    "duration": 5,
    "aspect_ratio": "16:9",
    "audio_option": json.dumps({
        "narrator": "Rachel",
        "narration": "In a magical forest, a bunny discovers wonder and adventure",
        "bg_music_prompt": "Gentle, magical background music with chimes and soft melodies"
    }),
    "webhook_url": "https://your-domain.com/webhook/media-complete"
}

try:
    response = requests.post(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    media_data = result["data"]

    print(f"Media created! ID: {media_data['id']}")
    print(f"Status: {media_data['processing_status']}")

except requests.exceptions.HTTPError as e:
    print(f"HTTP Error: {e}")
    if e.response is not None:
        print(f"Response: {e.response.text}")
except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")

Complete Example with Polling

This complete example creates media, polls for completion, and downloads the final video:

import requests
import json
import time

BASE_URL = "https://api.vimmerse.net"
API_KEY = "YOUR_API_KEY"

# Step 1: Create media
url = f"{BASE_URL}/media"
headers = {"X-Api-Key": API_KEY}

payload = {
    "title": "Product Animation",
    "prompt": "Smooth camera movement showcasing a sleek smartphone",
    "motion_type": "Auto",
    "duration": 5,
    "aspect_ratio": "16:9",
    "audio_option": json.dumps({
        "narrator": "Sarah",
        "narration": "Introducing our latest innovation",
        "bg_music_prompt": "Modern, upbeat background music"
    })
}

print("Creating media...")
try:
    response = requests.post(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    media_data = result["data"]
    media_id = media_data["id"]

    print(f"✓ Media created successfully!")
    print(f"  Media ID: {media_id}")
    print(f"  Status: {media_data['processing_status']}")

except requests.exceptions.HTTPError as e:
    print(f"✗ HTTP Error: {e}")
    if e.response is not None:
        print(f"  Response: {e.response.text}")
    exit(1)
except requests.exceptions.RequestException as e:
    print(f"✗ Request failed: {e}")
    exit(1)

# Step 2: Poll for completion
print("\nPolling for media completion...")
max_attempts = 120  # Maximum 60 minutes
attempt = 0
poll_interval = 30  # Check every 30 seconds

def get_media_status(media_id):
    """Retrieve the current status of a media."""
    url = f"{BASE_URL}/media/{media_id}/processing-status"
    headers = {"X-Api-Key": API_KEY}

    try:
        response = requests.get(url, headers=headers, timeout=30)
        response.raise_for_status()
        return response.json()["data"]
    except requests.exceptions.RequestException as e:
        print(f"  Warning: Error retrieving status: {e}")
        return None

while attempt < max_attempts:
    status_data = get_media_status(media_id)

    if not status_data:
        print(f"  Attempt {attempt + 1}/{max_attempts}: Failed to retrieve status, retrying...")
        time.sleep(poll_interval)
        attempt += 1
        continue

    status = status_data.get("processing_status")
    progress = status_data.get("progress_percentage", 0)

    print(f"  Attempt {attempt + 1}/{max_attempts}: Status={status}, Progress={progress}%")

    if status == "success":
        print(f"\n✓ Media completed successfully!")

        # Get full media details
        url = f"{BASE_URL}/media/{media_id}"
        response = requests.get(url, headers=headers)
        media_data = response.json()["data"]

        # Download video
        download_url = f"{BASE_URL}/media/{media_id}/download"
        print("\nDownloading video...")
        try:
            video_response = requests.get(download_url, headers=headers, stream=True, timeout=60)
            video_response.raise_for_status()

            output_path = "media_video.mp4"
            total_size = int(video_response.headers.get('content-length', 0))
            downloaded = 0

            with open(output_path, "wb") as f:
                for chunk in video_response.iter_content(chunk_size=8192):
                    if chunk:
                        f.write(chunk)
                        downloaded += len(chunk)
                        if total_size > 0:
                            percent = (downloaded / total_size) * 100
                            print(f"  Download progress: {percent:.1f}%", end="\r")

            print(f"\n✓ Video downloaded successfully!")
            print(f"  Saved to: {output_path}")
            print(f"  File size: {downloaded / (1024 * 1024):.2f} MB")

        except Exception as e:
            print(f"\n✗ Error downloading video: {e}")
        break
    elif status == "fail":
        print(f"\n✗ Media generation failed.")
        print(f"  Media ID: {media_id}")
        exit(1)

    time.sleep(poll_interval)
    attempt += 1

if attempt >= max_attempts:
    print(f"\n⚠ Timeout: Media generation is taking longer than expected.")
    print(f"  Media ID: {media_id}")
    print(f"  Please check the status later using: GET {BASE_URL}/media/{media_id}/processing-status")

Error Handling

The API may return the following HTTP status codes:

  • 200 - Success. Media creation initiated.
  • 400 - Bad Request. Invalid parameters or missing required fields.
  • 402 - Payment Required. Insufficient credits in your account.
  • 404 - Not Found. Resource not found.
  • 429 - Too Many Requests. Rate limit exceeded.
  • 500 - Internal Server Error. Please retry or contact support.
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
title
string (Media Title)
Default: ""

Optional title for your media. Used for organization and display purposes.

description
string (Media Description)
Default: ""

Optional description of your media. Used for documentation and search purposes.

visibility_status
string (Visibility Status)
Default: "1"

Visibility Status:

Value Status
"0" Private
"1" Unlisted
"2" Public
Enum: "0" "1" "2"
image_files
Array of strings <binary> (Image Files)
Deprecated
Default: []

⚠️ Deprecated: Image files to upload. Use media_items instead for better control. If you upload a single image, an auto motion video will be created. If you upload two images, the second image will be treated as the final frame, creating a transition video.

image_urls
Array of strings (Image URLs)
Deprecated
Default: []

⚠️ Deprecated: Array of publicly accessible image URLs. Use media_items instead. If image_files are provided, this field is ignored.

media_items
string (Media Items)

Advanced input configuration as a JSON string. Array of media items with type ("image" or "video"), url (publicly accessible URL), and position ("First" or "Last"). Example: [{"type":"image","url": "https://example.com/image.png", "position": "First"},{"type":"video","url": "https://example.com/video.mp4", "position": "Last"}]. If provided, image_files and image_urls are ignored.

prompt
string (Text Prompt)
Default: ""

Text description for video generation. Required if no images are provided via image_files, image_urls, or media_items. Be specific about desired motion, style, and visual elements.

motion_type
string (Motion Type)
Default: "Auto"

AI model for motion generation. Available values: Auto, AutoT3, KlingAI, KlingT4, LumaAI, LumaRay2, VeoFast, Veo, RunwayML, MinimaxHailuo, Seedance, SeedanceFast, Hunyuan, Pixverse, PixverseT3, PicoMotion, StaticMotion, Wan, Sora, SoraPro, TryOnVideo. Default is 'Auto'.

Enum: "Auto" "AutoT3" "KlingAI" "KlingT4" "LumaAI" "LumaRay2" "VeoFast" "Veo" "RunwayML" "MinimaxHailuo" "Seedance" "SeedanceFast" "Hunyuan" "Pixverse" "PixverseT3" "PicoMotion" "StaticMotion" "Wan" "Sora" "SoraPro" "TryOnVideo"
camera_control
string (Camera Control)
Default: ""

Camera path/movement for the video. Defines how the camera moves through the scene.

Enum: "" "Static" "Crane up" "Crane down" "Tilt up" "Tilt down" "Pan right" "Pan left" "Roll right" "Roll left" "Orbit right" "Orbit left" "Rotate 360" "Dolly zoom" "Zoom in" "Zoom out" "Aerial"
quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1

Number of video variations to generate. Range: 1-4. Default is 1. Each variation may use different seeds or parameters.

duration
integer (Video Duration) [ 1 .. 10 ]
Default: 5

Duration of the generated video in seconds. Range: 1-10. Default is 5. Longer durations may require more processing time and credits.

loop
integer (Motion Loop Count) [ 1 .. 6 ]
Default: 1

Number of times the same motion is repeated. Range: 1-6. Default is 1. This setting is ignored when narration is used, as the video duration matches the narration length.

audio_option
string (Audio Configuration)

Audio configuration options for media generation.

Configure narration, background music, and audio settings using a JSON string.

⚠️ Important: These options are ignored if media_items contains audio files. When audio files are provided in media_items, they take precedence over these settings.

Audio Parameters

Parameter Type Default Description
narrator string null Voice for text-to-speech narration
Available voices: Rachel, Aria, Roger, Sarah, Laura, Charlie, George, Callum, River, Liam, Charlotte, Alice, Matilda, Will, Jessica, Eric, Chris, Brian, Daniel, Lily, Bill
narration string null Text to be converted to speech using the specified narrator voice
narration_url string null URL to pre-recorded narration audio file
⚠️ Note: If provided, narrator and narration are ignored
bg_music_prompt string null Description for AI-generated background music. The AI will create music matching your description
bg_music_url string null URL to background music file

Usage Examples

Example 1: Text-to-Speech Narration

import json

audio_option = json.dumps({
    "narrator": "Sarah",
    "narration": "Welcome to our product showcase. This amazing device will revolutionize how you work and play."
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 2: Pre-recorded Narration

import json

audio_option = json.dumps({
    "narration_url": "https://example.com/my-professional-voiceover.mp3"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 3: AI-Generated Background Music

import json

audio_option = json.dumps({
    "bg_music_prompt": "Upbeat electronic music with energetic beats, perfect for product launch video"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 4: Combined Narration and Background Music

import json

audio_option = json.dumps({
    "narrator": "Rachel",
    "narration": "Discover the future of technology",
    "bg_music_prompt": "Modern, cinematic background music with subtle electronic elements"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 5: External Music File

import json

audio_option = json.dumps({
    "bg_music_url": "https://example.com/background-music.mp3"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Best Practices

  • Text Narration: Use for dynamic, customizable content that can be easily updated
  • Pre-recorded Narration: Use narration_url for professional voiceovers with specific tone or accent requirements
  • Background Music: Combine narration with background music for more engaging videos
  • Narration Length: Keep narration text concise (under 200 words) for best results
  • Audio Quality: Ensure external audio URLs are publicly accessible and in supported formats (MP3, WAV)
  • Priority: When both narration_url and narration are provided, narration_url takes precedence

Format Requirements

  • JSON String: The audio_option parameter must be a JSON string, not a JSON object
  • URL Accessibility: Audio URLs must be publicly accessible without authentication
  • Supported Formats: MP3, WAV for audio files
character_animate
boolean (Character Animation)
Default: false

If true, enables character animation mode for uploaded videos. This mode focuses on animating characters within the video rather than general motion.

model
string (Try-On Model)

Model used for try-on video generation. Available values: 'SeedreamTryOn', 'NanoBananaProTryOn', 'FashnTryOn', 'ViduTryOn', 'KlingTryOn'. Only applicable for try-on video use cases.

aspect_ratio
string (Aspect Ratio)

Video aspect ratio. Available values: '16:9' (landscape), '4:3' (standard), '1:1' (square), '3:4' (portrait), '9:16' (vertical/mobile). If not specified, uses default or detected from input images.

webhook_url
string (Webhook URL)

URL endpoint to receive a POST request notification when media generation completes. Your endpoint must respond with a 2xx status code within 10 seconds. The webhook payload contains 'customer_id', 'media_id', and 'status' fields.

Responses
200

New Media

402

Insufficient Credit

404

Not Found

422

Validation Error

post/media
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Get Media Processing Status

Retrieves the current processing status and progress percentage of a media object.

This lightweight endpoint is optimized for frequent polling and provides minimal response data for efficient status checking.

Response Fields

Field Type Description
progress_percentage integer Processing progress (0-100)
processing_status string Current processing state

Status Values

Status Meaning Action
queue_bullet Waiting in queue Keep polling
processing_bullet Video generation in progress Keep polling
success Video ready Download or retrieve results
fail Processing failed Check error logs or retry
cancel Processing cancelled No further action needed

Example Request

import requests

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}/processing-status"
headers = {"X-Api-Key": "YOUR_API_KEY"}

try:
    response = requests.get(url, headers=headers, timeout=30)
    response.raise_for_status()

    result = response.json()
    status_data = result["data"]

    print(f"Progress: {status_data['progress_percentage']}%")
    print(f"Status: {status_data['processing_status']}")

except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Polling Example

import requests
import time

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"
API_KEY = "YOUR_API_KEY"

def check_media_status(media_id):
    """Check media processing status."""
    url = f"{BASE_URL}/media/{media_id}/processing-status"
    headers = {"X-Api-Key": API_KEY}

    try:
        response = requests.get(url, headers=headers, timeout=30)
        response.raise_for_status()
        return response.json()["data"]
    except requests.exceptions.RequestException as e:
        print(f"Error checking status: {e}")
        return None

# Poll until complete
max_attempts = 120  # Maximum 60 minutes
attempt = 0

while attempt < max_attempts:
    status_data = check_media_status(MEDIA_ID)

    if not status_data:
        print(f"Attempt {attempt + 1}/{max_attempts}: Failed to retrieve status")
        time.sleep(30)
        attempt += 1
        continue

    progress = status_data.get("progress_percentage", 0)
    status = status_data.get("processing_status")

    print(f"Attempt {attempt + 1}/{max_attempts}: Status={status}, Progress={progress}%")

    if status == "success":
        print("\n✓ Media completed successfully!")
        break
    elif status == "fail":
        print("\n✗ Media generation failed.")
        break

    time.sleep(30)  # Check every 30 seconds
    attempt += 1

if attempt >= max_attempts:
    print("\n⚠ Timeout: Processing is taking longer than expected.")
Responses
200

Media progress percentage

404

Not Found

422

Validation Error

get/media/{media_id}/processing-status
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Get Media

Retrieves detailed information about a specific media object, including processing status, generated videos, and metadata.

Response Fields

Field Type Description
id string Unique media identifier
title string Media title
description string Media description
processing_status string Current processing state (see Status Values below)
progress_percentage integer Processing progress (0-100)
result array Array of generated video objects with URLs
video_history array Processing history with details of each generation
base_url string Base URL for accessing media files
bullet_version integer Version number of the generated video
created_at string ISO 8601 timestamp of creation
updated_at string ISO 8601 timestamp of last update

Status Values

  • queue_bullet - Waiting in queue for processing
  • processing_bullet - Currently being processed
  • success - Completed successfully
  • fail - Failed to process
  • cancel - Processing was cancelled

Example Request

import requests

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}"
headers = {"X-Api-Key": "YOUR_API_KEY"}

try:
    response = requests.get(url, headers=headers, timeout=30)
    response.raise_for_status()

    result = response.json()
    media_data = result["data"]

    print(f"Media ID: {media_data['id']}")
    print(f"Status: {media_data['processing_status']}")
    print(f"Progress: {media_data.get('progress_percentage', 0)}%")

    if media_data['processing_status'] == 'success':
        # Access generated videos
        if media_data.get("result"):
            print(f"Generated {len(media_data['result'])} video(s)")
            for idx, video in enumerate(media_data["result"], 1):
                print(f"Video {idx}: {video.get('url', 'N/A')}")
        else:
            # Download URL available
            download_url = f"{BASE_URL}/media/{MEDIA_ID}/download"
            print(f"Download URL: {download_url}")
    elif media_data['processing_status'] == 'fail':
        print("Media generation failed. Check error details.")

except requests.exceptions.HTTPError as e:
    if e.response.status_code == 404:
        print("Media not found. Please verify the media ID.")
    else:
        print(f"HTTP Error: {e}")
except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")

Use Cases

  • Check Completion: Verify if video generation is complete
  • Retrieve URLs: Get download URLs for generated videos
  • Inspect History: Review processing history and parameters
  • Debug Issues: Examine processing details for troubleshooting
  • Field Selection: Use fields query parameter to retrieve specific fields only
SecurityAPIKeyHeader
Responses
200

Media Object

404

Media Not Found

422

Validation Error

get/media/{media_id}
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Update Media

Updates media metadata and optionally regenerates the video with new parameters.

Important Notes

⚠️ Credit Usage: Updating certain fields triggers video regeneration and consumes credits.

Fields That Trigger Regeneration (Consumes Credits)

  • prompt - Text description
  • motion_type - AI model selection
  • quantity - Number of variations
  • duration - Video length
  • loop - Motion repetition count
  • camera_control - Camera path
  • aspect_ratio - Video dimensions
  • audio_option - Audio configuration
  • media_items - Input media configuration
  • model - Try-on model selection

Fields That Don't Trigger Regeneration (No Credit Cost)

  • title - Media title
  • description - Media description
  • rating - User rating
  • visibility_status - Access control
  • webhook_url - Webhook URL

Example 1: Update Metadata Only (No Regeneration)

import requests

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}/edit"
headers = {"X-Api-Key": "YOUR_API_KEY"}

payload = {
    "title": "Updated Product Video",
    "description": "New description text",
    "rating": "5",
    "visibility_status": "2"  # Make public
}

try:
    response = requests.put(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    print(f"Media updated: {result['data']['id']}")

except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Example 2: Regenerate Video (Uses Credits)

import requests
import json

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}/edit"
headers = {"X-Api-Key": "YOUR_API_KEY"}

payload = {
    "title": "Updated Video",
    "motion_type": "RunwayML",  # Triggers regeneration
    "duration": 9,               # Triggers regeneration
    "camera_control": "HorizontalArc",  # Triggers regeneration
    "audio_option": json.dumps({
        "narrator": "Sarah",
        "narration": "Updated narration text",
        "bg_music_prompt": "Energetic background music"
    })
}

try:
    response = requests.put(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    media_data = result["data"]

    print(f"Media regeneration started!")
    print(f"Media ID: {media_data['id']}")
    print(f"Status: {media_data['processing_status']}")

except requests.exceptions.HTTPError as e:
    if e.response.status_code == 402:
        print("Insufficient credits for regeneration")
    else:
        print(f"HTTP Error: {e}")
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Error Handling

  • 400 - Bad Request. Invalid parameters or media not found.
  • 402 - Payment Required. Insufficient credits for regeneration.
  • 404 - Not Found. Media not found or access denied.
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
title
string (Media Title)
Default: ""

New title for the media. If provided, updates the media title. Does not trigger regeneration.

description
string (Media Description)
Default: ""

New description for the media. If provided, updates the media description. Does not trigger regeneration.

visibility_status
string (Visibility Status)
Default: "1"

Visibility Status:

Value Status
"0" Private
"1" Unlisted
"2" Public
Enum: "0" "1" "2"
rating
string (Rating)

User rating for the media (typically 1-5). Does not trigger regeneration.

media_items
string (Media Items)

Updated media items configuration as a JSON string. If provided, triggers regeneration. Format: [{"type":"image","url": "https://example.com/image.png", "position": "First"}]. See Create Media API for detailed format.

prompt
string (Text Prompt)
Default: ""

Updated text description for video generation. If provided, triggers regeneration and consumes credits.

motion_type
string (Motion Type)

Updated AI model for motion generation. If provided, triggers regeneration. Available values: Auto, AutoT3, KlingAI, KlingT4, LumaAI, LumaRay2, VeoFast, Veo, RunwayML, MinimaxHailuo, Seedance, SeedanceFast, Hunyuan, Pixverse, PixverseT3, PicoMotion, StaticMotion, Wan, Sora, SoraPro, TryOnVideo.

Enum: "Auto" "AutoT3" "KlingAI" "KlingT4" "LumaAI" "LumaRay2" "VeoFast" "Veo" "RunwayML" "MinimaxHailuo" "Seedance" "SeedanceFast" "Hunyuan" "Pixverse" "PixverseT3" "PicoMotion" "StaticMotion" "Wan" "Sora" "SoraPro" "TryOnVideo"
camera_control
string (Camera Control)
Default: ""

Updated camera path/movement. If provided, triggers regeneration. Available values: [{'label': 'Auto', 'prompt': '', 'value': ''}, {'label': 'Static', 'prompt': 'Camera static and steady', 'value': 'Static'}, {'label': 'Crane up', 'prompt': 'Camera crane up', 'value': 'Crane up'}, {'label': 'Crane down', 'prompt': 'Camera crane down', 'value': 'Crane down'}, {'label': 'Tilt up', 'prompt': 'Camera tilt up', 'value': 'Tilt up'}, {'label': 'Tilt down', 'prompt': 'Camera tilt down', 'value': 'Tilt down'}, {'label': 'Pan right', 'prompt': 'Camera pan right', 'value': 'Pan right'}, {'label': 'Pan left', 'prompt': 'Camera pan left', 'value': 'Pan left'}, {'label': 'Roll right', 'prompt': 'Camera roll right', 'value': 'Roll right'}, {'label': 'Roll left', 'prompt': 'Camera roll left', 'value': 'Roll left'}, {'label': 'Orbit right', 'prompt': 'Camera orbit right', 'value': 'Orbit right'}, {'label': 'Orbit left', 'prompt': 'Camera orbit left', 'value': 'Orbit left'}, {'label': 'Rotate 360', 'prompt': 'Camera move in 360-degree rotation around', 'value': 'Rotate 360'}, {'label': 'Dolly zoom', 'prompt': 'Camera dolly zoom', 'value': 'Dolly zoom'}, {'label': 'Zoom in', 'prompt': 'Camera zoom in', 'value': 'Zoom in'}, {'label': 'Zoom out', 'prompt': 'Camera zoom out', 'value': 'Zoom out'}, {'label': 'Aerial', 'prompt': 'Camera aerial as FPV drone shot', 'value': 'Aerial'}]

quantity
integer (Quantity) [ 1 .. 4 ]

Updated number of video variations (1-4). If provided, triggers regeneration and consumes credits.

duration
integer (Video Duration) [ 1 .. 10 ]

Updated video duration in seconds (1-10). If provided, triggers regeneration and consumes credits.

loop
integer (Motion Loop Count) [ 1 .. 6 ]

Updated number of times to repeat motion (1-6). If provided, triggers regeneration. Ignored when narration is used.

audio_option
string (Audio Configuration)

Audio configuration options for media generation.

Configure narration, background music, and audio settings using a JSON string.

⚠️ Important: These options are ignored if media_items contains audio files. When audio files are provided in media_items, they take precedence over these settings.

Audio Parameters

Parameter Type Default Description
narrator string null Voice for text-to-speech narration
Available voices: Rachel, Aria, Roger, Sarah, Laura, Charlie, George, Callum, River, Liam, Charlotte, Alice, Matilda, Will, Jessica, Eric, Chris, Brian, Daniel, Lily, Bill
narration string null Text to be converted to speech using the specified narrator voice
narration_url string null URL to pre-recorded narration audio file
⚠️ Note: If provided, narrator and narration are ignored
bg_music_prompt string null Description for AI-generated background music. The AI will create music matching your description
bg_music_url string null URL to background music file

Usage Examples

Example 1: Text-to-Speech Narration

import json

audio_option = json.dumps({
    "narrator": "Sarah",
    "narration": "Welcome to our product showcase. This amazing device will revolutionize how you work and play."
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 2: Pre-recorded Narration

import json

audio_option = json.dumps({
    "narration_url": "https://example.com/my-professional-voiceover.mp3"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 3: AI-Generated Background Music

import json

audio_option = json.dumps({
    "bg_music_prompt": "Upbeat electronic music with energetic beats, perfect for product launch video"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 4: Combined Narration and Background Music

import json

audio_option = json.dumps({
    "narrator": "Rachel",
    "narration": "Discover the future of technology",
    "bg_music_prompt": "Modern, cinematic background music with subtle electronic elements"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 5: External Music File

import json

audio_option = json.dumps({
    "bg_music_url": "https://example.com/background-music.mp3"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Best Practices

  • Text Narration: Use for dynamic, customizable content that can be easily updated
  • Pre-recorded Narration: Use narration_url for professional voiceovers with specific tone or accent requirements
  • Background Music: Combine narration with background music for more engaging videos
  • Narration Length: Keep narration text concise (under 200 words) for best results
  • Audio Quality: Ensure external audio URLs are publicly accessible and in supported formats (MP3, WAV)
  • Priority: When both narration_url and narration are provided, narration_url takes precedence

Format Requirements

  • JSON String: The audio_option parameter must be a JSON string, not a JSON object
  • URL Accessibility: Audio URLs must be publicly accessible without authentication
  • Supported Formats: MP3, WAV for audio files
model
string (Try-On Model)

Updated try-on model. If provided, triggers regeneration. Available values: 'SeedreamTryOn', 'NanoBananaProTryOn', 'FashnTryOn', 'ViduTryOn', 'KlingTryOn'.

aspect_ratio
string (Aspect Ratio)

Updated video aspect ratio. If provided, triggers regeneration. Available values: '16:9', '4:3', '1:1', '3:4', '9:16'.

webhook_url
string (Webhook URL)

Updated webhook URL for completion notifications. Does not trigger regeneration. Your endpoint must respond with a 2xx status code within 10 seconds.

Responses
200

Media Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

put/media/{media_id}
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Update Media

Updates media metadata and optionally regenerates the video with new parameters.

Important Notes

⚠️ Credit Usage: Updating certain fields triggers video regeneration and consumes credits.

Fields That Trigger Regeneration (Consumes Credits)

  • prompt - Text description
  • motion_type - AI model selection
  • quantity - Number of variations
  • duration - Video length
  • loop - Motion repetition count
  • camera_control - Camera path
  • aspect_ratio - Video dimensions
  • audio_option - Audio configuration
  • media_items - Input media configuration
  • model - Try-on model selection

Fields That Don't Trigger Regeneration (No Credit Cost)

  • title - Media title
  • description - Media description
  • rating - User rating
  • visibility_status - Access control
  • webhook_url - Webhook URL

Example 1: Update Metadata Only (No Regeneration)

import requests

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}/edit"
headers = {"X-Api-Key": "YOUR_API_KEY"}

payload = {
    "title": "Updated Product Video",
    "description": "New description text",
    "rating": "5",
    "visibility_status": "2"  # Make public
}

try:
    response = requests.put(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    print(f"Media updated: {result['data']['id']}")

except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Example 2: Regenerate Video (Uses Credits)

import requests
import json

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}/edit"
headers = {"X-Api-Key": "YOUR_API_KEY"}

payload = {
    "title": "Updated Video",
    "motion_type": "RunwayML",  # Triggers regeneration
    "duration": 9,               # Triggers regeneration
    "camera_control": "HorizontalArc",  # Triggers regeneration
    "audio_option": json.dumps({
        "narrator": "Sarah",
        "narration": "Updated narration text",
        "bg_music_prompt": "Energetic background music"
    })
}

try:
    response = requests.put(url, headers=headers, data=payload, timeout=60)
    response.raise_for_status()

    result = response.json()
    media_data = result["data"]

    print(f"Media regeneration started!")
    print(f"Media ID: {media_data['id']}")
    print(f"Status: {media_data['processing_status']}")

except requests.exceptions.HTTPError as e:
    if e.response.status_code == 402:
        print("Insufficient credits for regeneration")
    else:
        print(f"HTTP Error: {e}")
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Error Handling

  • 400 - Bad Request. Invalid parameters or media not found.
  • 402 - Payment Required. Insufficient credits for regeneration.
  • 404 - Not Found. Media not found or access denied.
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
title
string (Media Title)
Default: ""

New title for the media. If provided, updates the media title. Does not trigger regeneration.

description
string (Media Description)
Default: ""

New description for the media. If provided, updates the media description. Does not trigger regeneration.

visibility_status
string (Visibility Status)
Default: "1"

Visibility Status:

Value Status
"0" Private
"1" Unlisted
"2" Public
Enum: "0" "1" "2"
rating
string (Rating)

User rating for the media (typically 1-5). Does not trigger regeneration.

media_items
string (Media Items)

Updated media items configuration as a JSON string. If provided, triggers regeneration. Format: [{"type":"image","url": "https://example.com/image.png", "position": "First"}]. See Create Media API for detailed format.

prompt
string (Text Prompt)
Default: ""

Updated text description for video generation. If provided, triggers regeneration and consumes credits.

motion_type
string (Motion Type)

Updated AI model for motion generation. If provided, triggers regeneration. Available values: Auto, AutoT3, KlingAI, KlingT4, LumaAI, LumaRay2, VeoFast, Veo, RunwayML, MinimaxHailuo, Seedance, SeedanceFast, Hunyuan, Pixverse, PixverseT3, PicoMotion, StaticMotion, Wan, Sora, SoraPro, TryOnVideo.

Enum: "Auto" "AutoT3" "KlingAI" "KlingT4" "LumaAI" "LumaRay2" "VeoFast" "Veo" "RunwayML" "MinimaxHailuo" "Seedance" "SeedanceFast" "Hunyuan" "Pixverse" "PixverseT3" "PicoMotion" "StaticMotion" "Wan" "Sora" "SoraPro" "TryOnVideo"
camera_control
string (Camera Control)
Default: ""

Updated camera path/movement. If provided, triggers regeneration. Available values: [{'label': 'Auto', 'prompt': '', 'value': ''}, {'label': 'Static', 'prompt': 'Camera static and steady', 'value': 'Static'}, {'label': 'Crane up', 'prompt': 'Camera crane up', 'value': 'Crane up'}, {'label': 'Crane down', 'prompt': 'Camera crane down', 'value': 'Crane down'}, {'label': 'Tilt up', 'prompt': 'Camera tilt up', 'value': 'Tilt up'}, {'label': 'Tilt down', 'prompt': 'Camera tilt down', 'value': 'Tilt down'}, {'label': 'Pan right', 'prompt': 'Camera pan right', 'value': 'Pan right'}, {'label': 'Pan left', 'prompt': 'Camera pan left', 'value': 'Pan left'}, {'label': 'Roll right', 'prompt': 'Camera roll right', 'value': 'Roll right'}, {'label': 'Roll left', 'prompt': 'Camera roll left', 'value': 'Roll left'}, {'label': 'Orbit right', 'prompt': 'Camera orbit right', 'value': 'Orbit right'}, {'label': 'Orbit left', 'prompt': 'Camera orbit left', 'value': 'Orbit left'}, {'label': 'Rotate 360', 'prompt': 'Camera move in 360-degree rotation around', 'value': 'Rotate 360'}, {'label': 'Dolly zoom', 'prompt': 'Camera dolly zoom', 'value': 'Dolly zoom'}, {'label': 'Zoom in', 'prompt': 'Camera zoom in', 'value': 'Zoom in'}, {'label': 'Zoom out', 'prompt': 'Camera zoom out', 'value': 'Zoom out'}, {'label': 'Aerial', 'prompt': 'Camera aerial as FPV drone shot', 'value': 'Aerial'}]

quantity
integer (Quantity) [ 1 .. 4 ]

Updated number of video variations (1-4). If provided, triggers regeneration and consumes credits.

duration
integer (Video Duration) [ 1 .. 10 ]

Updated video duration in seconds (1-10). If provided, triggers regeneration and consumes credits.

loop
integer (Motion Loop Count) [ 1 .. 6 ]

Updated number of times to repeat motion (1-6). If provided, triggers regeneration. Ignored when narration is used.

audio_option
string (Audio Configuration)

Audio configuration options for media generation.

Configure narration, background music, and audio settings using a JSON string.

⚠️ Important: These options are ignored if media_items contains audio files. When audio files are provided in media_items, they take precedence over these settings.

Audio Parameters

Parameter Type Default Description
narrator string null Voice for text-to-speech narration
Available voices: Rachel, Aria, Roger, Sarah, Laura, Charlie, George, Callum, River, Liam, Charlotte, Alice, Matilda, Will, Jessica, Eric, Chris, Brian, Daniel, Lily, Bill
narration string null Text to be converted to speech using the specified narrator voice
narration_url string null URL to pre-recorded narration audio file
⚠️ Note: If provided, narrator and narration are ignored
bg_music_prompt string null Description for AI-generated background music. The AI will create music matching your description
bg_music_url string null URL to background music file

Usage Examples

Example 1: Text-to-Speech Narration

import json

audio_option = json.dumps({
    "narrator": "Sarah",
    "narration": "Welcome to our product showcase. This amazing device will revolutionize how you work and play."
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 2: Pre-recorded Narration

import json

audio_option = json.dumps({
    "narration_url": "https://example.com/my-professional-voiceover.mp3"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 3: AI-Generated Background Music

import json

audio_option = json.dumps({
    "bg_music_prompt": "Upbeat electronic music with energetic beats, perfect for product launch video"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 4: Combined Narration and Background Music

import json

audio_option = json.dumps({
    "narrator": "Rachel",
    "narration": "Discover the future of technology",
    "bg_music_prompt": "Modern, cinematic background music with subtle electronic elements"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Example 5: External Music File

import json

audio_option = json.dumps({
    "bg_music_url": "https://example.com/background-music.mp3"
})

payload = {
    "prompt": "Your video description",
    "audio_option": audio_option,
    # ... other parameters
}

Best Practices

  • Text Narration: Use for dynamic, customizable content that can be easily updated
  • Pre-recorded Narration: Use narration_url for professional voiceovers with specific tone or accent requirements
  • Background Music: Combine narration with background music for more engaging videos
  • Narration Length: Keep narration text concise (under 200 words) for best results
  • Audio Quality: Ensure external audio URLs are publicly accessible and in supported formats (MP3, WAV)
  • Priority: When both narration_url and narration are provided, narration_url takes precedence

Format Requirements

  • JSON String: The audio_option parameter must be a JSON string, not a JSON object
  • URL Accessibility: Audio URLs must be publicly accessible without authentication
  • Supported Formats: MP3, WAV for audio files
model
string (Try-On Model)

Updated try-on model. If provided, triggers regeneration. Available values: 'SeedreamTryOn', 'NanoBananaProTryOn', 'FashnTryOn', 'ViduTryOn', 'KlingTryOn'.

aspect_ratio
string (Aspect Ratio)

Updated video aspect ratio. If provided, triggers regeneration. Available values: '16:9', '4:3', '1:1', '3:4', '9:16'.

webhook_url
string (Webhook URL)

Updated webhook URL for completion notifications. Does not trigger regeneration. Your endpoint must respond with a 2xx status code within 10 seconds.

Responses
200

Media Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

put/media/{media_id}/edit
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Download File

Downloads file from media.

Example Code

This code shows an example of how to download Bullet Video from Auto motion.

import requests

url = "https://api.vimmerse.net/media/{MEDIA_ID}/download?object_type=bullet_video_mp4&motion_type=Auto"

headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

This code shows an example of how to download Bullet Video with custom settings

import requests

url = "https://api.vimmerse.net/media/{MEDIA_ID}/download?object_type=bullet_video_mp4&motion_type=Auto&width=1080&file_size=4"

headers = {
  'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
SecurityAPIKeyHeader
Responses
200

Return bullet video, gif or source files.

400

Bad Request

422

Validation Error

get/media/{media_id}/download
Request samples
Response samples
null

Process Media

Resubmits a media object for video generation using existing parameters.

Use Cases

  • Retry Failed Generation: Restart processing after a failure
  • Regenerate with Same Parameters: Create a new video with identical settings
  • Restart Interrupted Processing: Resume processing that was interrupted

⚠️ Important: This endpoint consumes credits each time it's called, even if the media was previously processed successfully.

How It Works

The endpoint uses the existing media configuration (prompt, motion_type, duration, etc.) and resubmits it for processing. All parameters from the original media creation are preserved.

Example Request

import requests

BASE_URL = "https://api.vimmerse.net"
MEDIA_ID = "your-media-id-here"

url = f"{BASE_URL}/media/{MEDIA_ID}/process"
headers = {"X-Api-Key": "YOUR_API_KEY"}

try:
    # Send POST request with empty body
    response = requests.post(url, headers=headers, timeout=60)
    response.raise_for_status()

    result = response.json()
    print("Media resubmitted successfully")

except requests.exceptions.HTTPError as e:
    if e.response.status_code == 402:
        print("Insufficient credits for resubmission")
    elif e.response.status_code == 404:
        print("Media not found")
    else:
        print(f"HTTP Error: {e}")
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")

Error Responses

  • 400 - Bad Request. Media not found or invalid state.
  • 402 - Payment Required. Insufficient credits.
  • 404 - Not Found. Media not found or access denied.
  • 500 - Internal Server Error. Please retry or contact support.
SecurityAPIKeyHeader
Request
Request Body schema: application/json
required
property name*
additional property
any
Responses
200

Media Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

post/media/{media_id}/process
Request samples
Response samples
application/json
{
  • "data": { }
}