amnt docs
DevelopersREST API

Check balance

GET /api/v1/balance — the credit balance your API key spends from.

GET https://www.amnt.io/api/v1/balance

Free to call, and the same number the website shows.

curl https://www.amnt.io/api/v1/balance \
  -H "Authorization: Bearer $AMNT_API_KEY"
Response
{
  "credits": 497,
  "credit_key": "user:8f2c1e0a-3b44-4f6d-9d21-70b0d1f2c3a4"
}
FieldDescription
creditsWhole credits available. 1 credit = $0.01
credit_keyThe identity your credits sit on. Stable, and shared with the website — a top-up made in the browser is spendable here immediately

Do not poll this

Every run response already carries credits_remaining. Use it. Polling this endpoint in a loop spends rate limit for a number you were handed a moment ago.

Using it as a health check

A 200 here proves three things at once: the key is valid, it is not revoked, and the service is up. It is the cheapest smoke test to run after a deploy.

CI check
# Fails the build if the key is dead.
curl -sf https://www.amnt.io/api/v1/balance \
  -H "Authorization: Bearer $AMNT_API_KEY" > /dev/null \
  || { echo "amnt key is not working"; exit 1; }

On this page