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 6 different AI models including free options like Higgsfield and Kling 2.1, or premium models like Google's Veo 3. Each model has unique capabilities and specifications.
New Feature!
Generated videos are now publicly accessible without authentication! Share your creations with the world effortlessly.
Automatic Validation
The API automatically validates parameters based on the selected model. Each model has different supported resolutions, durations, and features. Invalid parameters are rejected with clear error messages.
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 |
---|---|---|---|---|
Higgsfield | A free AI model with 4K resolution and 5-15s duration. Generates high-quality videos from text descriptions. | 4K | 5-15s | Text-to-Video, Image-to-Video |
Kuaishou Kling 2.1 | A free AI model with 4K resolution and 5-20s duration. Generates high-quality videos from text descriptions. | 4K | 5-20s | Text-to-Video, Image-to-Video |
MiniMax Hailuo 2 | A free AI model with 1080p resolution and 5-15s duration. Generates high-quality videos from text descriptions. | 1080p | 5-15s | Text-to-Video, Image-to-Video |
ByteDance Seedance | A free AI model with 1080p resolution and 5-10s duration. Generates high-quality videos from text descriptions. | 1080p | 5-10s | Text-to-Video, Image-to-Video |
Google Veo 3 | A premium AI model with 4K resolution and 5-60s duration. Generates high-quality videos from text descriptions. | 4K | 5-60s | Text-to-Video, Image-to-Video |
FAL-AI Vidu Soul | A premium AI model that generates videos from text descriptions. It's a reference-to-video model. | 4K | 5-10s | 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
higgsfield_v1
- Higgsfield AI (4K, 5-15s)kling_21
- Kuaishou Kling 2.1 (4K, 5-20s)hailuo_2
- MiniMax Hailuo 2 (1080p, 5-15s)seedance_lite
- ByteDance Seedance (1080p, 5-10s)
Premium Models
veo_3
- Google Veo 3 (4K, 5-60s)higgsfield_soul
- FAL-AI Vidu Soul (Reference-to-video)
Parameters
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
model | string | Optional | AI model to use (higgsfield_v1, kling_21, veo_3, hailuo_2, seedance_lite, higgsfield_soul) | seedance_lite |
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 |
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_21",
"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
}'
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_21",
"name": "Kling 2.1",
"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_21",
"name": "Kling 2.1",
"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...
}
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 |