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.
- Create or view your key at the console (https://relaydance.com/console).
- Set the header on every request:
Authorization: Bearer YOUR_API_KEY. - Set
base_urltohttps://relaydance.com/v1so the SDK reaches RelayDance. - Remove leading or trailing spaces and confirm the full key was copied.
- Rotate the key if it may be exposed, then update your environment variable.
- 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.
| Setting | Correct value | Common 401 mistake |
|---|---|---|
| Auth header | Authorization: Bearer YOUR_API_KEY | Missing header or wrong scheme |
| base_url | https://relaydance.com/v1 | Left on default OpenAI host |
| Key source | Console (https://relaydance.com/console) | Placeholder or expired key |
| Video endpoint | POST /v1/video/generations | Wrong 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
| 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.