Account
Account Balance
https://api.sangtao.ai/v2/account/balanceAuthorization
X-Api-Keystring · headerrequiredYour API key, from the API keys page of your account.
Get current credit balance. Check this before submitting generation jobs to ensure sufficient credits.
Response
freeCreditnumberFree credits from subscription plan / trial bonus. Resets monthly
purchasedCreditnumberPurchased credits. Never expire
lockedCreditnumberCredits held for currently running jobs
availableCreditnumberfreeCredit + purchasedCredit - lockedCredit
hasPurchasedbooleanWhether user has ever purchased credits
topupMemostringMemo/reference code for bank transfer top-up
isTelegramLinkedbooleantrue when the account has a notification channel switched on (Telegram, for example)
trialOfferobject | nullThe trial pack a new account can still buy. null when there is none to offer
Show child attributesHide child attributes
eligiblebooleanWhether it can still be bought
expiresAtstring | nullLast moment to buy it, ISO 8601 in UTC (ends in Z). A deadline for the offer, not for the credits
remainingSlotsnumber | nullPlaces left — only when few remain, otherwise null
priceVndnumberPrice to pay, in VND
creditsnumberTotal credits received, bonus included
bonusCreditsnumberThe bonus part of credits
Deduction order
/account/balancecurl "https://api.sangtao.ai/v2/account/balance" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": {
"freeCredit": 50,
"purchasedCredit": 100,
"lockedCredit": 8,
"availableCredit": 142,
"hasPurchased": true,
"topupMemo": "891188",
"isTelegramLinked": false,
"trialOffer": null
}
}/account/balancecurl "https://api.sangtao.ai/v2/account/balance" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": {
"freeCredit": 50,
"purchasedCredit": 100,
"lockedCredit": 8,
"availableCredit": 142,
"hasPurchased": true,
"topupMemo": "891188",
"isTelegramLinked": false,
"trialOffer": null
}
}