Skip to main content
GET
  • Query the overall balance of the current user account
  • Monitor user-level usage
  • CORS cross-origin support
  • Real-time balance monitoring
Get the remaining and used balance of the current user account. This endpoint returns user-level balance information, independent of specific tokens, for viewing the overall account balance. Credit fields are also returned using the fixed conversion rate 1 USD = 200 credits.

Authorizations

string
required
All endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:

Endpoints

Both endpoints have the same functionality, you can use either one.

Response

boolean
Whether the request was successful
string
Error message (only returned on failure)
float
User remaining balance (returned on success). Returns -1 when unlimited_quota is true
float
User used balance (returned on success)
float
User remaining credits (returned on success). Credits are calculated with 1 USD = 200 credits
float
User used credits (returned on success)
float
Credit conversion rate. Currently returns 200
boolean
Whether the user has unlimited quota. true means unlimited, false means limited

Token Balance vs User Balance

Use Cases

  • View overall user account balance
  • Set up recharge reminders and balance alerts
  • Display account balance in user dashboard
Balance Unit InformationThe unit of the balance value depends on system configuration:
  • USD - US Dollars
  • CNY - Chinese Yuan
  • Tokens - Token count
For stable integration, prefer remain_credits and used_credits when you need credit values. These fields always use 1 USD = 200 credits and do not depend on the balance display configuration.
Unlimited Quota UserWhen a user is set to unlimited quota:
  • unlimited_quota field returns true
  • remain_balance field returns -1
  • The user has no quota restrictions and can use the API without limits

Common Errors

Security NoteYour API Key is like a password. Keep it secure and don’t share it with others. Always use HTTPS in production.