AI Short-Form Video API — Generate TikTok, Reels & Shorts Clips (2026)

Sep 9, 2026·7 min read

Your content platform needs to auto-generate 9-second vertical clips on demand — one per user, per topic, per product. The spec is straightforward: 9:16 aspect ratio, 1080p, fast turnaround. The decision is which model to use, how billing scales with clip duration, and how to batch submissions without blocking your application.

This guide covers model selection, duration and resolution configuration, batch async patterns, and cost math at 100/500/2,000 clips per month using GenRelay.

Which Video Model Is Right for Short-Form Social Content?

Short-form social clips have a specific profile: 5–15 seconds, vertical 9:16, high visual quality. The three GenRelay video models have meaningfully different billing models and cost curves:

Model Billing model 5s clip 9s clip 15s clip Typical latency
Grok Imagine 1.0 Per second ($0.010/s) $0.05 $0.09 $0.15 30–60s
Grok Imagine 1.5 Per second ($0.022/s) $0.11 $0.20 $0.33 45–90s
Omni Flash 720p Per generation ($0.10) $0.10 $0.10 $0.10 20–45s
Omni Flash 1080p Per generation ($0.15) $0.15 $0.15 $0.15 20–45s
Veo 3.1 Lite 720p Per second ($0.060/s) $0.30 $0.54 $0.90 60–120s
Veo 3.1 Lite 1080p Per second ($0.120/s) $0.60 $1.08 $1.80 60–120s

Key insight: Omni Flash uses flat per-generation billing — the cost is identical whether the clip is 5 or 15 seconds. Grok and Veo 3.1 Lite charge per second, so cost scales linearly with duration.

The breakeven between Grok Imagine 1.0 ($0.010/s) and Omni Flash 1080p ($0.15/generation):
$0.15 ÷ $0.010 = 15 seconds

At exactly 15 seconds, both cost the same. For clips shorter than 15 seconds, Grok 1.0 is cheaper. For clips at or over 15 seconds, Omni Flash 1080p is more cost-efficient.

How Do I Configure Duration and Aspect Ratio?

Pass duration (integer, seconds), aspect_ratio, and resolution in the request body. For TikTok, Reels, and Shorts, target 9:16 vertical.

import requests
import time

API_KEY = "YOUR_GENRELAY_KEY"

def submit_clip(prompt, duration=9, model="grok-imagine-1-0", resolution="1080p"):
    """Submit a short-form video generation job."""
    response = requests.post(
        "https://genrelay.ai/v1/videos/generations",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        },
        json={
            "model": model,
            "prompt": prompt,
            "duration": duration,
            "aspect_ratio": "9:16",
            "resolution": resolution
        }
    )
    response.raise_for_status()
    return response.json()["id"]

def poll_until_done(job_id, interval=10, timeout=180):
    """Poll a video job until it succeeds or times out."""
    deadline = time.time() + timeout
    while time.time() < deadline:
        resp = requests.get(
            f"https://genrelay.ai/v1/videos/generations/{job_id}",
            headers={"Authorization": f"Bearer {API_KEY}"}
        )
        job = resp.json()
        status = job["status"]
        if status == "succeeded":
            return job["output"]["url"]
        elif status == "failed":
            raise RuntimeError(f"Job failed: {job.get('error', 'unknown')}")
        time.sleep(interval)
    raise TimeoutError(f"Job {job_id} did not complete within {timeout}s")

# Generate a 9-second vertical clip with Grok Imagine 1.0
job_id = submit_clip(
    prompt=(
        "A developer typing on a mechanical keyboard, close-up shot, "
        "neon cyan backlight glow, fast editorial pacing, cinematic quality. "
        "Vertical 9:16 frame, no text overlays."
    ),
    duration=9,
    model="grok-imagine-1-0",
    resolution="1080p"
)
print(f"Submitted job: {job_id}")

video_url = poll_until_done(job_id)
print(f"Video ready: {video_url}")

Cost for this job: 9s × $0.010/s = $0.09.

How Do I Batch Generate Clips Concurrently?

For a platform generating clips across many users or content topics, fire all jobs concurrently and collect results as they complete. Concurrent submission dramatically reduces total wall-clock time.

import asyncio
import aiohttp

API_KEY = "YOUR_GENRELAY_KEY"

TOPICS = [
    "Abstract glowing particles on dark background, looping motion, 9:16 vertical",
    "Coffee being poured in slow motion, warm cafe bokeh, 9:16 vertical",
    "Smartphone home screen with notification animation, minimal UI, 9:16 vertical",
    "City timelapse at sunset from rooftop, golden hour, 9:16 vertical",
    "A plant growing in fast-forward, green nature close-up, 9:16 vertical",
]

