Video AI
Generate stunning AI-powered videos from text prompts or reference images. Create cinematic animations with precise camera movements.
Pricing Information
Using the Video AI API costs 10 credits per video generation. Make sure you have sufficient credits in your account before making API calls.
Endpoint
HTTP Method
POST https://api.mnmlai.dev/v1/video-ai
Request
Send a POST request with multipart/form-data containing your image, prompt and optional parameters for video generation.
Required Parameters
Parameter | Type | Description |
---|---|---|
image | File | Starting image for video generation (JPG, PNG, GIF, WebP; max 10MB) |
prompt | String | Description of the video content and style you want to generate |
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
duration | Number | 10 | Video duration in seconds |
cfg_scale | Number | 0.5 | Prompt guidance scale (higher values = more adherence to prompt) |
aspect_ratio | String | "16:9" | Video aspect ratio (e.g., "16:9", "4:3", "1:1") |
negative_prompt | String | "" | Elements to exclude from the video |
movement_type | String | "horizontal" | Camera movement: "horizontal" | "vertical" | "zoom_in" | "zoom_out" | "pan" |
direction | String | "left" | Movement direction: "left" | "right" | "up" | "down" |
seed | Number | random | Seed for reproducible results (integer) |
Response
The Video AI endpoint processes your request asynchronously. You'll receive a request ID that you can use to check the status and retrieve the generated video.
Success Response (200 OK)
{
"status": "success",
"id": "b09ssvpzzhrj00cmzt1bykjzp1",
"seed": 123456,
"prompt": "cinematic video animation, camera glides to the left to left direction, snowy mountain landscape with aurora borealis"
}
Examples
Basic Example
curl -X POST https://api.mnmlai.dev/v1/video-ai \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/reference.jpg" \
-F "prompt=snowy mountain landscape with aurora borealis"
Advanced Example with All Parameters
curl -X POST https://api.mnmlai.dev/v1/video-ai \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/reference.jpg" \
-F "prompt=snowy mountain landscape with aurora borealis" \
-F "duration=15" \
-F "cfg_scale=0.7" \
-F "aspect_ratio=16:9" \
-F "negative_prompt=buildings, people" \
-F "movement_type=zoom_out" \
-F "direction=left" \
-F "seed=42"
Node.js Example
const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const form = new FormData();
form.append('image', fs.createReadStream('reference.jpg'));
form.append('prompt', 'snowy mountain landscape with aurora borealis');
form.append('duration', '15');
form.append('cfg_scale', '0.7');
form.append('aspect_ratio', '16:9');
form.append('negative_prompt', 'buildings, people');
form.append('movement_type', 'zoom_out');
form.append('direction', 'left');
form.append('seed', '42');
const response = await axios.post(
'https://api.mnmlai.dev/v1/video-ai',
form,
{
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
}
);
console.log('Request ID:', response.data.id);
Python Example
import requests
url = 'https://api.mnmlai.dev/v1/video-ai'
files = {
'image': open('reference.jpg', 'rb')
}
data = {
'prompt': 'snowy mountain landscape with aurora borealis',
'duration': '15',
'cfg_scale': '0.7',
'aspect_ratio': '16:9',
'negative_prompt': 'buildings, people',
'movement_type': 'zoom_out',
'direction': 'left',
'seed': '42'
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
print(f"Request ID: {result['id']}")
Processing Status
After submitting your request, use the Status Check endpoint with the returned ID to monitor processing progress:
Status Check Endpoint
GET https://api.mnmlai.dev/v1/status/{id}
Error Handling
Common Error Responses
// 400 Bad Request - Missing required parameters
{
"status": "error",
"code": "MISSING_PROMPT",
"message": "Prompt is required"
}
// 400 Bad Request - Not enough credits
{
"status": "error",
"code": "NO_CREDITS",
"message": "You do not have enough credits to use this feature"
}
// 400 Bad Request - Image too large
{
"status": "error",
"code": "IMAGE_TOO_LARGE",
"message": "Image file is too large"
}
// 400 Bad Request - Invalid image type
{
"status": "error",
"code": "INVALID_IMAGE_TYPE",
"message": "Invalid image type"
}
// 401 Unauthorized - Invalid API key
{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}