Get credit balance
Inspect your current credit balance, monthly limit, used amount, and low-balance status.
curl https://api.chuger.com/v1/credits \
-H "Authorization: Bearer YOUR_API_TOKEN"
const res = await fetch('https://api.chuger.com/v1/credits', {
headers: { Authorization: `Bearer ${process.env.CHUGER_TOKEN}` },
});
const balance = await res.json();
import os, requests
r = requests.get(
"https://api.chuger.com/v1/credits",
headers={"Authorization": f"Bearer {os.environ['CHUGER_TOKEN']}"},
)
balance = r.json()
{
"balance": 18675,
"formatted_balance": "18,675",
"limit": 20000,
"used": 1325,
"status": {
"balance": 18675,
"formatted_balance": "18,675",
"limit": 20000,
"used": 1325,
"is_low": false,
"threshold": 4000,
"percentage_used": 6.63,
"next_renewal": null
}
}
{
"error": "No account found for user"
}
Returns your current credit balance and a snapshot of usage.
GET https://api.chuger.com/v1/credits
All /v1/credits/* endpoints are free to call and not subject to per-minute rate limits. For a conceptual overview of how credits work, see Credits.
Authentication
Bearer token in the Authorization header. See Authentication.
Example
Response fields
Credits remaining this period.
Locale-formatted balance for display purposes (e.g. "18,675").
Total credits in your monthly allowance.
Credits consumed so far this period.
Detailed status object — same shape as Usage stats.
true when balance falls below the warning threshold (20% of the limit, with a floor of 50).
Low-credit warning threshold.
Usage as a percentage (0–100).
ISO-8601 timestamp of the next monthly reset, or null if not yet known.
Errors
| Status | When |
|---|---|
401 | Missing or invalid token |
404 | The account associated with the token wasn't found |
See Errors for the full reference.