401 Unauthorized
401 Unauthorized · AuthenticationError. The API couldn't identify you. Either no key
was sent, or the key wasn't recognised.
Missing API key
Missing X-API-Key header, or the SDK raises AuthenticationError before sending
anything.
- REST APIs: send the key in a header named exactly
X-API-Key. - SDKs: set
CUSTODIAN_SDK_API_KEY, or passapi_key/apiKey. Restart the process after changing it. - MCP server: send
Authorization: Bearer <key>. See MCP authentication.
No key at all? The API Keys page shows No API Keys Yet until you activate a plan. Signing in alone doesn't create a key.
| Situation | Fix |
|---|---|
| No active plan | Activate a plan, then refresh API Keys |
| Paid checkout done, no key yet | Refresh API Keys, wait a few seconds, refresh again |
| Still nothing | Check you're signed in with the checkout email, then contact support |
Invalid API key
Invalid API key. A key was sent, but it isn't recognised.
- Copy it again from API Keys, with no stray spaces or line breaks.
- Check the variable:
CUSTODIAN_SDK_API_KEYfor the SDKs,CUSTODIAN_API_KEYfor the curl examples. - Restart your process after changing an environment variable or secret.
See also
Platform API authentication · Guardian Layer API authentication