API endpoints

Credit Balance API

GET /open/v1/balance returns the credit balance of the account that owns the API key. The API and web app share one balance; use it for pre-checks or alerts.

On this page

Get balance

http
GET /open/v1/balance

Returns the currently available credits of the account that owns the API key. The API and the web app share the same credit balance.

curl https://api.zroimg.com/open/v1/balance \
  -H "Authorization: Bearer zk-xxxxxxxxxxxxxxxxxxxxxxxx"

Response

json
{
  "points": 1280
}
FieldTypeDescription
pointsintegerCurrently available credits

Usage tips

  • Check your balance before batch submissions to avoid running into 402 insufficient_points midway.
  • Check your balance on a schedule and remind yourself to buy credits when it drops below a threshold.
  • The balance endpoint is also the simplest way to verify that an API key is valid: an invalid key returns 401 invalid_api_key.