// troubleshooting guide · d-id

D-ID API 401 Unauthorized Error

Status
Workaround available
platforms:
API
updated:
November 15, 2026
reports:
4
Method
how we research
Share

RUNBOOK · d-id/api-401-unauthorized3 FIXES

// quick answer

A 401 from the D-ID API almost always means the Authorization header is malformed: D-ID uses Basic auth with the key from Account Settings in the form API_USERNAME:API_PASSWORD. Send it exactly as "Basic <key>" and regenerate the key if you lost the original.

Most likely fix: Use the exact header format

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Use the exact header format

    1. 01Copy the key from studio.d-id.com > Account Settings (format API_USERNAME:API_PASSWORD)
    2. 02Send Authorization: Basic <your key>
    3. 03Don't prefix with Bearer and don't add your email
    Did this fix it?
  2. FIX 2Regenerate the key

    1. 01Generate a new API key in Account Settings
    2. 02Store it right away; it's only shown once
    3. 03Update every environment that used the old key
    Did this fix it?
  3. FIX 3Test with a simple call

    1. 01Call GET https://api.d-id.com/credits with the header
    2. 02If it returns 200, the key works and the problem is in the specific endpoint call
    3. 03Check for hidden whitespace or quotes in your env variable
    Did this fix it?

Symptoms

Calls to /talks, /talks/streams, /agents or /credits return 401 Unauthorized even though the account and plan are active.

Why it happens

  • C-01Using Bearer instead of Basic
  • C-02Key re-encoded or missing the colon between username and password
  • C-03Email plus key used instead of the generated key
  • C-04Old key after regenerating a new one (keys are shown only once)
  • C-05Extra spaces or quotes in the environment variable

// this guide also covers

  • d-id api 401
  • d-id api unauthorized
  • d-id api key not working
  • d-id basic authentication

Still not working?

If D-ID keeps failing, you're not alone. See every D-ID problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us

Watch D-ID Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other D-ID errors

All 12 D-ID errors and fixes →