⚠️ Prerequisites

Complete these on the website first

1. Buy Credits

Dashboard → Settings → Credit Packs → Choose plan & checkout

Required to generate scripts, images & videos

2. Connect YouTube

Dashboard → Settings → YouTube → Click Connect

Required to publish videos automatically

3. Get API Key

Dashboard → Settings → API Keys → Generate New Key

Use this key for all API requests

Quick Start

Prerequisites complete? Now use the API

Your API Key

Authorization: Bearer YOUR_API_KEY

Keep this secret! Use in all API requests:

Complete Automation Workflow

Generate script → images → video → publish → share

Step 1

Generate Script

Generate a video script based on a topic or niche

POST /api/scripts

Body:
{
  "topic": "AI trends 2024",
  "niche": "tech",
  "style": "educational",
  "duration_seconds": 60
}

Response:
{
  "id": "script-123",
  "text": "Did you know...",
  "duration_seconds": 59,
  "created_at": "2024-01-15T10:00:00Z"
}
Step 2

Generate Images

Create visuals for each scene based on the script

POST /api/v1/images/generate

Body:
{
  "script_id": "script-123",
  "prompts": [
    "futuristic AI visualization",
    "neural network connection"
  ]
}

Response:
{
  "images": [
    {
      "id": "img-1",
      "url": "https://...",
      "prompt": "futuristic AI visualization"
    }
  ]
}
Step 3

Generate Video

Combine script, images & music into a video

POST /api/v1/videos/generate

Body:
{
  "script_id": "script-123",
  "image_ids": ["img-1", "img-2"],
  "music_id": "music-123",
  "aspect_ratio": "9:16",
  "title": "AI Trends 2024"
}

Response:
{
  "video_id": "video-123",
  "status": "processing",
  "estimated_time": "30s",
  "callback_url": "https://yoursite.com/webhook"
}
Step 4

Connect YouTube

Authorize YouTube account (one-time)

POST /api/auth/youtube/connect

Body:
{
  "auth_code": "youtube_oauth_code"
}

Response:
{
  "connection_id": "conn-123",
  "status": "active",
  "channel": "My Channel"
}
Step 5

Publish to YouTube

Upload video directly to your YouTube channel

POST /api/videos/publish

Body:
{
  "videoGenerationId": "video-123",
  "platform": "youtube",
  "title": "AI Trends 2024",
  "description": "Discover the latest AI trends...",
  "uploadAsShort": true
}

Response:
{
  "publishId": "pub-123",
  "status": "uploading",
  "videoUrl": "https://youtube.com/watch?v=ABC123"
}
Step 6

Share Link

Get shareable link from publish response

Share the link from Step 5 response:

Platform URLs:
- YouTube: https://youtube.com/watch?v=VIDEO_ID
- Direct: Use in tweets, posts, emails

Social Share Prefix:
https://twitter.com/intent/tweet?url=YOUR_VIDEO_URL
https://www.facebook.com/sharer/sharer.php?u=YOUR_VIDEO_URL

Additional Endpoints

GET
/api/videos/status?id=VIDEO_ID

Check video generation progress

GET
/api/videos/publish/status?id=PUBLISH_ID

Check publish progress

GET
/api/profile

Get user profile & credit balance

GET
/api/keys

Manage API keys

🤖 Automate with n8n

Trigger video creation & publishing on a schedule

Workflow Setup:

  1. Create workflow in n8n
  2. Add "Schedule Trigger" (daily, weekly, etc.)
  3. Add "HTTP Request" nodes for each API step
  4. Chain them together (Script → Images → Video → Publish)
  5. Add error handling & notifications

n8n Nodes Needed:

Schedule Trigger
  ↓
HTTP Request → POST /api/scripts
  ↓
HTTP Request → POST /api/v1/images/generate
  ↓
HTTP Request → POST /api/v1/videos/generate
  ↓
Wait (for video to complete)
  ↓
HTTP Request → POST /api/videos/publish
  ↓
Send Email / Slack notification with share link

💡 Pro Tip:

Use n8n's "Wait" node to check video status before publishing. Poll the status endpoint every 5 seconds.