How do I check that my key and Account ID work?
Make the smallest possible call and read the status.
curl -s -o /dev/null -w '%{http_code}\n' https://api.gateway.clatterlabs.xyz/v1/chat/completions \
-H "Authorization: Bearer $CLATTER_API_KEY" \
-H "X-Clatter-Account: $CLATTER_ACCOUNT_ID" \
-H "Content-Type: application/json" \
-d '{"model": "supercosmos-flash", "max_tokens": 5, "messages": [{"role": "user", "content": "ok"}]}'
200 = working. 401 = run without -o /dev/null to see if it's invalid_api_key, missing_account_id or account_mismatch. 403 insufficient_scope = the key lacks models:invoke. 402 = no credits. Note GET /v1/models isn't a good key test because it doesn't need a key.
Set CLATTER_API_KEY (a clsk_ key with models:invoke) and CLATTER_ACCOUNT_ID (your CL- Account ID from Console › Settings) first. Reference: Model API reference.
Good to know#
- New accounts get $5 of free credit; top up from $1 to $800 per purchase in Console › Billing › Credits. Billing
- Retry only
429and 5xx errors, with backoff; honourRetry-Afterwhen it's sent. Which errors to retry - Every response has an
X-Request-Id; log it so a request can be found later. Why log it
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.