View your ReverixAI wallet in CC Switch
Use a local API key and a read-only query to view your CNY wallet, paid and gift balances, and the nearest gift expiry.
Know which balance you are viewing
The account wallet is the money currently available to your ReverixAI account. An API key is a credential for one client; its own quota can be smaller than the wallet. This guide displays the account wallet, not the key quota.
The wallet includes paid and gift balances. Expired gifts are excluded; the nearest expiry shows the remaining amount of all gift batches expiring at that time.
An unlimited key still shows the finite account wallet. A positive wallet does not guarantee that this key can make model requests: key limits and status still apply.
Prepare your ReverixAI API key
Sign in to ReverixAI and open API Keys. Create a key for CC Switch with a recognizable name, or copy an existing key from its menu. Store it only in your local CC Switch provider configuration.
Open usage query configuration
In CC Switch, select the application you use and find your ReverixAI provider. Open More (⋯) → Configure Usage Query. Read the trust warning before continuing. Choose Custom; do not choose the default NewAPI template.
Review and paste the query script
Paste the complete script below into the custom script editor. The API Key field may use the provider key when left empty; if it cannot be read automatically, paste your ReverixAI key locally. Leave Access Token and User ID empty. The request uses Authorization: Bearer {{apiKey}}.
({ request: { url: "https://reverix.ai/api/usage/wallet", method: "GET", headers: { Authorization: "Bearer {{apiKey}}" } }, extractor: function(response) { var d = response && response.data; if (!response || response.success !== true || !d || d.currency !== "CNY" || typeof d.total_available_cny !== "number" || !isFinite(d.total_available_cny) || d.total_available_cny < 0 || typeof d.paid_available_cny !== "number" || typeof d.gift_available_cny !== "number") { return { isValid: false, invalidMessage: "钱包暂不可读,请稍后重试" }; } var extra = "实付 ¥" + d.paid_available_cny.toFixed(6) + " · 赠送 ¥" + d.gift_available_cny.toFixed(6); if (d.next_gift_expiry) { extra += " · 最近到期 ¥" + d.next_gift_expiry.amount_cny.toFixed(6) + "(" + d.next_gift_expiry.expires_at + ",UTC)"; } return { isValid: true, planName: "ReverixAI 账户钱包", remaining: d.total_available_cny, unit: "CNY", extra: extra + " · 快照 " + d.as_of }; } })
Keep the model endpoint separate
The Base URL https://reverix.ai/v1 is for model requests. Wallet queries use the full independent address https://reverix.ai/api/usage/wallet, with no /v1 prefix. This script fixes the destination explicitly, so changing the provider Base URL does not redirect your key elsewhere. No deep-link import is required.
GET https://reverix.ai/api/usage/wallet Authorization: Bearer YOUR_REVERIX_API_KEY
Test, save and enable automatic refresh
After reviewing the script, turn on Enable Usage Query and click Test Script. Confirm that the result is your account wallet with unit CNY, then save. Use an automatic query interval of 5–15 minutes; 0 disables automatic refresh. Automatic queries run only for the active provider. A 10-second timeout is a reasonable starting point.
Read the returned amounts
The extractor maps data.total_available_cny to remaining and fixes unit to CNY. Paid and gift balances appear in extra. The API returns numeric CNY amounts with up to six decimal places; CC Switch may round the main display to two decimals. The script keeps six decimals in the breakdown. No quota divisor or exchange-rate calculation belongs in this script.
next_gift_expiry is null when there is no expiring gift balance. Otherwise amount_cny is the amount expiring at expires_at; it is already included in the gift balance, not an extra credit.
expires_at and as_of use UTC RFC3339 timestamps ending in Z. as_of is the server snapshot time, not a reservation or real-time guarantee. Mainland China time is UTC+8.
The existing /api/usage/token reports only this key’s raw quota, usage and unlimited flag. Its fields are not CNY wallet amounts and cannot be mapped directly to this script.
If the query fails
Use Test Script to read the HTTP status. Do not send your full key or raw wallet response to support. Check the items below before changing the script.
401: check that the local API key is complete, belongs to ReverixAI and has not been disabled or revoked. Use Bearer authentication, not a login cookie or site access token. Expired or exhausted keys may still query; they cannot necessarily call models.
403: the account is unavailable. Check your account status on ReverixAI; do not bypass it by changing headers.
404: verify the exact path /api/usage/wallet. Remove any /v1 prefix and check for an outdated endpoint.
429: reduce the refresh frequency and retry later. 503 wallet_unavailable: the wallet snapshot is temporarily unavailable, including when balances need reconciliation or the account has debt. Retry later or contact support with redacted error text. No balance is repaired by this query.
Wrong currency or amount: confirm Custom is selected, unit is CNY, and remaining reads data.total_available_cny. Remove the default NewAPI quota / 500000 and USD mapping. A stale balance may simply need a manual refresh.
Keep the key local
Never enter your ReverixAI login password, site access token or user ID for this query. Do not send a key to support, include it in screenshots, commit it to a repository or place it in a shared provider configuration. If exposed, disable or revoke it in API Keys, create a replacement, and update CC Switch. Recheck the destination and script after imports or upgrades.