API referenceBeginnersUpdated
GET/v1/user/balance

API console

GET/v1/user/balance
View keys

Requests use the API key you enter and follow standard API billing.

Balance Query API

Query your account balance and plan usage with your API key — ideal for your own scripts or monitoring.

Endpoint & Authentication

text
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:

text
Authorization: Bearer <your API key>
X-Api-Key: <your API key>
x-goog-api-key: <your API key>

Response Fields

FieldTypeDescription
is_activebooleanWhether the account is enabled
balancenumberAvailable balance
unitstringCurrency for balances and quotas, always CNY (yuan)
plan_typestringpaygo for pay-as-you-go. Monthly plan values start with monthly_, for example monthly_2, monthly_limit_5, and monthly_gpt_5
daily_limitnumberMonthly plan daily quota
daily_usednumberMonthly plan quota used today
daily_remainingnumberQuota remaining today on an active monthly plan. 0 without an active plan
plan_expires_atstring/nullPlan expiry time (ISO 8601), null without a monthly plan

Examples

curl:

bash
curl https://api.icodeeasy.cc/v1/user/balance \
  -H "Authorization: Bearer <your API key>"

Example response:

json
{
  "is_active": true,
  "balance": 80.28,
  "unit": "CNY",
  "plan_type": "paygo",
  "daily_limit": 0,
  "daily_used": 0,
  "daily_remaining": 0,
  "plan_expires_at": null
}

Python:

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

The query consumes no quota and works with a zero balance. Requests outside monthly plan coverage can draw from the account balance.

HTTP 401 indicates a missing or invalid API key. For network issues, see connection and recovery.