APIBeginnersUpdated
Balance Query API
Query your account balance and plan usage with your API key — ideal for your own scripts or monitoring.
Endpoint & Authentication
GET https://api.icodeeasy.cc/v1/user/balance
The path without the /v1 prefix, https://api.icodeeasy.cc/user/balance, works as well.
Authenticate with your own API key using any one of these headers:
Authorization: Bearer <your API key>
X-Api-Key: <your API key>
x-goog-api-key: <your API key>
Response Fields
| Field | Type | Description |
|---|---|---|
is_active | boolean | Whether the account is enabled |
balance | number | Available balance (yuan) |
unit | string | Currency, always CNY |
plan_type | string | Plan type: balance for pay-as-you-go users, monthly_limit_* for monthly plan users |
daily_limit | number | Monthly plan daily quota (yuan), 0 for non-plan users |
daily_used | number | Monthly plan quota used today (yuan) |
daily_remaining | number | Monthly plan quota remaining today (yuan) |
plan_expires_at | string/null | Plan expiry time (ISO 8601), null without a monthly plan |
Examples
curl:
curl https://api.icodeeasy.cc/v1/user/balance \
-H "Authorization: Bearer <your API key>"
Example response:
{
"is_active": true,
"balance": 80.28,
"unit": "CNY",
"plan_type": "balance",
"daily_limit": 0,
"daily_used": 0,
"daily_remaining": 0,
"plan_expires_at": null
}
Python:
import requests
resp = requests.get(
"https://api.icodeeasy.cc/v1/user/balance",
headers={"Authorization": "Bearer <your API key>"},
timeout=10,
)
resp.raise_for_status()
data = resp.json()
print(f"Balance: ¥{data['balance']:.2f} ({data['unit']})")
Notes
- Balances are in Chinese yuan (CNY). Monthly plan users should mainly watch
daily_remaining(daily quota);balanceis the backup balance charged after the daily quota runs out. - This endpoint only queries balance. It always returns normally — even with a zero balance — and is never blocked by the balance check.
- A 401 response means the API key is missing or invalid;
is_active: falsemeans the account has been disabled. - If
api.icodeeasy.ccis slow, switch to a backup domain:https://jp.icodeeasy.ccorhttps://sg.icodeeasy.cc.