Limited-time Thanksgiving offer · 50% off platform fees for new users’ first 7 days (1.25% instead of 2.5%). Sign up by Dec 1. Sign up now → Details
Discord

← API reference

Video

POST/v1/videos

One endpoint, three modes — which one you get depends only on which fields you pass alongside model/prompt.

Parameters

ParameterTypeDescription
promptstringRequired for most models; optional for the one model with no text-to-video mode at all (fal/happy-horse, animates the image with no guidance if omitted).
modelstringOptional, default "machgen/minimax-h3" (also the "auto" resolution). No auto-router for video yet — pin a slug from the catalog.
duration_secsnumberOptional, default 4. Snapped to the nearest value the model actually supports; some models bill a fixed length regardless of what's requested.
strict_durationbooleanOptional, default false. With true, duration_secs is never snapped: only hosts that render exactly that length are used (fallbacks included), and if none can, the call is a 400 unsupported_duration and nothing is charged. Needs an explicit duration_secs. Not applied to video edit or upscale calls, whose length follows the source clip. A row whose capabilities.duration_secs is null declares no limits, so the number is passed to the host as is.
aspect_ratio / resolutionstringOptional. Combine to request a size — e.g. resolution: "720p" + aspect_ratio: "9:16". aspect_ratio is one of 16:9/9:16/1:1/4:3/3:4/21:9; resolution is a tier the specific model supports (varies per model — see its catalog entry). An unsupported combination is silently ignored (model default used), never a 400.
height / widthintegerOptional. Explicit pixel dimensions — overrides aspect_ratio/resolution when given, same precedence as size on /v1/images.
start_image_urlstringOptional — image-to-video. Public https:// URL or inline data:image/...;base64,... URI, animates that starting frame.
input_referencesarrayOptional — reference-to-video. One mixed array; each entry's type says what it is: {"type":"image_url","image_url":{"url":...}}, {"type":"video_url","video_url":{"url":...}} or {"type":"audio_url","audio_url":{"url":...}}. Per-type and combined caps are model-dependent (e.g. up to 9 images, 3 videos, 3 audio clips on supporting models). The old input_video_references / input_audio_references fields are deprecated but still accepted and merged in.
input_audio_urlstringOptional — single-file audio-to-video, LTX-2.5 only.
input_video_urlstringOptional — video editing. A single URL to an existing clip to modify (not guide a new generation with, unlike a video_url entry in input_references); requires a non-empty prompt describing the edit on every model except Kling v3.0 Motion Control (see next row), and is mutually exclusive with every other input field above on every model except that one. See Video editing.
draftbooleanOptional — Seedance 2.5 draft mode. true renders a cheap 480p preview (resolution is forced to 480p); text/image-to-video only. The response carries "draft": true and draft_expires_at. See Draft mode.
task_typestringOptional — Seedance 2.5 reference-video task: auto (default — the prompt decides, and an edit/extension then follows the clip’s own length and ratio), reference (generate a new video guided by the references; your duration_secs / aspect_ratio are honored), edit (edit the single reference clip; output length and ratio follow it, billed on the clip’s length) or extend (continue the clip; ratio follows it). Requires a video_url entry in input_references (exactly one clip for edit/extend). A pinned value routes only to hosts with an explicit task field (Atlas Cloud, Fal, MachGen, and for edit/extend only, TOAPIS and WaveSpeed); reference can’t be pinned on TOAPIS/WaveSpeed/OpenSand, which decide from the prompt whether a call is a new generation, edit or extension. A pin no host can honor 400s with task_type_not_supported.
auto_upscalebooleanOptional — Seedance 2.5 auto upscale. Renders at your resolution and AI-upscales one tier up (480p→720p, 720p→1080p, 1080p→1440p), priced at that upscaled tier. Can’t combine with draft. Otherwise 400 auto_upscale_not_supported.
seedintegerOptional (0–2147483647) — reproducible generation, Wan models only (Wan 3.0 / 3.0 Prime / 2.7). The same seed with the same prompt and parameters gives a similar (not guaranteed identical) clip. Text-, image- and reference-to-video only. Seedance ignores seeds on every host we tested, so it is refused with 400 seed_not_supported instead of being accepted and ignored. Routes only to hosts that carry a seed.
generate_audiobooleanOptional — soundtrack on/off. Sent to rows whose capabilities.generate_audio is true on GET /v1/models (most of them generate sound when it is left out). On some models sound costs more. See Sound and prompt rewriting. Non-boolean → 400 invalid_generate_audio.
prompt_extendbooleanOptional — the model’s own prompt rewriting / expansion. true lets the model rewrite and expand your prompt; false uses it exactly as written. Supported on Wan 2.5 / 2.7 / 3.0, MiniMax H3, HeyGen Video 1, P-Video, Decart Lucy and Hailuo 2.3 on the hosts that expose the switch (the same toggle as Enhance prompt in the Studio); a request with it routes only to those rows, else 400 prompt_extend_not_supported. Omitted → the row’s own default.
draft_idstringOptional — the id of a completed draft; renders its 1080p final as a new job (from_draft on the response). Must be the only field (plus optional model) — no prompt/inputs/duration. Valid for 7 days, once.
end_image_urlstringOptional — pins the last frame (use with start_image_url). Same URL / data: URI forms. Only models that support a last frame accept it; others 400 instead of silently dropping it. See Video generation.
keyframesarrayOptional — 1–10 objects {"image_url": "...", "frame_index": 0} pinning images to frames of the 24 fps clip (frame_index unique, at most duration_secs × 24). Its own mode: can’t combine with start_image_url, end_image_url, any reference/input_* field or draft. Models: fal/flux-3-max, fal/flux-3-keyframes.
character_orientationstringOptional, Kling motion-control rows only — "video" (default, the character follows the reference video’s orientation) or "image". Anything else 400s. See Motion control.
scale_factor / fps / upscale_presetnumber / integer / stringOptional, video upscalers only (send the clip as input_video_url). scale_factor: output multiplier, >0 and ≤10 (or pick a resolution tier instead). fps: whole-number output frame rate, only on upscalers that can change it, within that model’s range (else 400 invalid_fps). upscale_preset: Topaz Precision only (else 400 invalid_upscale_preset).
models / allow_model_fallbackarray / booleanOptional. models is up to 5 extra model slugs tried, in order, if model can’t serve the request. allow_model_fallback: false (default true) ignores that list entirely — it is separate from provider.allow_fallbacks, which only governs retrying other hosts of the same model.
webhook_urlstringOptional — an https:// URL that is POSTed the finished job (the same object the status route returns, with cost_usd) when it completes or fails, signed with X-VideoRouter-Signature. Must resolve to a public address, else 400 invalid_webhook_url. Omit it to use the default saved under Org admin → Webhooks; null skips webhooks for this request. Polling still works. Webhooks →
storebooleanOptional. false deletes the output 24 hours after the job completes instead of after the default 30 days. It shortens the lifetime; the result is still stored so it can be delivered. See Data retention.
output_ttl_secsintegerOptional. Delete the output this many seconds after the job completes: 86400 (24 hours) to 2592000 (30 days), overriding store. A smaller value is raised to 24 hours. The finished job reports output_expires_at.
provider / failoverobjectOptional. Same provider-preference shape as chat's provider, plus a timeout-triggered hedge (failover.on_timeout_sec) that resubmits to the next-cheapest untried host — both attempts get billed.

