Balance
GEThttps://api.aerless.ai/v1/credits
Your balance, for scripts and monitoring.
Response#
curl
curl https://api.aerless.ai/v1/credits \
-H "Authorization: Bearer $AERLESS_API_KEY"Response
{
"object": "credits",
"unit": "usd",
"available": ‹dollars›,
"held": ‹dollars›,
"balance": ‹dollars›,
"available_micro": "‹micro-dollars›",
"held_micro": "‹micro-dollars›"
}| Field | Meaning |
|---|---|
available | US dollars you can spend now. |
held | Reserved by requests in progress; returned on finish, less the cost. |
balance | available + held. |
available_micro | available in micro-dollars (1 USD = 1,000,000), as a string. |
held_micro | held as a string of micro-dollars. |
Low-balance check#
Warns below the minimum top-up. Run it from cron.
low-balance.sh
LOW=10
AVAILABLE=$(curl -s https://api.aerless.ai/v1/credits \
-H "Authorization: Bearer $AERLESS_API_KEY" | jq -r .available)
awk -v a="$AVAILABLE" -v l="$LOW" 'BEGIN { exit !(a < l) }' \
&& echo "Low balance: $AVAILABLE USD"Top-ups, payments and alerts are in the dashboard. See top-ups.