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" }
],
"scopedAmounts": { "1": 149590 }
} }Fields
| Field | Description |
|---|---|
| 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 }. |
| scopedAmounts object | Restricted allowances, keyed by scope id — 1 is the Nano Banana image allowance. Not included in totalAmount: these can only pay for the tasks their scope covers. |
Some credits expire Subscription and bonus grants are time-limited and surface in
expiringWallets with their expiredAt date. Non-expiring purchases sit in unlimitedAmount.Nano Banana allowance Paid plans receive a monthly image allowance that only
nano-banana, nano-banana-2 and nano-banana-pro can spend, and it is drained before your general credits. It is reported in scopedAmounts and deliberately left out of totalAmount — so a totalAmount of 0 does not mean a Nano Banana request will fail. Check scopedAmounts["1"] too.Costs & limits This endpoint returns your balance only. For what each job costs and the request rate limits, see Credits & rate limits.