How do I fix 401 invalid_api_key?
401 invalid_api_key means the key isn't recognised: "This API key is invalid or was revoked."
- Whole key? It starts with
clsk_. Copying can cut the end or add a space. - Right format?
Authorization: Bearer clsk_..., with the word Bearer and one space. - Still active? In API keys switch to All; a Revoked or Expired key never works again.
- Loaded from the environment? Print the first few characters of
CLATTER_API_KEYin your app to check it isn't empty.
If it was revoked or lost, create a new key and update your app.
Good to know#
- Branch your code on the error
code, not the message. - On
429, wait theRetry-Afterseconds before retrying.
Learn more#
Still need help?#
- General support: support@clatterlabs.com or team@clatterlabs.xyz
- Infrastructure questions, or permanent deletion of your data (your whole account or one service): infrastructure@clatterlabs.xyz
We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.