Clatter LabsHelp Center

What does 401 missing_account_id mean?

TroubleshootingUpdated

You sent a key but no X-Clatter-Account header. The Model API needs both.

Code: missing_account_id · HTTP status: 401

The second header names the account that owns the key, like CL-7K2M9QXA. It's what makes a leaked key useless on its own.

Common causes#

  • the OpenAI SDK was set up with only base_url and api_key
  • a proxy or gateway in front of your app strips custom headers
  • the environment variable holding the Account ID is empty

How to fix it#

  1. Find your Account ID in Console › Settings.
  2. Python: OpenAI(..., default_headers={"X-Clatter-Account": "CL-..."}).
  3. JavaScript: new OpenAI({ ..., defaultHeaders: { "X-Clatter-Account": "CL-..." } }).
  4. If a proxy sits in between, allow the header through.

Should my code retry?#

Not retryable until the header is added.

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

{"error": {"message": "...", "type": "...", "code": "missing_account_id", "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.