Clatter LabsHelp Center

How do I fix 401 invalid_api_key?

TroubleshootingUpdated

401 invalid_api_key means the key isn't recognised: "This API key is invalid or was revoked."

  1. Whole key? It starts with clsk_. Copying can cut the end or add a space.
  2. Right format? Authorization: Bearer clsk_..., with the word Bearer and one space.
  3. Still active? In API keys switch to All; a Revoked or Expired key never works again.
  4. Loaded from the environment? Print the first few characters of CLATTER_API_KEY in 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 the Retry-After seconds before retrying.

Learn more#

Still need help?#

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.xyz
For deleting your whole account or the data of one service.