Generate Seedance videos with the openai Python package: base_url setup and task polling
To generate Seedance videos with the openai Python package, point the OpenAI SDK to RelayDance by setting base_url to https://relaydance.com/v1 and passing your API key as a Bearer token. Submit a task via POST /v1/video/generations with model, prompt, and seconds, then poll GET /v1/video/generations/{task_id} until the status is succeeded or failed. The API is OpenAI-compatible, so no BytePlus enterprise account or KYC is required.
How do I configure base_url for the OpenAI SDK?
Set the client base URL to https://relaydance.com/v1 and keep your existing OpenAI SDK unchanged. According to the official relaydance.com/docs docs, "Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK". Authentication uses a standard header, Authorization: Bearer YOUR_API_KEY, and you create keys in the console at https://relaydance.com/console. Because the protocol is OpenAI-compatible, you reuse the same request patterns you already know. This removes the need for a BytePlus enterprise account, and payments are supported through USDT and Stripe card. Configuration example in Python:
from openai import OpenAIclient = OpenAI(base_url="https://relaydance.com/v1", api_key="YOUR_API_KEY")
What are the steps to submit and poll a video task?
Submit a task, then poll its ID until the state resolves. The workflow uses two endpoints and supports reference media 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.
- Send
POST /v1/video/generationswithmodel,prompt, andseconds, plus optionalmetadata(ratio, resolution, generate_audio, callback_url, content[]). - Read the returned
task_id. - Poll
GET /v1/video/generations/{task_id}untilstatusissucceededorfailed. - On success, read the video
urlfrom the result. - Optionally set
metadata.callback_urlfor webhook mode, where the final state is POSTed to your server.
How much does Seedance cost per generation?
Seedance is billed pay-as-you-go per generated video, with rates that vary by resolution and model. The table below lists current per-model values; live rates are published at relaydance.com/models.
| Option | Price |
|---|---|
| Seedance 2.0 720p | about $0.190 / second |
| Seedance 2.0 1080p | about $0.470 / second |
| Seedance Fast | about $0.152 / second |
| Seedance native 4K | about $4.90 per 5-second clip |
Regarding error handling, according to the official relaydance.com docs, "Failed or errored requests are never billed", so retries during polling do not add charges for failed states.
Can I generate images through the same client?
Yes, images use POST /v1/images/generations on the same OpenAI-compatible client and base URL. For gpt-image-2 billing, 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. This means resolution choice does not change output pricing for that model. You continue to authenticate with Authorization: Bearer YOUR_API_KEY and target https://relaydance.com/v1. Because both video and image endpoints share the OpenAI-compatible protocol, a single configured client handles both request types without additional setup. Current per-model rates remain available at relaydance.com/models.
FAQ
Do I need a BytePlus enterprise account? No. RelayDance provides direct OpenAI-compatible access to Seedance with no BytePlus enterprise account or KYC required.
Am I charged when a request fails? No. According to the official relaydance.com docs, failed or errored requests are never billed.
How many reference media can I attach per request? Up to 9 reference images, 3 reference videos, and 3 audio tracks, with clips up to 15 seconds, cited in the prompt as @image1 to @imageN.
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.