The AI Video Generation API for Agents

26 REST endpoints, four state-of-the-art video engines, HMAC-signed webhooks, and an OpenAPI 3.1 spec. From $0.07 per credit. No subscription required.

60-Second Quickstart

Render an 8-second Sora 2 video. Replace ugc_live_... with your key.

curl -X POST https://us-central1-viral-ugc-copilot.cloudfunctions.net/proxyStartVideoGeneration \
  -H "Authorization: Bearer ugc_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "data": {
      "engine": "sora",
      "quality": "standard",
      "duration": 8,
      "aspectRatio": "9:16",
      "scene": {
        "visualPrompt": "A creator unboxing a sleek matte-black water bottle, soft window light, vlog energy",
        "scriptText": "Okay this water bottle... this is unreal."
      }
    }
  }'

Built for Agents and Pipelines

Agent Automation

Drop the OpenAPI spec into your Claude or ChatGPT agent. The 26 endpoints cover the full workflow — analyze → script → image → video — so an agent can produce a finished ad without leaving the chat. Webhooks remove the polling loop.

Batch Render Pipelines

Render hundreds of variations programmatically across Sora 2, Veo 3.1, Kling 3.0, and Seedance 2.0 from one API key. Per-key concurrency caps (3 / 8 / 25 by tier) and Idempotency-Key support make retries safe.

Embed in Your SaaS

Add "Generate AI Video" to your own product. The TypeScript SDK ships typed responses generated from the OpenAPI spec. Each customer gets the video as a hosted URL or downloadable MP4.

Four Video Engines, One Endpoint

Pass engine on proxyStartVideoGeneration. Credits deduct on start; failures auto-refund within one poll cycle.

Engine Std HQ Notes
Sora 218 cr65 cr8s baseline, scales by duration
Veo 3.140 cr130 crFixed cost, fastest renders
Kling 3.025 cr50 cr6.4s baseline, image-to-video
Seedance 2.018 cr35 cr4s baseline, dance / motion

At the 10,000-credit pack rate ($0.07/credit), a Sora 2 standard 8-second render costs ~$1.26.

Reliability Features

Webhooks Eliminate Polling

Register a URL, get video.completed and video.failed events the moment a render finishes. At-least-once delivery, retries on 1m / 5m / 30m / 2h / 6h backoff. HMAC-SHA256 signature verification, 5-endpoint cap per account, rotatable secrets without overlap window.

Idempotent & Predictable

Every credit-deducting endpoint accepts Idempotency-Key. Network retries replay the cached response instead of re-charging. Auto-refund on engine failure, structured error codes, Retry-After headers, per-key concurrency caps prevent runaway billing.

API FAQ

Frequently Asked Questions

Do I need a subscription to use the API?
No. The API is pay-as-you-go: sign up, buy a credit pack starting at $25 / 200 credits ($0.125 per credit), and start calling endpoints. Subscribers get the same per-call rates plus bundled monthly credits and higher concurrency caps.
How do I authenticate?
Generate a key from your profile (format: ugc_live_...), then send it as Authorization: Bearer ugc_live_... on every request. Keys are scoped to a single account and revocable from the same screen.
How are credits charged for video generation?
Credits are deducted at proxyStartVideoGeneration based on engine, quality, and duration. If the engine fails downstream, the server auto-refunds within the same poll cycle. Use Idempotency-Key on all credit-deducting calls to prevent double-charges on network retries.
Do you support webhooks?
Yes. Register a webhook endpoint and receive video.completed and video.failed events signed with HMAC-SHA256. Retries follow a 1-min, 5-min, 30-min, 2-hr, 6-hr backoff schedule with at-least-once delivery — your handler must dedupe on the event id.
Is there a TypeScript or Python SDK?
Yes. The TypeScript SDK is generated from the OpenAPI 3.1 spec at /docs/openapi.yaml — fully typed responses, automatic Idempotency-Key UUIDs, retry-on-transient-failure, and a renderAndWait helper. A Python SDK ships from the same spec.
What are the rate limits?
Per-action sliding-window limits: 10/min for video generation, 40/min for images, 20/min for scripts, 10/min for analysis, 60/min general. 429 responses include a Retry-After header. Concurrency cap is per API key (3 / 8 / 25 in-flight credit-deducting ops by tier).
What video models are available?
Four engines: Sora 2 (OpenAI, cinematic actor performance), Veo 3.1 (Google, fastest fixed-cost rendering with native audio), Kling 3.0 (Kuaishou, image-to-video with strong motion), and Seedance 2.0 (ByteDance, low-cost duration-scaled). Each supports standard and HQ quality at 9:16, 16:9, and 1:1.

Ship in an Afternoon

Sign up, buy credits, and have your first AI-rendered video in under 10 minutes.

Create a Free Account See Credit Pricing