OpenAI SDK not reaching RelayDance: base_url and path configuration mistakes
When the OpenAI SDK cannot reach RelayDance, the cause is usually the base_url or the request path. Set base_url to exactly https://relaydance.com/v1, do not repeat /v1 in endpoint paths, and do not paste a full endpoint such as /v1/video/generations into base_url. Send your key as Authorization: Bearer YOUR_API_KEY. Video tasks use POST /v1/video/generations, and images use POST /v1/images/generations.
What is the correct base_url for RelayDance?
The correct base_url is https://relaydance.com/v1, and the SDK appends each endpoint path to it. RelayDance uses an OpenAI-compatible protocol. According to the relaydance.com docs, “Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK”. The SDK joins base_url with resource paths, so an image call resolves to https://relaydance.com/v1/images/generations. Create your API key at https://relaydance.com/console and pass it to the client, which sends it as a Bearer token.
from openai import OpenAI
client = OpenAI(base_url="https://relaydance.com/v1", api_key="YOUR_API_KEY")
If you set the base_url through an environment variable or a config file, print the final value at startup. Hidden whitespace, a missing scheme, or an older value can override the code you expect to run.
Which base_url and path mistakes break requests?
Most connection failures come from a missing, doubled, or misplaced /v1 segment, or from a malformed auth header. The table below lists each mistake, the URL it produces, and the fix.
| Mistake | Resulting URL or header | Fix |
|---|---|---|
| base_url without /v1 | https://relaydance.com/images/generations | Use https://relaydance.com/v1 |
| /v1 in both base_url and path | https://relaydance.com/v1/v1/video/generations | Keep /v1 in one place |
| Full endpoint used as base_url | .../v1/images/generations/images/generations | Set base_url to the /v1 root |
| Bearer prefix missing | Authorization: YOUR_API_KEY | Send Authorization: Bearer YOUR_API_KEY |
How do video requests differ from SDK image calls?
Video generation is an asynchronous task: you submit with POST /v1/video/generations and poll GET /v1/video/generations/{task_id} until status is succeeded or failed. If your code builds URLs from base_url, append /video/generations, not /v1/video/generations. The request body takes model, prompt, seconds, and metadata (ratio, resolution, generate_audio, callback_url, content[]). With metadata.callback_url set, the final state is POSTed to your server. Reference media go in metadata.content[] and are cited in the prompt as @image1 to @imageN. Each request accepts up to 9 reference images, 3 reference videos, and 3 audio tracks, and clips run up to 15 seconds. According to the relaydance.com docs, “Failed or errored requests are never billed”, so retries that return errors while you correct paths do not add charges.
What does a working request cost once connected?
Billing is pay-as-you-go per generated video, with per-second rates listed on relaydance.com/models. Seedance 2.0 costs about $0.190 per second at 720p and about $0.470 per second at 1080p. Seedance Fast costs about $0.152 per second. Seedance 2.5 at 1080p (model doubao-seedance-2-5-1080p, added 2026-10-10) costs about $0.711 per second. Seedance native 4K costs about $4.90 per 5-second clip. For gpt-image-2, image output is free and input is billed, image-to-image starts from about CNY 0.035, and 4K and 1K output cost the same. Payments are accepted in USDT and by Stripe card, and no BytePlus enterprise account or KYC is required.
FAQ
Should base_url end with a trailing slash?
Use https://relaydance.com/v1 as written in the docs, and keep endpoint paths free of a second /v1 so the joined URL stays correct.
How do I get the finished video?
Poll GET /v1/video/generations/{task_id} until status is succeeded or failed; a succeeded result contains the video url. Alternatively, set metadata.callback_url to receive the final state by POST.
Am I charged for 404 or auth errors during setup?
No. The docs state that failed or errored requests are never billed, so charges apply to generated videos under pay-as-you-go billing.
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 2.5 1080p price | about $0.711 / second, added 2026-10-10, model doubao-seedance-2-5-1080p | 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.