sangtao.ai
API key

Account

Account Balance

GEThttps://api.sangtao.ai/v2/account/balance

Authorization

  • X-Api-Keystring · headerrequired

    Your 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

  • freeCreditnumber

    Free credits from subscription plan / trial bonus. Resets monthly

  • purchasedCreditnumber

    Purchased credits. Never expire

  • lockedCreditnumber

    Credits held for currently running jobs

  • availableCreditnumber

    freeCredit + purchasedCredit - lockedCredit

  • hasPurchasedboolean

    Whether user has ever purchased credits

  • topupMemostring

    Memo/reference code for bank transfer top-up

  • isTelegramLinkedboolean

    true when the account has a notification channel switched on (Telegram, for example)

  • trialOfferobject | null

    The trial pack a new account can still buy. null when there is none to offer

    Show child attributes
    • eligibleboolean

      Whether it can still be bought

    • expiresAtstring | null

      Last moment to buy it, ISO 8601 in UTC (ends in Z). A deadline for the offer, not for the credits

    • remainingSlotsnumber | null

      Places left — only when few remain, otherwise null

    • priceVndnumber

      Price to pay, in VND

    • creditsnumber

      Total credits received, bonus included

    • bonusCreditsnumber

      The bonus part of credits

Deduction order

Credits are deducted from freeCredit first, then purchasedCredit. Check availableCredit >= estimated cost before submitting a job.
GET/account/balance
curl "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
  }
}