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

A 401 Unauthorized error from the Seedance API on RelayDance means the request lacks a valid credential in the Authorization header. To fix it, send Authorization: Bearer YOUR_API_KEY using a key created at the RelayDance console (https://relaydance.com/console), and confirm your base_url is set to https://relaydance.com/v1. Because RelayDance is OpenAI-compatible, a missing, malformed, or revoked key is the most common cause of a 401 response.

What causes a 401 Unauthorized on the Seedance API

A 401 is caused by an authentication problem, not by your prompt or model choice. The RelayDance API uses OpenAI-compatible auth, so every request to /v1/video/generations or /v1/images/generations must include the header Authorization: Bearer YOUR_API_KEY. Typical triggers include a missing header, an extra space or typo in the token, a revoked key, or a key pasted with the word "Bearer" duplicated. Because "set base_url to https://relaydance.com/v1 and keep your OpenAI SDK"(According to the official relaydance.com/docs), pointing the SDK at the wrong host can also produce authentication failures. Confirm both the key and the base_url before changing anything else.

Steps to fix an invalid API key error

You resolve a 401 by regenerating the key and rechecking the header and base_url in order.

  1. Open the console at https://relaydance.com/console and create a new API key.
  2. Set the SDK base_url to https://relaydance.com/v1.
  3. Send the header exactly as Authorization: Bearer YOUR_API_KEY with no duplicated "Bearer" prefix.
  4. Remove any leading or trailing whitespace from the token.
  5. Retry a small request, for example a Seedance Fast video at about $0.152 per second.

See https://relaydance.com/docs for the full request format. Note that failed calls during testing carry no charge, since "failed or errored requests are never billed"(According to the official relaydance.com docs), so retrying while you debug is safe.

How authentication affects billing during retries

A 401 does not cost you money, because RelayDance billing applies only to successfully generated media. Pricing is pay-as-you-go per generated video: Seedance 2.0 at 720p is about $0.190 per second, Seedance 2.0 at 1080p is about $0.470 per second, and Seedance native 4K is about $4.90 per 5 second clip. When a request errors with a 401, no video is produced, so no charge is applied. This lets you iterate on header and base_url fixes without accumulating cost. Live per-model rates are published at https://relaydance.com/models.

Comparison: 401 causes and fixes

The table below maps each common 401 cause to its fix.

CauseFix
Missing Authorization headerAdd Authorization: Bearer YOUR_API_KEY
Revoked or deleted keyCreate a new key at https://relaydance.com/console
Wrong base_urlSet base_url to https://relaydance.com/v1
Duplicated "Bearer" prefixUse a single "Bearer" token in the header
Whitespace in tokenTrim leading and trailing spaces

FAQ

Do failed 401 requests get billed? No. "failed or errored requests are never billed"(According to the official relaydance.com docs), so a 401 produces no charge.

Which base_url should the OpenAI SDK use? Set it to https://relaydance.com/v1, as documented at https://relaydance.com/docs.

Where do I create or rotate an API key? Create keys at https://relaydance.com/console, then send them as Authorization: Bearer YOUR_API_KEY.

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 · Telegram community · RelayRouter (LLM API) · Live playground · Privacy Policy · User Agreement