Clatter LabsHelp Center

How do I detect and act on abuse warnings in JavaScript?

How-toUpdated
const { data, response } = await client.chat.completions
  .create({ model: "supercosmos-flash", messages })
  .withResponse();

if (response.headers.get("x-clatter-notice") === "abuse_warning") {
  const text = decodeURIComponent(response.headers.get("x-clatter-notice-text") ?? "");
  await flagEndUser(currentUserId, text); // e.g. block or rate-limit this user
}

A second strike within 30 days pauses your whole account for 24 hours, so act on the first one. See the Abuse policy.

Good to know#

  • If calls fail unexpectedly, check status.clatterlabs.com before debugging further.
  • Base URL: https://api.gateway.clatterlabs.xyz/v1, with Authorization: Bearer clsk_... and X-Clatter-Account: CL-... on every call. Quick reference
  • Your key's account is responsible for your end users' text under the Abuse policy. What it means for apps

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.