API Documentation

Learn how to integrate AI video generation into your applications

Getting Started
Follow these steps to start using the AI Video Generation API

1. Get your API Key

Go to your dashboard and create a new API key. Save it securely as it won't be shown again.

2. Set up Authentication

Include your API key in the Authorization header of all requests:

Authorization: Bearer YOUR_API_KEY

3. Make your first request

Send a POST request to generate a video and poll the status endpoint for results.

Generate Video
POST
/api/v1/video/generate

Request Body

{
  "prompt": "A beautiful sunset over the ocean with waves",
  "duration": "5",        // "5" or "8" (seconds)
  "quality": "720p",      // "720p" or "1080p"
  "aspectRatio": "16:9",  // "16:9", "9:16", "1:1", "4:3", "3:4"
  "imageUrl": "https://example.com/image.jpg" // Optional
}

Response

{
  "success": true,
  "data": {
    "taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6",
    "creditsUsed": 10,
    "status": "pending",
    "message": "Video generation started successfully"
  }
}

Example Request

curl -X POST https://your-domain.com/api/v1/video/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A beautiful sunset over the ocean",
    "duration": "5",
    "quality": "720p",
    "aspectRatio": "16:9"
  }'
Error Handling
Common error responses and how to handle them
401

Unauthorized

Invalid or missing API key. Check your authorization header.

402

Insufficient Credits

Your account doesn't have enough credits for this operation.

429

Rate Limited

Too many requests. Please wait before trying again.

Credit Usage
How credits are calculated for different video configurations
Base (5s, 720p)
10 credits
8 second duration
+5 credits
1080p quality
+10 credits

Credits are deducted when video generation starts and cannot be refunded once processing begins.