Clatter LabsHelp Center

How do I build my own low-balance alert for the Agent API?

How-toUpdated

The API doesn't send balance alerts itself, but a tiny job can:

  1. Create a key with only account:read.
  2. Every hour (or before big batches), call GET /v1/account.
  3. If balance_usd is below your threshold, send yourself an alert and pause new runs.
acct = requests.get(f"{BASE}/v1/account", headers=headers).json()
if acct["balance_usd"] < 5:
    notify(f"Clatter credits low: ${acct['balance_usd']:.2f}")

Your app should also handle 402 out_of_credits by stopping new runs, since retrying won't help.

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.