Complete request body (every field)

A reference showing every accepted field at once — do not send it as-is. Almost every field is optional, and the input fields are mutually exclusive by mode (see the table above and the per-mode examples below); a model that doesn’t support a field you send answers 400 rather than ignoring it.

{
  "model": "machgen/minimax-h3",
  "prompt": "A red fox runs through fresh snow at sunrise",
  "duration_secs": 5,
  "aspect_ratio": "16:9",
  "resolution": "720p",
  "width": 1280,
  "height": 720,

  "start_image_url": "https://example.com/first.jpg",
  "end_image_url": "https://example.com/last.jpg",
  "keyframes": [
    { "image_url": "https://example.com/a.jpg", "frame_index": 0 },
    { "image_url": "https://example.com/b.jpg", "frame_index": 120 }
  ],
  "input_references": [
    { "type": "image_url", "image_url": { "url": "https://example.com/ref.jpg" } },
    { "type": "video_url", "video_url": { "url": "https://example.com/ref.mp4" } },
    { "type": "audio_url", "audio_url": { "url": "https://example.com/ref.mp3" } }
  ],
  "input_audio_url": "https://example.com/soundtrack.mp3",
  "input_video_url": "https://example.com/clip.mp4",

  "draft": false,
  "draft_id": "video_...",
  "task_type": "auto",
  "auto_upscale": false,
  "seed": 42,
  "generate_audio": true,
  "prompt_extend": false,
  "character_orientation": "video",
  "scale_factor": 2,
  "fps": 60,
  "upscale_preset": "...",

  "provider": { "order": ["fal"], "allow_fallbacks": true },
  "failover": { "on_timeout_sec": 120 },
  "models": ["veo-3.1", "grok-imagine-video"],
  "allow_model_fallback": true,

  "webhook_url": "https://example.com/hooks/video",
  "store": true,
  "output_ttl_secs": 86400
}

