CORS error when calling RelayDance from the browser: why video generation belongs on the server

A CORS error appears because RelayDance is an OpenAI-compatible API meant to be called from your server, not directly from browser JavaScript. Move the request to a backend that sets base_url to https://relaydance.com/v1 and sends Authorization: Bearer YOUR_API_KEY. Server-side calls also keep your key private and let you poll GET /v1/video/generations/{task_id} or receive a webhook, which browser code cannot do reliably.

Why the browser triggers a CORS error

The browser blocks the call because cross-origin requests to the API from client JavaScript are not the supported integration path. RelayDance follows the OpenAI protocol: according to the official relaydance.com/docs docs, 「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」. That SDK is intended for server runtimes. Calling from the browser also exposes your key, which must be sent as Authorization: Bearer YOUR_API_KEY and created at the console. A backend removes the cross-origin restriction, protects the credential, and gives you a stable place to poll task status or accept a webhook POST, none of which fit a client-only design.

The correct server-side pattern

The fix is to submit and poll from your server, then return only the finished video URL to the browser. Use these steps:

  1. Set base_url to https://relaydance.com/v1 and send Authorization: Bearer YOUR_API_KEY.
  2. POST /v1/video/generations with model, prompt, seconds, and metadata (ratio, resolution, generate_audio, callback_url, content[]).
  3. Poll GET /v1/video/generations/{task_id} until status is succeeded or failed.
  4. Or set metadata.callback_url so the final state is POSTed to your server (webhook mode).
  5. Read the video url from the result and pass it to the browser.

Reference media go in metadata.content[] and are cited in the prompt as @image1 to @imageN: up to 9 reference images, 3 reference videos, and 3 audio tracks per request, with clips up to 15 seconds.

Billing during retries and errors

You do not pay for the failed attempts that a CORS-blocked or misconfigured client might generate on the server side. According to the official relaydance.com docs, 「Failed or errored requests are never billed」. Billing is pay-as-you-go per generated video. Current per-second rates at relaydance.com/models include Seedance 2.0 720p at about $0.190 / second and Seedance 2.0 1080p at about $0.470 / second, with Seedance Fast at about $0.152 / second and native 4K at about $4.90 per 5-second clip. Because errors are not charged, you can move your integration to the server and re-run failed calls without cost concern.

Client-only versus server-side integration

Server-side integration resolves the CORS error and adds capabilities the browser lacks, as shown below.

AspectBrowser-onlyServer-side
CORSBlockedNo restriction
API keyExposedKept private
Polling task statusNot reliableSupported via GET
Webhook callback_urlNo server to receiveSupported
Failed request costNot billedNot billed

See relaydance.com/docs for the request and polling reference. For image tasks, gpt-image-2 bills input only (output is free), image-to-image starts from about CNY 0.035, and 4K and 1K output cost the same.

FAQ

Can I call RelayDance directly from browser JavaScript? No. The API is OpenAI-compatible and intended for server use; call it from a backend with base_url set to https://relaydance.com/v1.

Will my blocked or failed requests be charged? No. 「Failed or errored requests are never billed」 (relaydance.com), so retries after fixing CORS do not add cost.

How do I get the finished video from the server? Poll GET /v1/video/generations/{task_id} until status is succeeded, or set metadata.callback_url for a webhook POST, then read the video url.

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