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:

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.

  1. Send POST /v1/video/generations with model, prompt, and seconds, plus optional metadata (ratio, resolution, generate_audio, callback_url, content[]).
  2. Read the returned task_id.
  3. Poll GET /v1/video/generations/{task_id} until status is succeeded or failed.
  4. On success, read the video url from the result.
  5. Optionally set metadata.callback_url for 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.

OptionPrice
Seedance 2.0 720pabout $0.190 / second
Seedance 2.0 1080pabout $0.470 / second
Seedance Fastabout $0.152 / second
Seedance native 4Kabout $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

ItemValueSource
Seedance 2.0 720p priceabout $0.190 / secondrelaydance.com/models
Seedance 2.0 1080p priceabout $0.470 / secondrelaydance.com/models
Seedance Fast priceabout $0.152 / secondrelaydance.com/models
Seedance native 4K priceabout $4.90 per 5-second cliprelaydance.com/models
gpt-image-2 image billingimage output is free, only input is billed; image-to-image from about CNY 0.035; 4K and 1K output cost the samerelaydance.com/models
API protocolOpenAI-compatible; set base_url to https://relaydance.com/v1relaydance.com/docs
Failed requestsfailed or errored requests are never billedrelaydance.com/docs

Data verified 2026-06-29; live prices are on the official /models page.


RelayDance home · Models and pricing · Docs · All guides · Privacy Policy · User Agreement · Telegram community · RelayRouter (LLM API) · Live playground