Per-mode request bodies

// text-to-video
{ "model": "veo-3.1", "prompt": "A red fox runs through fresh snow", "duration_secs": 8,
  "aspect_ratio": "16:9", "resolution": "720p" }

// image-to-video (optionally pin the last frame with end_image_url)
{ "model": "veo-3.1", "prompt": "The fox turns and looks at the camera",
  "start_image_url": "https://example.com/first.jpg" }

// reference-to-video
{ "model": "bytedance/seedance-2.5", "prompt": "A woman walks through the city shown in the references",
  "input_references": [
    { "type": "image_url", "image_url": { "url": "https://example.com/woman.jpg" } },
    { "type": "image_url", "image_url": { "url": "https://example.com/city.jpg" } } ] }

// reference-to-video with image + video + audio references — one mixed input_references array, `type` says which
{ "model": "bytedance/seedance-2.0/fal", "prompt": "@Image1 dances like @Video1, to the music of @Audio1",
  "input_references": [
    { "type": "image_url", "image_url": { "url": "https://example.com/woman.jpg" } },
    { "type": "video_url", "video_url": { "url": "https://example.com/dance.mp4" } },
    { "type": "audio_url", "audio_url": { "url": "https://example.com/music.mp3" } } ] }

// video editing (input_video_url is exclusive with the other input fields)
{ "model": "runway/aleph-2", "prompt": "Make it night, add rain",
  "input_video_url": "https://example.com/clip.mp4" }

// finalize a Seedance 2.5 draft (must be the only field besides model)
{ "draft_id": "video_..." }

Headers

HeaderTypeDescription
Idempotency-KeystringOptional, up to 255 printable characters. Makes a retried submit safe: send the same key on every retry of the same request and you get the original job back instead of a second job and a second charge. Details below.

Idempotent retries

A create spends money, so a client that times out and retries on its own could otherwise pay for two jobs. Generate one key per logical request (a UUID works), reuse it for automatic retries of that request, and use a new key when you actually want another generation. We never guess from the request body: the same prompt twice, with different keys (or no key), is two jobs.

