Check your balance
Replacesk-YOUR-KEY with your own Key and run:
Read the response
Example response (the numbers are illustrative):
Divide any quota number by 500000 to get the amount in CNY:
Balance for unlimited tokens
To see your real account balance, give the token one extra permission:1
Open the token settings
Log in to ruoli.dev, go to the Tokens page, and edit the token you query with.
2
Turn on Allow querying user quota
Turn on Allow querying user quota and save.
3
Query again
Run the command above again and read
data.user_quota.total_available. Divide it by 500000 to get your account balance.This switch only controls whether the query endpoint can see your account balance. It doesn’t change the token’s quota or what it can call.
Show your balance in third-party clients
Many chat clients and balance checkers use OpenAI’s legacy billing endpoints. Set the API URL in the client tohttps://ruoli.dev and the Key to your token, and the balance usually shows up with no extra setup.
These are the two endpoints they call. You can query them yourself too:
These two endpoints only count the token itself. For an unlimited token, use
/api/usage/token/ above and turn on Allow querying user quota.Common errors
401 Invalid token
401 Invalid token
The Key was copied incorrectly, or it has been deleted, disabled, or has expired. Check its status on the Tokens page and copy the full string starting with
sk- again.The token has an IP allowlist
The token has an IP allowlist
Balance queries must also come from an allowed IP, or they are rejected.
I get a web page or a 301 redirect
I get a web page or a 301 redirect
Check the URL: use
https and keep the trailing /. The full URL is https://ruoli.dev/api/usage/token/.Can I poll it from a program?
Can I poll it from a program?
Yes, but the endpoint is rate limited. Once every few minutes is enough.

