Account
Query User Balance
Query the remaining and used quota of the current user account
GET
Documentation Index
Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
Use this file to discover all available pages before exploring further.
- Query the overall balance of the current user account
- Monitor user-level usage
- CORS cross-origin support
- Real-time balance monitoring
1 USD = 200 credits.
Authorizations
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
Response
Whether the request was successful
Error message (only returned on failure)
User remaining balance (returned on success). Returns
-1 when unlimited_quota is trueUser used balance (returned on success)
User remaining credits (returned on success). Credits are calculated with
1 USD = 200 creditsUser used credits (returned on success)
Credit conversion rate. Currently returns
200Whether the user has unlimited quota.
true means unlimited, false means limitedToken Balance vs User Balance
| Comparison | Token Balance (/v1/balance) | User Balance (/v1/user/balance) |
|---|---|---|
| Scope | Single token | Entire user account |
| Data Source | Token’s RemainQuota and UsedQuota | User’s quota and used_quota |
| Use Case | Monitor single API Key usage | View overall account balance |
| Limited By | Token-level quota limits | User-level quota limits |
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
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.Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| No Authorization header | Authorization header not provided | Add Authorization: Bearer sk-xxxxx header |
| Failed to get user quota | User doesn’t exist | Check if the user associated with the token exists |
| Failed to get used quota | Database query error | Contact admin to check system status |