You sendYou get
No headerNormal behavior: every request is a new job.
A key we haven't seenA new job. If the create succeeds, its response is stored under the key.
Same key, same bodyThe original response, replayed with header Idempotent-Replayed: true. No new job, no new credit hold, and it doesn't count against your in-flight job limit. The replay shows the job as it was at creation (status is not refreshed); poll GET /v1/videos/{id} for the live state.
Same key while the first request is still runningWe wait up to ~25s for it to finish and replay it; if it's still going, 409 with error.code = "idempotency_key_in_progress" and Retry-After: 2 — retry the same request.
Same key, different body409, error.code = "idempotency_key_reused". Nothing is created. Key order and whitespace in the JSON don't count as a difference.
A key longer than 255 characters, or empty400, error.code = "invalid_idempotency_key".
  • Failed requests are not stored. If a create is rejected (4xx, 402, 429, 5xx), the key is released and you can retry it with the same key.
  • A job that was created and later fails is still the job for that key. It's replayed as-is, not re-run — to try again, send a new key. (It was refunded as usual.)
  • If your connection drops mid-request, the create still completes on our side; retrying with the same key returns that job.
  • Keys are scoped to your organization and expire after 24 hours; after that the same key is treated as a new request.
  • The same header works on POST /v1/images, /v1/lipsync, /v1/avatars/videos, /v1/face-swap and /v1/meshes, with the same rules; keys are separate per endpoint. A response larger than 8 MB (an image returned inline as base64) isn't stored, so a retry of that request runs again.
  • The Python and JavaScript SDKs take it as idempotency_key= / idempotencyKey on videos.create and videos.generate, and then retry the create safely on network errors and 502/503/504.

Motion control exception: atlascloud/kling-v3.0-motion-control-{std,pro} and atlascloud/kling-v2.6-motion-control-{std,pro} are the rows where start_image_url combines with a reference field: either a video_url entry in input_references (one clip up to 10s, the character keeps the photo's orientation) or input_video_url (a clip up to 30s; the character follows the clip's orientation unless character_orientation says otherwise). Neither requires prompt. See Motion control for both worked examples.

Example response (200, job just created)

{
  "id": "video_...",
  "status": "queued",
  "data": null,
  "error": null
}

Billed once, in full, at creation time from the requested/snapped duration_secs — polling is free. Poll GET /v1/videos/{id} until status is completed (example below). Extra fields (e.g. seconds, size, fallback_used) vary a little by which provider actually served the job.

GET/v1/videos/models

Unbilled. Live list of every valid model slug for POST /v1/videos — bare ids only, no price or capability breakdown (see /models for that).

Example response

{
  "object": "list",
  "data": [
    { "id": "machgen/minimax-h3", "object": "model" },
    { "id": "veo-3.1", "object": "model" },
    { "id": "grok-imagine-video", "object": "model" }
  ]
}

GET/v1/videos/{id}

Unbilled — polling is free. Once the job has finished, cost_usd is what it was charged (0 for a failed, refunded job). It can be absent for a few seconds after completion while the host's final price lands — the next poll has it. The same field is returned by GET /v1/lipsync/{id} and GET /v1/face-swap/{id}.

Parameters

ParameterTypeDescription
idstring (path)The id returned by POST /v1/videos.

Example response (status: "completed")

{
  "id": "video_...",
  "status": "completed",
  "data": [{ "url": "https://..." }],
  "error": null,
  "cost_usd": 0.42,
  "output_expires_at": 1760745600
}

status is one of queued → in_progress → completed/failed. On failure, error carries the provider's message and data is null.

DELETE/v1/videos/{id}

Permanently deletes a finished video’s stored output; the job then answers 404. Needs the video scope. The request-log entry (prompt, settings, cost) is kept for billing. Unbilled. Lifetimes and the other ways to expire an output: Data retention.

Parameters

ParameterTypeDescription
idstring (path)The id returned by POST /v1/videos.

Example response

{
  "id": "video_...",
  "object": "video.deleted",
  "deleted": true,
  "files_deleted": 1
}

Errors: 409 job_in_progress while the video is rendering or still being finalized, 403 delete_not_allowed_yet within 24 hours of generation (retry_after_s says how long), 404 for an unknown or already deleted id, 502 storage_error if nothing could be removed (safe to retry). A video whose store / output_ttl_secs lifetime ran out answers 410 output_expired on GET.