Batch

APIs for processing batches and get detailed information.

Batch Webhook

By providing us a webhook endpoint you get notified when the request is done as opposed to polling it. You can set webhook URL by giving webhook_url params on Create and Update media.

You will get a response with the customer_id and batch_id and status:

{
    "customer_id": "YOUR_CUSTOMER_ID",
    "batch_id": "YOUR_BATCH_ID",
    "status": "success"
}

Once you get request from webhook, you can use Get Batch Detail API to retrieve batch details.

Create Batch

This API creates a new Batch object and process all given images.

Send a POST request to create a new Batch.

Example code

Create a new Batch with uploading image files.

import requests

url = "https://api.vimmerse.net/batch"

payload = {
  'title': 'New batch example with uploading 4 images.',
  'sound_effects': 'Yes',
  'motion_type': 'KlingAI'
}

files=[
  ('image_files',('image1.png',open('path/to/your/image1.png','rb'),'image/png')),
  ('image_files',('image2.png',open('path/to/your/image2.png','rb'),'image/png')),
  ('image_files',('image3.png',open('path/to/your/image3.png','rb'),'image/png')),
  ('image_files',('image4.png',open('path/to/your/image4.png','rb'),'image/png'))
]

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

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Create a new Batch with image URLs

import requests

url = "https://api.vimmerse.net/batch"

payload = {
  'title': 'New batch example with image URLs.',
  'aspect_ratio': '9:16',
  'image_urls': [
      "https://media.vimmerse.net/image/url/1.jpg",
      "https://media.vimmerse.net/image/url/2.jpg",
      "https://media.vimmerse.net/image/url/3.jpg",
      "https://media.vimmerse.net/image/url/4.jpg",
  ]
}

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

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: multipart/form-data
title
string (Title)
Default: ""
description
string (Description)
Default: ""
visibility_status
string (Visibility Status)
Default: "1"

Visibility status of the batch. 0: Private, 1: Unlisted, 2: Public.

image_files
Array of strings <binary> (Image Files)
Default: []

Images to upload. If you upload a single image, an auto motion video will be created from that image. If you upload two images, the second image will be treated as the final frame of the video, resulting in motion transitions between the two images. The most recently uploaded image will be considered the last frame.

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

If you upload image files, this field will be ignored.

audio_urls
Array of strings (Background Audio URLs)

URLs of background audio for composed video.

is_transition
string (Is Transition)
Default: "No"

If you set to Yes, you will get transition video between given images.

is_highlights
string (Highlight Batch Flag)
Default: ""
prompt
string (Text prompt)
Default: ""

Description to generate video.

camera_control
string (Camera Path)
Default: "HorizontalArc"

Defines the camera path of the bullet video. Only available when Parallax motion type is chosen. Available values are 'HorizontalArc', 'VerticalArc', 'StepIn', 'Cross', 'Circular', 'StepD', 'StepU', 'StepL' and 'StepR'

motion_range
integer (The amount of motion, ranging from 1 to 10. Default value is 5.) [ 1 .. 10 ]
Default: 5
motion_type
string (Motion Type)
Default: "Auto"

Defines the type of motion. Available values are: Auto, LumaAI, LumaRay2, KlingAI, Kling2, MinimaxHailuo, Seedance, Hunyuan, RunwayML, Wan, Pixverse, Veo, VeoFast, TryOnVideo and Parallax.

quantity
integer (Quantity) [ 1 .. 4 ]
Default: 1
duration
integer (Duration of video) [ 1 .. 10 ]
Default: 5
loop
integer (The number of repetitions of the same motion.) [ 1 .. 6 ]
Default: 1
aspect_ratio
string (Aspect ratio)

Available values are '16:9', '4:3', '1:1', '3:4' and '9:16'

sound_effects
string (Sound Effects)
Default: "No"

Defines if the generated video will include sound effects or not. Available values are: Yes and No(default).

webhook_url
string (Webhook URL)

a 'POST' request will be made to your webhook URL after batch is finished.

Responses
200

New Batch Object

400

Bad Request

402

Insufficient Credit

422

Validation Error

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

Get Batch Detail

This API retrieves a Batch object.

status field shows current progressing status of this Batch. if Batch is finished, you can get composed video from video_url.

Example Code

Get a new Batch example

import requests

url = "http://api.vimmerse.net/batch/{BATCH_ID}"

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

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

print(response.text)
SecurityAPIKeyHeader
Responses
200

Batch Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

get/batch/{batch_id}
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Update Batch

This API updates batch and resubmit again if you update any of prompt, motion_type, quantity, duration, loop, aspect_ratio and sound_effects. If batch is processed again, it will reduce your credit.

Send a PUT request to update your batch. This will return updated batch. The request should include your API key.

Example Code

Update Batch without resubmitting example

import requests

url = "http://api.vimmerse.net/batch/{BATCH_ID}/edit"

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

payload = {
    'title': 'New Updated Title',
    'description': 'New updated description',
    'rating: '5',
    'visibility_status': '2'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Update Batch with resubmitting example

import requests

url = "http://api.vimmerse.net/batch/{BATCH_ID}/edit"

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

payload = {
    'title': 'New Updated Title',
    'motion_type: 'RunwayML',
    'duration': 9
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
title
string (Title)
description
string (Description)
visibility_status
string (Visibility Status)
Default: "1"

Visibility status of the batch. 0: Private, 1: Unlisted, 2: Public.

prompt
string (Text prompt)

Description to generate video.

camera_control
string (Camera Path)

Defines the camera path of the bullet video. Only available when Parallax motion type is chosen. Available values are 'HorizontalArc', 'VerticalArc', 'StepIn', 'Cross', 'Circular', 'StepD', 'StepU', 'StepL' and 'StepR'

motion_range
integer (The amount of motion, ranging from 1 to 10. Default value is 5.) [ 1 .. 10 ]
motion_type
string (Motion Type)

Defines the type of motion. Available values are: Auto, LumaAI, LumaRay2, KlingAI, Kling2, MinimaxHailuo, Seedance, Hunyuan, RunwayML, Wan, Pixverse, Veo, VeoFast, TryOnVideo and Parallax.

quantity
integer (Quantity) [ 1 .. 4 ]
duration
integer (Duration of video) [ 1 .. 10 ]
loop
integer (The number of repetitions of the same motion.) [ 1 .. 6 ]
aspect_ratio
string (Aspect ratio)

Available values are '16:9', '4:3', '1:1', '3:4' and '9:16'

sound_effects
string (Sound Effects)

Defines if the generated video will include sound effects or not. Available values are: Yes and No(default).

audio_urls
Array of strings (Background Audio URLs)

URLs of background audio for composed video.

concat_video_urls
Array of strings (Composing video URLs)

URLs of composing video.

additional_videos
string (Additional Video List)

Additional Video List.

webhook_url
string (Webhook URL)

a 'POST' request will be made to your webhook URL after batch is finished.

Responses
200

Batch Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

put/batch/{batch_id}/edit
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Concat Batch

This API requests to compose all videos from batch. You can get composed video from video_url after videos are composed.

Send a POST request with empty body.

Example Code

import requests

url = "http://api.vimmerse.net/batch/{BATCH_ID}/concat"

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

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

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
concat_video_urls
Array of strings (Composing video URLs)

URLs of composing video.

audio_urls
Array of strings (Background Audio URLs)

URLs of background audio for composed video.

Responses
200

Batch Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

post/batch/{batch_id}/concat
Request samples
Response samples
application/json
{ }