Clatter LabsHelp Center

What does 401 expired_api_key mean?

TroubleshootingUpdated

The key you sent has expired, so it no longer works.

Code: expired_api_key · HTTP status: 401

An expired key is refused even if the rest of the request is perfect.

Common causes#

  • a key created with an expiry (30 days, 90 days by default, or 1 year) that has passed its date

How to fix it#

  1. Create a new key in Console › API keys with the Model API preset.
  2. Update the key everywhere it's stored (environment variables, secret manager, CI).
  3. Pick an expiry that fits (30 days, 90 days, 1 year or Never) and plan the next rotation before that date.

Should my code retry?#

Not retryable with the same key.

The error body uses the OpenAI shape, so OpenAI SDKs raise it as an exception you can catch:

{"error": {"message": "...", "type": "...", "code": "expired_api_key", "param": null}}

Every response also carries an X-Request-Id. Keep it in your logs; it's the quickest way for support to find a request.

See the full list in the Model API reference.

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.