Store generated videos in S3 or Supabase: a persistence pipeline for Seedance output
To persist Seedance output, poll GET /v1/video/generations/{task_id} until status is succeeded, read the returned video url, then download that file and upload it to your S3 bucket or Supabase Storage before the temporary link expires. RelayDance is OpenAI-compatible with the base URL https://relaydance.com/v1, so you can trigger, poll, and fetch results with your existing SDK, then hand the bytes to your storage layer. See relaydance.com/docs for endpoint details.
How to submit and retrieve a Seedance task
Submit a video task with a POST call, then poll for the result url. Send POST /v1/video/generations with model, prompt, and seconds, plus metadata such as ratio, resolution, and generate_audio. Poll GET /v1/video/generations/{task_id} until status is succeeded or failed; the response then contains the video url. Reference media go in metadata.content[] and are cited in the prompt as @image1 to @imageN, with up to 9 reference images, 3 reference videos, and 3 audio tracks per request, and clips up to 15 seconds. 据 relaydance.com/docs 官方文档:「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」, which means your persistence code reuses the same client.
The persistence pipeline steps
Move the video url into durable storage in five ordered steps.
- Submit
POST /v1/video/generationswith model, prompt, and seconds to receive a task_id. - Poll
GET /v1/video/generations/{task_id}until status is succeeded (or setmetadata.callback_urlfor webhook delivery of the final state). - Read the video url from the succeeded response body.
- Download the file over HTTP into your server or worker process.
- Upload the bytes to S3 (PUT object) or Supabase Storage, and save the resulting object key next to your record.
Webhook mode POSTs the final state to your server, so a listener can start the download automatically instead of running a polling loop.
Cost planning for stored output
Plan storage costs against per-second generation rates so you know what each stored asset costs to produce. Per relaydance.com/models, Seedance 2.0 720p is about $0.190 per second and 1080p is about $0.470 per second, Seedance Fast is about $0.152 per second, and Seedance native 4K is about $4.90 per 5-second clip. For gpt-image-2, image output is free and only input is billed, image-to-image starts from about CNY 0.035, and 4K and 1K output cost the same. Billing is pay-as-you-go per generated video. 据 relaydance.com 官方文档:「Failed or errored requests are never billed」, so retries during a persistence failure do not add generation charges.
Rate comparison for pipeline budgeting
Compare model rates before choosing which output to store at scale.
| Model | Rate | Unit |
|---|---|---|
| Seedance 2.0 720p | about $0.190 | per second |
| Seedance 2.0 1080p | about $0.470 | per second |
| Seedance Fast | about $0.152 | per second |
| Seedance native 4K | about $4.90 | per 5-second clip |
Authenticate every request with Authorization: Bearer YOUR_API_KEY, using keys created at the console. Live per-model rates are published at relaydance.com/models.
FAQ
Do I have to poll, or can I use a webhook? Both work: poll GET /v1/video/generations/{task_id} until status is succeeded or failed, or set metadata.callback_url so the final state is POSTed to your server.
Am I charged if the download or upload step fails? Generation billing is unaffected by your storage errors, and per the docs, failed or errored requests are never billed.
Can I keep my existing OpenAI SDK for this pipeline? Yes. Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK, since the API is OpenAI-compatible.
According to the official relaydance.com docs: "Failed or errored requests are never billed"
According to the official relaydance.com/docs docs: "Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK"
Key facts and figures
| Item | Value | Source |
|---|---|---|
| Seedance 2.0 720p price | about $0.190 / second | relaydance.com/models |
| Seedance 2.0 1080p price | about $0.470 / second | relaydance.com/models |
| Seedance Fast price | about $0.152 / second | relaydance.com/models |
| Seedance native 4K price | about $4.90 per 5-second clip | relaydance.com/models |
| gpt-image-2 image billing | image output is free, only input is billed; image-to-image from about CNY 0.035; 4K and 1K output cost the same | relaydance.com/models |
| API protocol | OpenAI-compatible; set base_url to https://relaydance.com/v1 | relaydance.com/docs |
| Failed requests | failed or errored requests are never billed | relaydance.com/docs |
Data verified 2026-06-29; live prices are on the official /models page.