async def submit_job(session, prompt):
    async with session.post(
        "https://genrelay.ai/v1/videos/generations",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={
            "model": "grok-imagine-1-0",
            "prompt": prompt,
            "duration": 8,
            "aspect_ratio": "9:16",
            "resolution": "720p"
        }
    ) as resp:
        data = await resp.json()
        return data["id"]

async def poll_job(session, job_id, timeout=180):
    deadline = asyncio.get_event_loop().time() + timeout
    while asyncio.get_event_loop().time() < deadline:
        async with session.get(
            f"https://genrelay.ai/v1/videos/generations/{job_id}",
            headers={"Authorization": f"Bearer {API_KEY}"}
        ) as resp:
            job = await resp.json()
            if job["status"] == "succeeded":
                return job["output"]["url"]
            elif job["status"] == "failed":
                return None
        await asyncio.sleep(10)
    return None

async def run_batch(topics):
    async with aiohttp.ClientSession() as session:
        job_ids = await asyncio.gather(*[submit_job(session, p) for p in topics])
        print(f"Submitted {len(job_ids)} jobs")
        results = await asyncio.gather(*[poll_job(session, jid) for jid in job_ids])
        return results

urls = asyncio.run(run_batch(TOPICS))
for i, url in enumerate(urls):
    status = url if url else "FAILED"
    print(f"Clip {i + 1}: {status}")

Five clips submitted simultaneously at 8s each with Grok 1.0 at 720p:
5 × 8s × $0.010/s = $0.40 total, finishing in roughly one generation cycle (~45s).

What Does Scale Cost?

Grok Imagine 1.0 at 9 seconds, 1080p ($0.010/s):

Monthly volume Cost per clip Monthly cost
100 clips $0.09 $9.00
500 clips $0.09 $45.00
2,000 clips $0.09 $180.00

Omni Flash at 1080p ($0.15/generation, any duration ≤15s):

Monthly volume Cost per clip Monthly cost
100 clips $0.15 $15.00
500 clips $0.15 $75.00
2,000 clips $0.15 $300.00

Veo 3.1 Lite at 9 seconds, 1080p ($0.120/s):

Monthly volume Cost per clip Monthly cost
100 clips $1.08 $108.00
500 clips $1.08 $540.00
2,000 clips $1.08 $2,160.00

Veo 3.1 Lite costs roughly 12× more per clip than Grok 1.0 at the same duration and resolution. The premium buys measurably higher visual quality and native synchronized audio — use it selectively for hero content rather than bulk generation.

Which Model Fits Which Use Case?

Content type Recommended model Why
Bulk background and B-roll clips (≤9s) Grok Imagine 1.0 Lowest per-second cost, fast latency
Fixed-duration clips (10–15s) Omni Flash 1080p Flat billing beats per-second at longer durations
Premium brand or hero clips Veo 3.1 Lite 1080p Highest output quality, includes synchronized AI audio
Animate a product photo (i2v) Grok Imagine 1.5 Supports image-to-video input, per-second billing

For most social content platforms, a two-tier model strategy is practical: Grok 1.0 for the default generation path, Veo 3.1 Lite unlocked as an optional premium output for users on higher plan tiers.

Internal Links

FAQ

Does the API support 9:16 vertical format for TikTok and Reels?
Yes. Pass "aspect_ratio": "9:16" in the request body. All three video models on GenRelay (Veo 3.1 Lite, Grok Imagine, Omni Flash) support vertical output. If omitted, the default aspect ratio is 16:9 landscape.

What is the minimum and maximum clip duration?
Duration ranges vary by model. Grok Imagine 1.0 and 1.5 support 5–15 seconds. Veo 3.1 Lite supports 5–8 seconds. Omni Flash supports up to 15 seconds per generation. For full limits, see the AI video duration API guide.

Can I add captions or text overlays to generated clips?
Not natively via the video generation endpoint — text overlays are a post-processing step. Generate the raw clip, then apply overlays using FFmpeg's drawtext filter or a library like MoviePy before serving.

How long does generation take for a 9-second clip?
Typical latency: Omni Flash (20–45s), Grok Imagine 1.0 (30–60s), Veo 3.1 Lite (60–120s). Use async polling with a 10-second interval and a 3-minute timeout. For production patterns, see the async video API polling guide.

Is there a free tier for testing video generation?
Yes. GenRelay includes free credits on signup, sufficient to test a handful of video generations across models. No credit card is required to start.


As of September 2026. Pricing subject to change — verify current rates at genrelay.ai.

Related posts

Join our DiscordAI Short-Form Video API — Generate TikTok, Reels & Shorts Clips (2026) — GenRelay