← Back to API Docs

🚀 API Quickstart

Get started with the UGCKit API in under 5 minutes. Create carousels, AI videos, and reaction videos programmatically.

Prerequisites

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer ugck_live_xxxxxxxxxxxxx
Test vs Live Keys: Use ugck_test_ keys during development - they return mock data and don't consume credits. Switch to ugck_live_ for production.

Step-by-Step Guide

1 Get your API Key

Go to your dashboard → Settings → API tab. Click "Generate API Key". Choose Test or Live mode. Copy and save it securely - you won't see it again!

2 Make your first request

Let's create a carousel. The API is asynchronous - you'll get a job ID to poll for results.

Create a Carousel

curl -X POST https://ugckit.io/api/v1/carousels \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "5 Tips for Better Sleep",
    "num_slides": 5,
    "style": "educational"
  }'

Request Parameters:

ParameterTypeDescription
topicstring requiredThe topic or title for your carousel
num_slidesinteger optionalNumber of slides (3-10, default: 5)
stylestring optionalStyle: "educational", "promotional", "storytelling"

Response:

{
  "job_id": "abc12345",
  "status": "pending",
  "message": "Carousel generation started",
  "poll_url": "/api/v1/jobs/abc12345"
}
3 Poll for results

Use the job ID to check when your content is ready:

curl https://ugckit.io/api/v1/jobs/abc12345 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (completed):

{
  "job_id": "abc12345",
  "status": "completed",
  "progress": 100,
  "result": {
    "media_urls": [
      "https://storage.ugckit.io/users/.../slide_01.png",
      "https://storage.ugckit.io/users/.../slide_02.png",
      "https://storage.ugckit.io/users/.../slide_03.png"
    ],
    "thumbnail_url": "https://storage.ugckit.io/users/.../slide_01.png",
    "caption": "Your generated caption with hashtags..."
  }
}

Generate AI Videos

Create AI-generated videos from text prompts using Veo3, Sora, Runway, Pika, or Kling.

curl -X POST https://ugckit.io/api/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cat playing piano in a cozy living room, cinematic lighting",
    "model": "veo3",
    "duration": 5,
    "aspect_ratio": "9:16"
  }'
ParameterTypeDescription
promptstring requiredDescription of the video to generate
modelstring optional"veo3" (default), "sora", "runway", "pika", "kling"
durationinteger optionalVideo length in seconds (model-dependent)
aspect_ratiostring optional"9:16" (vertical), "16:9" (horizontal), "1:1" (square)

Create Reaction Videos

Generate AI avatar reactions to any video URL.

curl -X POST https://ugckit.io/api/v1/reaction-videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://example.com/viral-video.mp4",
    "reaction_style": "excited"
  }'
ParameterTypeDescription
video_urlstring requiredURL of the video to react to
persona_idstring optionalYour custom persona ID (uses default if omitted)
reaction_stylestring optional"excited", "shocked", "thoughtful", "funny"

Complete Python Example

import requests
import time

API_KEY = "ugck_live_xxxxx"
BASE_URL = "https://ugckit.io/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}

# 1. Create a carousel
response = requests.post(
    f"{BASE_URL}/carousels",
    headers=headers,
    json={
        "topic": "10 Morning Habits of Successful People",
        "num_slides": 6,
        "style": "educational"
    }
)
job = response.json()
job_id = job["job_id"]
print(f"Started job: {job_id}")

# 2. Poll until complete (with timeout)
for _ in range(60):  # Max 5 minutes
    status = requests.get(
        f"{BASE_URL}/jobs/{job_id}",
        headers=headers
    ).json()
    
    print(f"Status: {status['status']}")
    
    if status["status"] == "completed":
        print("✅ Done!")
        print(f"Slides: {status['result']['media_urls']}")
        print(f"Caption: {status['result']['caption']}")
        break
    elif status["status"] == "failed":
        print(f"❌ Failed: {status.get('error')}")
        break
    
    time.sleep(5)  # Wait 5 seconds between polls

Node.js Example

const axios = require('axios');

const API_KEY = 'ugck_live_xxxxx';
const BASE_URL = 'https://ugckit.io/api/v1';

async function createCarousel() {
  // Start the job
  const { data: job } = await axios.post(
    `${BASE_URL}/carousels`,
    {
      topic: '5 Ways to Boost Productivity',
      num_slides: 5,
      style: 'promotional'
    },
    { headers: { Authorization: `Bearer ${API_KEY}` } }
  );
  
  console.log(`Job started: ${job.job_id}`);
  
  // Poll for completion
  while (true) {
    const { data: status } = await axios.get(
      `${BASE_URL}/jobs/${job.job_id}`,
      { headers: { Authorization: `Bearer ${API_KEY}` } }
    );
    
    if (status.status === 'completed') {
      console.log('Done!', status.result);
      return status.result;
    }
    if (status.status === 'failed') {
      throw new Error(status.error);
    }
    
    await new Promise(r => setTimeout(r, 5000));
  }
}

createCarousel().catch(console.error);

Error Handling

The API returns standard HTTP status codes:

CodeMeaning
200Success
400Bad request - check your parameters
401Unauthorized - invalid or missing API key
403Forbidden - insufficient credits or plan
404Not found - job ID doesn't exist
429Rate limited - slow down requests
Insufficient Credits Error:
{
  "detail": {
    "error": "insufficient_credits",
    "credits_required": 10,
    "credits_balance": 5
  }
}

Rate Limits

Credit Costs

Webhook Support Coming Soon: We're adding webhook callbacks so you don't need to poll. Stay tuned!

Need Help?