Skip to content

    API documentation

    Generate standalone videos

    Create standalone AI videos from a text prompt, a starting image, start and end frames, up to 9 reference images, or a synchronized audio track. For full-song music videos with storyboards and multi-shot editing, use the Music Video API.

    The Video API follows the standard Task model: authenticate with x-api-key, supply public HTTPS URLs for any reference media (no large-file upload required), receive a taskId, and poll or receive a completion webhook.


    The generation mode is inferred automatically from the media URLs you provide:

    ModeRequired media fieldsDescription
    t2vNone (prompt only)Text-to-video generation.
    i2vimageUrl (or firstFrameUrl)Image-to-video starting from a first frame.
    l2vlastFrameUrlVideo ending on a target final frame.
    fl2vfirstFrameUrl + lastFrameUrlVideo transitioning between start and end frames.
    ref2vreferenceImageUrls (1–9 URLs)Multi-image reference generation for subjects, objects, or style.

    Input rules:

    • All media fields (imageUrl, firstFrameUrl, lastFrameUrl, referenceImageUrls, audioUrl) accept publicly reachable https:// URLs without embedded credentials.
    • imageUrl cannot be combined with firstFrameUrl, lastFrameUrl, or referenceImageUrls.
    • referenceImageUrls cannot be combined with firstFrameUrl or lastFrameUrl.
    • Optional audioUrl locks lip movement and motion rhythm to the supplied audio track. Audio length must match the delivered output duration (for example, about 5.17 seconds for a 5-second request).
    • promptOptimizer defaults to true, rewriting free-text prompts into structured motion and camera descriptions on first submission. Set promptOptimizer: false to send your prompt verbatim.

    Requires task:read. Returns supported modes, resolutions (480p, 768p, 1080p, 2k), aspect ratios (21:9 through 9:21), duration bounds (5–15 seconds), audio lock support, and the published per-second credit rate table.

    Terminal window
    curl https://api.omnapi.com/api/v1/videos/capabilities \
    -H "x-api-key: $OMNAPI_KEY"

    Requires task:create. Read-only credit quote with no balance deduction and no external media download.

    Terminal window
    curl -X POST https://api.omnapi.com/api/v1/videos/quote \
    -H "x-api-key: $OMNAPI_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "resolution": "768p",
    "aspectRatio": "16:9",
    "duration": 5,
    "imageUrl": "https://media.example.com/start.jpg"
    }'

    Requires task:create and a unique Idempotency-Key header for each new logical generation. Reuse the same Idempotency-Key and identical JSON body to safely retry a timed-out request without double-charging credits.

    Terminal window
    export REQUEST_KEY="$(uuidgen)"
    Terminal window
    curl -X POST https://api.omnapi.com/api/v1/videos \
    -H "x-api-key: $OMNAPI_KEY" \
    -H "Idempotency-Key: $REQUEST_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "prompt": "A golden-hour lighthouse beside crashing ocean waves, slow cinematic push-in",
    "aspectRatio": "16:9",
    "resolution": "1080p",
    "duration": 5,
    "maxCredits": 60
    }'
    {
    "taskId": "01995900-0000-7000-8000-000000000101",
    "model": "omn-video-1",
    "mode": "i2v",
    "status": "PENDING",
    "creditsRequired": 30,
    "pollUrl": "/api/v1/videos/01995900-0000-7000-8000-000000000101"
    }

    Requires task:read. Returns lifecycle status (PENDING, PROCESSING, POLLING, COMPLETED, FAILED, CANCELLED), progress percentage, and the delivered MP4 output once COMPLETED. You can also use the shared GET /api/v1/tasks/{taskId} endpoint or SSE stream at GET /api/v1/tasks/{taskId}/stream.

    Terminal window
    curl https://api.omnapi.com/api/v1/videos/01995900-0000-7000-8000-000000000101 \
    -H "x-api-key: $OMNAPI_KEY"
    {
    "taskId": "01995900-0000-7000-8000-000000000101",
    "model": "omn-video-1",
    "status": "COMPLETED",
    "progress": 100,
    "creditsUsed": 30,
    "output": {
    "url": "https://media.example.com/play/output.mp4",
    "downloadUrl": "https://media.example.com/download/output.mp4",
    "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "width": 1280,
    "height": 768,
    "duration": 5.17,
    "retainUntil": "2026-12-16T00:00:00.000Z"
    },
    "error": null,
    "createdAt": "2026-12-01T10:00:00.000Z",
    "completedAt": "2026-12-01T10:00:42.000Z"
    }

    Download and archive output.downloadUrl before output.retainUntil if you need long-term retention, and verify integrity with output.sha256.

    Requires task:cancel. Cancels a queued or active video generation task.

    Terminal window
    curl -X POST https://api.omnapi.com/api/v1/videos/01995900-0000-7000-8000-000000000101/cancel \
    -H "x-api-key: $OMNAPI_KEY"

    Credits are deducted atomically at task creation based on output resolution and requested duration (creditsPerSecond × duration):

    ResolutionCredits / second5-second example8-second example
    480p420 credits32 credits
    768p630 credits48 credits
    1080p1260 credits96 credits
    2k (1440p short edge)24120 credits192 credits
    • Set maxCredits on POST /api/v1/videos to guard against unexpected charges.
    • If server-side media validation fails, external media cannot be fetched, generation fails, or a cancellation is confirmed before completion, OmnAPI automatically refunds the full credit charge. See Credits and refunds.