Client timeout while waiting for video generation: setting sensible timeouts for Seedance tasks
To avoid client timeouts with Seedance video generation on RelayDance, do not hold a single HTTP connection open until the video is ready: submit the task with POST /v1/video/generations, then either poll GET /v1/video/generations/{task_id} until the status is succeeded or failed, or set metadata.callback_url for webhook delivery. Because clips can run up to 15 seconds, asynchronous handling prevents connection drops during processing.
Use polling or webhooks instead of one long request
The correct pattern is asynchronous: submit, then check state separately rather than blocking on the initial call. Submit a task with POST /v1/video/generations using model, prompt, and seconds, then poll GET /v1/video/generations/{task_id} until the status is succeeded or failed; the result carries the video URL. For servers that can receive callbacks, set metadata.callback_url and the final state is POSTed to your endpoint. Requests can include up to 9 reference images, 3 reference videos, and 3 audio tracks, and clips can run up to 15 seconds, so allowing time for processing is required. See relaydance.com/docs for the full flow.
Keep your OpenAI SDK and set a generous read timeout
You can reuse your existing OpenAI client and adjust its timeout settings for the RelayDance base URL. 据 relaydance.com 官方文档: 「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」. Authenticate with Authorization: Bearer YOUR_API_KEY (create keys at the console). When you rely on polling, set a short timeout on the submit call and the poll calls individually, then loop between polls rather than raising one long client timeout. This keeps each HTTP request quick and moves the waiting into your own retry loop, which is more predictable across proxies and load balancers.
A timeout does not mean you were billed
If a client timeout occurs, billing is not triggered by the failed connection itself. 据 relaydance.com 官方文档: 「Failed or errored requests are never billed」. Billing is pay-as-you-go per generated video, so a dropped connection while waiting does not create a charge on its own. For reference, Seedance 2.0 720p is about $0.190 per second and 1080p is about $0.470 per second, with native 4K at about $4.90 per 5-second clip and Seedance Fast at about $0.152 per second. Live rates are published at relaydance.com/models.
Steps to handle long-running tasks
Follow this sequence to prevent client timeouts during Seedance generation:
- Submit the task:
POST /v1/video/generationswithmodel,prompt, andseconds. - Store the returned
task_idand close the initial connection. - Poll
GET /v1/video/generations/{task_id}at intervals until status issucceededorfailed. - Or set
metadata.callback_urlso the final state is POSTed to your server, removing the need to poll. - On
succeeded, read the video URL from the result.
Per-second rates for planning retries
The table below lists published Seedance rates, useful when estimating cost before a retry.
| Model / tier | Price | Source |
|---|---|---|
| Seedance 2.0 720p | about $0.190 / second | relaydance.com/models |
| Seedance 2.0 1080p | about $0.470 / second | relaydance.com/models |
| Seedance Fast | about $0.152 / second | relaydance.com/models |
| Seedance native 4K | about $4.90 per 5-second clip | relaydance.com/models |
FAQ
Does a client timeout charge me for the video? No. 「Failed or errored requests are never billed」, and billing is pay-as-you-go per generated video.
How do I check status after a timeout? Use the stored task_id with GET /v1/video/generations/{task_id}, or receive the final state via metadata.callback_url.
Can I keep my current SDK? Yes. 「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」, then authenticate with Authorization: Bearer YOUR_API_KEY.
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.