Clatter LabsHelp Center

How do I check my credit balance from code?

How-toUpdated
curl https://api.agent.clatterlabs.xyz/v1/account \
  -H "Authorization: Bearer $CLATTER_API_KEY" \
  -H "X-Clatter-Account: $CLATTER_ACCOUNT_ID"

The key needs the account:read permission (included in the Read only preset). Useful fields in the response:

FieldMeaning
balance_usdCredits left, in US dollars
granted_usd / spent_usdCredits granted so far and credits used
out_of_creditstrue when metered products answer 402 out_of_credits
usage_30dTotals for the last 30 days
by_product_30dThe same, split by product

GET /agent-config called with a key and your Account ID also returns your credit balance. See Get account.

Good to know#

  • The Console and docs state credits don't expire.
  • Buy any whole amount from $1 to $800 per purchase.

Learn more#

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.