Seedance API returns 401 Unauthorized: how to fix invalid API key errors on RelayDance

A 401 Unauthorized error on the RelayDance Seedance API means your request lacks a valid API key or the key is malformed. Fix it by sending the header Authorization: Bearer YOUR_API_KEY, creating or rotating a key at the console (https://relaydance.com/console), and confirming your base_url is https://relaydance.com/v1. Because RelayDance is OpenAI-compatible, most 401 cases come from a missing header, a wrong key, or a mismatched endpoint.

What causes a 401 Unauthorized on RelayDance

A 401 is returned when authentication fails, not when the model or prompt is wrong.

The RelayDance API authenticates each request with an HTTP header in the form Authorization: Bearer YOUR_API_KEY. Common causes include an empty or truncated key, a key copied with extra whitespace, an environment variable that did not load, or requests pointed at the wrong host. Because the platform is OpenAI-compatible, 「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」, according to the official relaydance.com/docs documentation. If your SDK still targets a default OpenAI host, it will not present your RelayDance key and the call will fail with 401.

Step-by-step fix for invalid API key errors

Follow these ordered steps to resolve a 401 and restore access to Seedance.

  1. Create or view your key at the console (https://relaydance.com/console).
  2. Set the header on every request: Authorization: Bearer YOUR_API_KEY.
  3. Set base_url to https://relaydance.com/v1 so the SDK reaches RelayDance.
  4. Remove leading or trailing spaces and confirm the full key was copied.
  5. Rotate the key if it may be exposed, then update your environment variable.
  6. Retry a small call, for example POST /v1/video/generations, and confirm the response is no longer 401.

See https://relaydance.com/docs for the full request format and https://relaydance.com/models for current per-model rates.

Will retrying after a 401 cost money

No, retrying after a 401 does not add charges, because unsuccessful calls are not billed.

Billing on RelayDance is pay-as-you-go per generated video. 「Failed or errored requests are never billed」, according to the official relaydance.com documentation, so authentication failures and retries during debugging do not incur cost. Charges apply only to successful generations. For reference, Seedance 2.0 720p is about $0.190 per second and 1080p is about $0.470 per second (source relaydance.com/models). Seedance Fast is about $0.152 per second, and native 4K is about $4.90 per 5-second clip. These rates apply once a request succeeds, not when it returns 401.

Verify your setup against a known-good configuration

Compare your client settings to this reference table to confirm nothing is missing.

SettingCorrect valueCommon 401 mistake
Auth headerAuthorization: Bearer YOUR_API_KEYMissing header or wrong scheme
base_urlhttps://relaydance.com/v1Left on default OpenAI host
Key sourceConsole (https://relaydance.com/console)Placeholder or expired key
Video endpointPOST /v1/video/generationsWrong path

RelayDance provides direct OpenAI-compatible access to Seedance with no BytePlus enterprise account or KYC required, so key creation and header setup are the main authentication steps.

FAQ

Do I need a special SDK to authenticate? No. Keep your OpenAI SDK, set base_url to https://relaydance.com/v1, and pass your RelayDance key in the Authorization header.

Where do I create or rotate keys? At the console (https://relaydance.com/console). Payments are accepted via USDT and Stripe card.

Will a 401 during testing cost me anything? No. Failed or errored requests are never billed, so only successful generations are charged, for example about $0.470 per second at Seedance 2.0 1080p (source relaydance.com/models).

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