Catalog

Credits balance

GET/v1/credits

Read the calling key's spendable credit balance — total, non-expiring, and expiring soon.

Request

request
curl https://api.picoberry.ai/v1/credits \
  -H "Authorization: Bearer pb_live_xxx"
requests.get("https://api.picoberry.ai/v1/credits", headers=headers).json()["data"]
const credits = (await (await fetch(`${BASE}/v1/credits`, { headers })).json()).data;

Response

response · 200
{ "success": true, "data": {
  "totalAmount": 4200,
  "unlimitedAmount": 4000,
  "limitedAmount": 200,
  "expiringSoonAmount": 200,
  "nextExpirationDate": "2026-09-01T00:00:00.000Z",
  "expiringWallets": [
    { "id": "019…", "amount": 200, "walletType": "subscription", "expiredAt": "2026-09-01T00:00:00.000Z" }
  ]
} }

Fields

FieldDescription
totalAmount
integer
Total credits spendable right now.
unlimitedAmount
integer
Portion that never expires.
limitedAmount
integer
Portion that carries an expiry date.
expiringSoonAmount
integer
Credits expiring in the near term.
nextExpirationDate
string · null
ISO 8601 date of the next expiry, or null when nothing is scheduled to expire.
expiringWallets
array
One entry per time-limited grant — each { id, amount, walletType, expiredAt }.
Some credits expire Subscription and bonus grants are time-limited and surface in expiringWallets with their expiredAt date. Non-expiring purchases sit in unlimitedAmount.
Costs & limits This endpoint returns your balance only. For what each job costs and the request rate limits, see Credits & rate limits.