Skip to main content
Use POST /v1/videos to create an asynchronous Seedance video-generation task. Poll the task until it completes, then download the video from the returned Flatkey URL. Supported models are seedance-2.0, seedance-2.0-fast, seedance-2.0-mini, and seedance-2.5. Availability depends on your account; use GET /v1/models to retrieve the current model list.

Endpoint

Flatkey also accepts POST /v1/video/generations and GET /v1/video/generations/{task_id}. Use /v1/videos for the standard response structure and native usage data.

Request

Headers

Body parameters

string
required
Seedance model ID: "seedance-2.0", "seedance-2.0-fast", "seedance-2.0-mini", or "seedance-2.5".
array
required
Multimodal input items. Include at least one non-empty text item, image, video, or audio item. See content items.
string
Output resolution. Default: "720p".
string
Output aspect ratio: "16:9", "4:3", "1:1", "3:4", "9:16", "21:9", or "adaptive". Default: "adaptive". With "adaptive", the model picks the ratio from your input images or videos. For seedance-2.5, first-frame and first/last-frame tasks support only "adaptive".
integer
Video length in seconds. Default: 5. Seedance 2.0 models accept 4 through 15; seedance-2.5 accepts 4 through 30.
Always send a positive duration. Flatkey bills Seedance per second, so -1 (let the model choose the length) is rejected with video_price_not_configured. The only exception is a seedance-2.5 video edit, which requires -1.
boolean
Add an “AI generated” watermark to the lower-right corner. Default: false.
boolean
Generate a synchronized mono audio track. Default: true. Set it to false if you only need video; generated audio can occasionally fail copyright checks.
boolean
Return the last frame of the generated video as an image. Default: false. When true, the completed task includes metadata.last_frame_url, which downloads a JPEG with the same dimensions as the video and no watermark. Use it as the first_frame of the next task to chain clips. Like metadata.url, it needs no authorization header; treat it as private.
string
seedance-2.5 only. Container of the generated video: "mp4" or "mov". Default: "mp4". MOV keeps more color precision for grading and compositing (H.264, YUV 4:4:4, PCM audio), but some players cannot open it. The content endpoint returns video/quicktime for MOV results.
string
seedance-2.5 only, for reference-mode tasks. Tells the model which task you intend: "auto" (default), "reference", "edit", or "extend". Setting it explicitly moves the task-type checks to submission, so an invalid combination fails immediately instead of after the task starts. "reference", "edit", and "extend" all need reference items in content; a text-only request with "reference" is rejected. See video editing and extension.
integer
Queue priority from 0 through 9. Default: 0. Higher values move the task ahead of lower-priority tasks waiting on the same model. Supported on all Seedance 2.0 models and seedance-2.5. Values outside 0–9 are rejected with 400.
integer
Seconds the task may wait and run before it expires. Default: 172800 (48 hours). Use a shorter value when a late result is useless to you.
string
Public HTTPS URL that receives a POST whenever the task changes status. See Task callbacks. Must use https, contain no user credentials, be at most 2,048 characters, and resolve to a public address; otherwise the request is rejected with 400.

content items

Each URL can be a public HTTPS URL, a data:<mime>;base64, data URI (images and audio only), or an asset:// reference from the asset library. The whole request body must stay under 64 MB. Choose one input mode per task. These modes cannot be mixed:

Video editing

seedance-2.5 can edit or extend an existing video in reference mode. Describe the change in the prompt and refer to the video as @Video1.
Like every seedance-2.5 request with a reference video, an edit is billed at the resolution’s with-video rate for a fixed 30 seconds, regardless of the input or output length.

Draft mode

seedance-2.5 can render a cheap 480p draft first, so you can check the scene, shots, and motion before paying for the final video. It takes two requests:
  1. Create the draft. Send a normal request with "draft": true and "resolution": "480p". It is billed as a regular 480p video.
  2. Render the final video. After the draft completes, send a request whose only content item is a draft_task pointing at the draft’s task ID, with "resolution": "1080p".
The final video reuses the draft’s prompt, media, duration, ratio, seed, audio setting, and task type. Do not send duration, ratio, frames, seed, generate_audio, omni_reference_task_type, draft, or any other content item with a draft_task; the request is rejected with 400. You can still set return_last_frame, output_format, watermark, priority, execution_expires_after, and callback_url.
Seedance does not accept images or videos that show real human faces directly. Upload them as real-person assets and reference them with asset://.

Example requests

First- and last-frame input

Multimodal reference

Response

Response fields

string
Public task ID used to poll the task and download the completed video. task_id contains the same value.
string
Task status: queued, in_progress, completed, or failed.
integer
Generation progress from 0 through 100.
integer
Unix timestamp for task creation.

Poll task status

While generation is running, the response includes the current progress:
When the task completes, the response includes the video URL and token usage:
Failed tasks return the error details with the task response:
Any pre-consumed balance is refunded automatically.

Status values

Task callbacks

Set callback_url to receive status changes instead of, or in addition to, polling. Flatkey sends a POST with Content-Type: application/json when the task moves to in_progress, completed, or failed. The body is exactly what GET /v1/videos/{task_id} returns at that moment, including metadata.url and metadata.last_frame_url for completed tasks.
Respond with any 2xx status within 5 seconds. Otherwise Flatkey retries twice, after 2 and 8 seconds, and then gives up. Redirects are not followed. Callbacks are not signed, so verify a result by polling the task before acting on it, and keep polling as the source of truth in case a callback is lost.

Download the video

The content endpoint streams video/mp4 data, or video/quicktime when the task used output_format: "mov". It does not require a Bearer token and can be used directly as a <video> source.
The content endpoint works only after the task completes and is rate-limited by client IP. Treat the URL as sensitive because anyone with it can download the video.

Errors

Request-time errors use Flatkey’s standard error envelope:

End-to-end example

This example creates a task, polls it every five seconds, and downloads the completed video. It requires jq.