Introduction
The VideoGenAPI allows you to generate videos from text descriptions or images using advanced artificial intelligence technology. This RESTful API provides endpoints for video generation, status checking, and user management.
text_fields Text-to-Video
Generate videos from text descriptions using advanced AI models.
image Image-to-Video
Generate videos from an image and descriptive prompt.
Multiple AI Models
Choose from 10 different AI models including 8 free options and 2 premium models. Each model has unique capabilities and specifications.
AI Audio Enhancement
Add synchronized sound effects to your generated videos automatically! Use the add_audio
parameter to enhance your videos with AI-generated audio using Mirelo SFX V1.5. Optional audio_prompt
parameter lets you customize the sound effects.
content_copy Copy for AI Chats
Copy this entire documentation in markdown format to share
with AI assistants like ChatGPT, Claude, Cursor, etc.
The API automatically detects the generation mode based on provided parameters. When only the prompt
parameter is provided, it uses Text-to-Video mode. When both prompt
and image_url
parameters are provided, it activates Image-to-Video mode. Use the model
parameter to specify which AI model to use for generation.
Authentication
All API requests must include your API key in the Authorization header using Bearer token authentication:
Authorization: Bearer YOUR_API_KEY
Your API Key:
lt_**************
Base URL
All API endpoints are relative to the base URL:
https://videogenapi.com/api/v1/
AI Models
Model | Description | Resolution | Duration | Features |
---|---|---|---|---|
Sora 2 | Sora 2, developed by OpenAI, is the best model for generating highly realistic videos and audio with precise physical simulations and synchronized dialogue. | 1080p | 10-10s | Text-to-Video, Image-to-Video |
Higgsfield | Advanced AI model with excellent motion understanding and photorealistic output. Perfect for cinematic scenes. | 1080p | 5-15s | Text-to-Video |
Kling 2.5 | Kling 2.5 Turbo Pro: Top-tier text-to-video generation with unparalleled motion fluidity, cinematic visuals, and exceptional prompt precision. | 1080p | 5-10s | Text-to-Video, Image-to-Video |
Veo 3 Fast | Google's most advanced video generation model with unparalleled quality and incredible detail. | 1080p | 8-8s | Text-to-Video, Image-to-Video |
Nano Banana | Lightweight and fast AI model for quick creative video generation. Perfect for short clips and rapid prototyping. | 720p | 5-10s | Text-to-Video, Image-to-Video |
Pixverse V5 | Pixverse V5 is a proprietary AI model that generates highly realistic, high-quality videos. | 1080p | 5-8s | Text-to-Video, Image-to-Video |
LTX-Video 13B | LTX | 480p | 1-60s | Text-to-Video |
Veo 3.1 | Google's cutting-edge video generation model, delivering unmatched quality, hyper-realistic details, and enhanced creative control for stunning visuals. | 1080p | 8-8s | Text-to-Video, Image-to-Video |
Seedance | Lightning-fast model perfect for quick prototyping and creative experimentation. | 1080p | 5-10s | Text-to-Video, Image-to-Video |
Wan 2.5 | Wan 2.5 Video is an open-source AI model capable of automatically generating realistic videos with audio. | 1080p | 1-30s | Text-to-Video, Image-to-Video |
Endpoints
Generate Video
/v1/generate
Submit a video generation request from a text description (text-to-video) or from an image + text (image-to-video).
Automatic Mode Detection
The API automatically detects the generation mode based on parameters:
- Text-to-Video: When only the prompt parameter is provided
- Image-to-Video: When both prompt and image_url parameters are provided
Available AI Models
Free Models
-
sora-2
- Sora 2 (1080p, 10-10s) -
higgsfield_v1
- Higgsfield (1080p, 5-15s) -
kling_25
- Kling 2.5 (1080p, 5-10s) -
nanobanana-video
- Nano Banana (720p, 5-10s) -
pixverse
- Pixverse V5 (1080p, 5-8s) -
ltxv-13b
- LTX-Video 13B (480p, 1-60s) -
seedance
- Seedance (1080p, 5-10s) -
wan-25
- Wan 2.5 (1080p, 1-30s)
Premium Models
-
veo_3
- Veo 3 Fast (1080p, 8-8s) -
veo-31
- Veo 3.1 (1080p, 8-8s)
Parameters
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
model | string | Optional | AI model to use (sora-2, higgsfield_v1, kling_25, veo_3, nanobanana-video, pixverse, ltxv-13b, veo-31, seedance, wan-25) | sora-2 |
prompt | string | Required | Text description of the video (max 1000 characters) | - |
image_url | string | Optional | Source image URL (jpg, jpeg, png, gif, webp). If provided, activates image-to-video mode | - |
duration | integer | Optional | Duration in seconds (varies by model: 5-60s) | 5 |
resolution | string | Optional | Video resolution (480p, 720p, 1080p, 4K - varies by model) | 720p |
aspect_ratio | string | Optional | Aspect ratio (16:9, 4:3, 1:1, 9:21). Only for text-to-video mode | 16:9 |
seed | integer | Optional | Random seed to control generation (-1 for random) | random |
camera_fixed | boolean | Optional | Whether to fix the camera position | false |
add_audio | boolean | Optional | Add AI-generated sound effects synchronized with video | false |
audio_prompt | string | Optional | Guide audio generation with custom description | - |
Text-to-Video Example (cURL)
curl -X POST "https://videogenapi.com/api/v1/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling_25",
"prompt": "A cat playing with a ball in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "16:9",
"seed": 42
}'
Image-to-Video Example (cURL)
curl -X POST "https://videogenapi.com/api/v1/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo_3",
"prompt": "The dog runs in the park chasing a butterfly",
"image_url": "https://example.com/images/my-dog.jpg",
"duration": 15,
"resolution": "4K",
"camera_fixed": false,
"seed": 123456
}'
Text-to-Video with Audio Enhancement (cURL)
curl -X POST "https://videogenapi.com/api/v1/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling_25",
"prompt": "A cat playing with a ball in a sunny garden",
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "16:9",
"add_audio": true,
"audio_prompt": "Cheerful ambient sounds with soft nature background"
}'
Response Example (Text-to-Video)
{
"success": true,
"generation_id": "gen_686717fe97bd3_055867",
"request_id": "24076931-9c23-4d18-a1d4-9d5cb5369c62",
"status": "pending",
"type": "text-to-video",
"model": {
"key": "kling_25",
"name": "Kling 2.5",
"provider": "Kuaishou"
},
"prompt": "A cat playing with a ball in a sunny garden",
"duration": 10,
"resolution": "1080p",
"style": "realistic",
"fps": 30,
"aspect_ratio": "16:9",
"seed": 42,
"status_url": "/v1/status/gen_686717fe97bd3_055867",
"message": "Video generation request submitted successfully.",
"usage": {
"current_month_usage": 1,
"monthly_limit": 100
}
}
Check Status
/v1/status/{generation_id}
Check the status of a video generation request.
cURL Example
curl -X GET "https://videogenapi.com/api/v1/status/gen_686717fe97bd3_055867" \
-H "Authorization: Bearer YOUR_API_KEY"
Response Example (Completed)
{
"success": true,
"generation_id": "gen_686717fe97bd3_055867",
"status": "completed",
"type": "text-to-video",
"model": {
"key": "kling_25",
"name": "Kling 2.5",
"provider": "Kuaishou"
},
"video_url": "https://videogenapi.com/api/v1/video/gen_686717fe97bd3_055867",
"prompt": "A cat playing with a ball in a sunny garden",
"duration": 10,
"resolution": "1080p",
"style": "realistic",
"fps": 30,
"aspect_ratio": "16:9",
"processing_time": 764,
"completed_at": "2025-01-04 00:08:42",
"seed": 622177285
}
Public Access
The video URL is publicly accessible without authentication. You can share it directly!
Possible Status Values
Status | Description |
---|---|
pending | Request submitted, waiting for processing |
in_queue | Request is in the processing queue |
in_progress | Video generation in progress |
completed | Generation completed successfully |
failed | Generation failed |
List Generations
/v1/generations
Retrieve a list of your video generation requests.
cURL Example
curl -X GET "https://videogenapi.com/api/v1/generations?page=1&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
User Information
/v1/user
Retrieve user information and usage statistics.
cURL Example
curl -X GET "https://videogenapi.com/api/v1/user" \
-H "Authorization: Bearer YOUR_API_KEY"
Error Codes
The API uses conventional HTTP response codes to indicate the success or failure of an API request.
HTTP Code | Error | Description |
---|---|---|
400 | Bad Request | Invalid parameters or missing required fields |
401 | Unauthorized | Invalid or missing API key |
404 | Not Found | Resource not found |
429 | Too Many Requests | Rate limit or monthly usage limit exceeded |
500 | Internal Server Error | Internal server error |
Code Examples
PHP Complete PHP Example
<?php
class videogenAPI {
private $apiKey;
private $baseUrl = 'https://videogenapi.com/api/v1';
public function __construct($apiKey) {
$this->apiKey = $apiKey;
}
public function generateTextToVideo($prompt, $options = []) {
$data = array_merge([
'model' => 'higgsfield',
'prompt' => $prompt,
'duration' => 5,
'resolution' => '720p',
'aspect_ratio' => '16:9'
], $options);
return $this->makeRequest('/generate', 'POST', $data);
}
public function generateImageToVideo($prompt, $imageUrl, $options = []) {
$data = array_merge([
'model' => 'kling_2_1',
'prompt' => $prompt,
'image_url' => $imageUrl,
'duration' => 5,
'resolution' => '720p',
'camera_fixed' => false
], $options);
return $this->makeRequest('/generate', 'POST', $data);
}
public function getStatus($generationId) {
return $this->makeRequest('/status/' . $generationId);
}
private function makeRequest($endpoint, $method = 'GET', $data = null) {
// Implementation details...
}
}
// Usage examples...
?>
JS JavaScript Example
class videogenAPI {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseUrl = 'https://videogenapi.com/api/v1';
}
async generateTextToVideo(prompt, options = {}) {
const data = {
model: 'higgsfield',
prompt,
duration: 5,
resolution: '720p',
aspect_ratio: '16:9',
...options
};
return await this.makeRequest('/generate', 'POST', data);
}
async generateImageToVideo(prompt, imageUrl, options = {}) {
const data = {
model: 'kling_2_1',
prompt,
image_url: imageUrl,
duration: 5,
resolution: '720p',
camera_fixed: false,
...options
};
return await this.makeRequest('/generate', 'POST', data);
}
// Additional methods...
}
AI Audio Enhancement
Automatically add synchronized sound effects to your videos using the Mirelo SFX V1.5 model. This feature automatically detects the video content and generates appropriate audio, or you can provide a custom audio prompt for fine-tuned control.
How It Works
- Submit a video generation request with
add_audio: true
- Video is generated normally by the selected model
- Audio enhancement automatically begins after video generation completes
- AI-generated sound effects are synchronized with the video
- Final video with audio is returned when complete
Audio Enhancement Parameters
Parameter | Type | Description |
---|---|---|
add_audio | boolean | Enable automatic audio enhancement (default: false) |
audio_prompt | string | Optional custom guidance for audio generation. Examples: "upbeat pop music", "nature sounds with birds", "cinematic orchestral soundtrack" |
Example Request
{
"model": "kling_25",
"prompt": "A cat playing with a ball in a sunny garden",
"duration": 10,
"resolution": "1080p",
"add_audio": true,
"audio_prompt": "cheerful ambient sounds with soft nature background"
}
Processing Time
Audio enhancement adds additional processing time after video generation. Total time will be the video generation time plus audio synthesis time (typically 10-30 seconds). The same generation_id
is used throughout the process.
Support
schedule Response Time
We typically respond within:
24-48 hoursVideo Specifications
Feature | Value |
---|---|
Output format | MP4 (H.264 codec) |
Duration | 5-10 seconds |
Resolutions | 480p, 720p, 1080p, 4K |
Aspect ratios | 16:9, 4:3, 1:1, 9:21 |
Frame rate | 30 FPS |