Clatter LabsHelp Center

How should my code handle Agent API errors?

How-toUpdated

A good default:

StatusAction
400, 404, 405, 413Don't retry; fix the request
401Don't retry; check key and Account ID
402 out_of_creditsStop creating runs; alert someone
403 account_suspendedDon't retry before resets_at
403 otherFix permissions or access
429Wait Retry-After seconds, then retry
502, 503Retry with exponential backoff

Always branch on error.code, log the message, and include the run id or time when you contact support.

Learn more#

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.