Video Generation
curl --request POST \
--url https://api.example.com/api/v2/generate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"duration": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
'import requests
url = "https://api.example.com/api/v2/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"duration": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
image_url: '<string>',
duration: 123,
aspect_ratio: '<string>',
negative_prompt: '<string>'
})
};
fetch('https://api.example.com/api/v2/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'image_url' => '<string>',
'duration' => 123,
'aspect_ratio' => '<string>',
'negative_prompt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/generate"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/generate")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyGenerations (results)
Video Generation
Generate videos from text or images using Kling, Luma, MiniMax, and MidJourney Video
POST
/
api
/
v2
/
generate
Video Generation
curl --request POST \
--url https://api.example.com/api/v2/generate \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"duration": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
'import requests
url = "https://api.example.com/api/v2/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"image_url": "<string>",
"duration": 123,
"aspect_ratio": "<string>",
"negative_prompt": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
image_url: '<string>',
duration: 123,
aspect_ratio: '<string>',
negative_prompt: '<string>'
})
};
fetch('https://api.example.com/api/v2/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'image_url' => '<string>',
'duration' => 123,
'aspect_ratio' => '<string>',
'negative_prompt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/generate"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/generate")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"duration\": 123,\n \"aspect_ratio\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyVideo generation is always asynchronous. You’ll receive a generation ID immediately, then poll for the result. Processing typically takes 20–180 seconds depending on the model.
Request
string
required
Authorization: Bearer nb_YOUR_API_KEYstring
required
Video model slug. See Video Models.
string
required
Text description of the video to generate.
string
Starting image URL for image-to-video generation. When provided, the video animates from this image.
integer
default:"5"
Video duration in seconds. Supported values:
5 or 10 (model-dependent).string
default:"16:9"
Output aspect ratio:
16:9, 9:16, 1:1string
Elements to avoid in the video.
Request Example
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v2.1",
"prompt": "A time-lapse of a blooming flower, macro photography, soft natural light",
"duration": 5,
"aspect_ratio": "16:9"
}'
curl -X POST https://elumenta.ru/api/v2/generate \
-H "Authorization: Bearer nb_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "luma-ray2",
"prompt": "The character slowly turns their head and smiles",
"image_url": "https://example.com/portrait.jpg",
"duration": 5
}'
import requests, time
# Start generation
res = requests.post(
"https://elumenta.ru/api/v2/generate",
headers={"Authorization": "Bearer nb_YOUR_API_KEY"},
json={
"model": "kling-v2.1",
"prompt": "A drone flyover of a futuristic city at night",
"duration": 5,
"aspect_ratio": "16:9"
}
)
gen = res.json()
gen_id = gen["id"]
print(f"Generation started: {gen_id}")
# Poll for result
while True:
status_res = requests.get(
f"https://elumenta.ru/api/v2/generate/{gen_id}",
headers={"Authorization": "Bearer nb_YOUR_API_KEY"}
)
status = status_res.json()
if status["status"] == "completed":
print(f"Video ready: {status['result_url']}")
break
elif status["status"] == "failed":
print(f"Failed: {status['error']}")
break
time.sleep(5)
Initial Response (Pending)
{
"id": 18500,
"status": "pending",
"model_slug": "kling-v2.1",
"processing_ms": null,
"created_at": "2026-03-08T12:05:00Z"
}
Completed Response
{
"id": 18500,
"status": "completed",
"model_slug": "kling-v2.1",
"result_url": "https://storage.elumenta.ru/generations/18500.mp4",
"tokens_spent": 26,
"result_metadata": { "duration": 5, "width": 1920, "height": 1080 },
"created_at": "2026-03-08T12:05:00Z",
"completed_at": "2026-03-08T12:05:55Z"
}
Model Comparison
| Model | Tokens | Speed | Best For |
|---|---|---|---|
luma-flash2 | 15–93 | Fast (~20–30s) | Quick prototypes |
kling-v2.1 | 26–94 | Medium (~45–90s) | Versatile, high quality |
minimax-video | 88 | Medium (~60s) | Character consistency |
luma-ray2 | 42–180 | Medium (~60–120s) | Cinematic quality |
mj-video-480p / mj-video-720p | 50–320 | Slow (~90s) | Artistic style |
⌘I

