https://router.flatkey.ai
This guide gives you a copy-ready path for using Seedance through Flatkey. Start with a text-to-video task, poll the task until it completes, then download the generated MP4. If you need reusable product, background, audio, or real-person references, continue to the asset library sections.
Copy-ready examples
Use the copy icon on any command block, then replace
YOUR_FLATKEY_API_KEY, task_..., ast_..., and rph_... with your own values.One async workflow
Create the task with
POST /v1/videos, poll it with GET /v1/videos/{task_id}, and download the MP4 from metadata.url.metadata.url is the only exception.
Call Seedance
Start here if you only want to create a text-to-video task and download the finished video.1. Create a text-to-video task
SendPOST /v1/videos with the seedance-2.0 model and a text prompt.
task_... value. Store it in your database or notes because you need it to check the video.
2. Poll the task
Use this endpoint with the saved task ID:status is completed, then read the download URL from metadata.url. If the status is failed, read error.message, fix the request, and create a new task.
metadata.url downloads the MP4 file without an authorization header. Treat this URL as private and do not publish it.
Use the asset library
Use the asset library when you want to register a reference once, wait until it is ready, and reuse it in Seedance requests. There are two asset types:
Use the
asset://ast_... URI returned by Flatkey in your Seedance requests.
Virtual assets
Virtual assets do not require real-person verification. Create them from a public URL or upload a local file, then reuse the returned Flatkey asset URI.1. Create a virtual asset from a public HTTPS URL
Send a publichttps:// URL.
id, for example ast_1234567890abcdef1234567890abcdef, and a status such as Processing. Build the reusable URI by adding asset:// before the ID:
model when you create, upload, or query an asset. Flatkey derives the relevant Seedance models from the API key used for the request.
2. Upload a local virtual asset
For a local image, video, or audio file, sendmultipart/form-data to POST /v1/assets/upload. Use one file field. asset_type can be Image, Video, or Audio.
id or asset_url for polling and later video requests.
3. Poll until the selected model is available
Query every asset with the same API key that will create the video task. For example, check two image assets separately:available_models. available_models is always an array and lists the models that can use this asset now. A partially ready asset can look like this:
status is the aggregate state across the relevant Seedance models for this API key:
You do not need to wait for aggregate
Active when your chosen model is already listed. Before creating a task, make sure the selected model appears in every asset’s available_models. For fast use seedance-2.0-fast; for pro use seedance-2.0. The task creation request checks readiness again, so retry polling if routing changed between the GET and POST requests.
The asset:// URI identifies the asset but does not prove readiness by itself. Deleting means deletion is in progress and the asset cannot be used for a new task. After deletion completes, GET /v1/assets/{asset_id} returns 404 asset_not_found; do not wait for a pollable Deleted status.
4. Call Seedance with two virtual assets
Put eachasset://ast_... URI in the media field that matches the asset type: image_url.url for Image, video_url.url for Video, or audio_url.url for Audio. A Seedance request needs text or at least one image/video; audio alone is not enough. This example starts only after both assets list seedance-2.0-fast in available_models.
task_... and use GET /v1/videos/{task_id} from the first section to download the finished video from metadata.url.
Real-person assets
Real-person assets are for a specific person’s face, voice, or video. This capability is limited access. Use it only after Flatkey enables it for your account. You will create a profile, sendverification_url to the person, wait until the profile is active, create an asset, wait until the asset status is Active, then call Seedance with asset://ast_....
File size limits:
Write requests in this section require
Idempotency-Key. Replace each YOUR_UNIQUE_KEY_... placeholder with a new UUID for every new write request. Reuse a key only when retrying the exact same request.
1. Create a real-person profile
id, a status, and a one-time verification_url. Send verification_url to the real person and ask them to open it themselves. Do not publish this link.
If the link expires or the person needs another link, create a new verification session:
2. Poll until the profile is active
active before creating assets. If it is pending_verification or verifying, wait and poll again. If it is failed or expired, create a new verification session.
3. Create a real-person asset from a public URL
4. Upload a local file
Local upload usesmultipart/form-data and is available only for real-person assets. Use one file field and let curl set the multipart boundary.
asset_uri, for example asset://ast_1234567890abcdef1234567890abcdef.
5. Poll readiness and call Seedance
Real-person asset responses do not includeavailable_models. List the assets under the profile until the asset status is Active:
Processing, wait and poll again. If it is Failed, create a new asset from a better reference.
After the asset is Active, call Seedance with the asset://ast_... URI.
task_... and use GET /v1/videos/{task_id} from the first section to download the finished video from metadata.url.
6. Delete an asset when you no longer need it
204 No Content. After deletion completes, GET /v1/assets/{asset_id} returns 404 asset_not_found.