How do I check my credit balance from code?
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:
| Field | Meaning |
|---|---|
balance_usd | Credits left, in US dollars |
granted_usd / spent_usd | Credits granted so far and credits used |
out_of_credits | true when metered products answer 402 out_of_credits |
usage_30d | Totals for the last 30 days |
by_product_30d | The 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?#
- 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.