Balance and Billing

Balance and Billing

Query the account balance, key quota and period budget with an API key.

Use this endpoint to check the account balance outside the console. Only an sk- API key created in the console is required; no sign-in session is needed.

Query the account balance

GET https://token.easyapi.com/v1/billing/balance
Authorization: Bearer sk-xxxxxxxx

If the key is device-bound (for example created through EasyAPI Skill / CLI), send the same device fingerprint as well:

X-EasyAPI-Client-Id: <64 lowercase hex characters>

Request example

curl https://token.easyapi.com/v1/billing/balance \
  -H "Authorization: Bearer sk-xxxxxxxx"

Response example

{
  "success": true,
  "data": {
    "wallet": { "amount": 128.6, "currency": "CNY" },
    "token": {
      "amount": 28.6,
      "currency": "CNY",
      "unlimited": false,
      "total_granted": 50,
      "total_used": 21.4
    },
    "budget": { "amount": 10, "currency": "CNY", "period": "daily" }
  }
}

Fields

FieldTypeDescription
walletobjectAccount balance; team keys return the team wallet balance
wallet.amountnumberAvailable balance, already converted to the display currency
wallet.currencystringCurrency code, such as CNY, USD or a custom currency symbol
tokenobjectQuota of the current key
token.amountnumberRemaining quota of the key
token.unlimitedbooleanWhether the key has unlimited quota
token.total_grantednumberTotal granted quota of the key (remaining + used)
token.total_usednumberTotal used quota of the key
budgetobjectReturned only when the key has a period budget
budget.amountnumberRemaining budget for the current period
budget.periodstringdaily or monthly

Status codes

HTTP statusDescription
200Success
401Missing or invalid API key
403Key disabled or expired, IP not in the allowlist, or device binding mismatch (client_binding_mismatch)
500Wallet or budget is temporarily unavailable; retry later

Notes

  • Amounts are already converted to the display currency of the console (CNY on this site). Do not convert again with 500,000 quota = 1 USD; use the currency field for the actual unit.
  • For unlimited keys, token.amount is meaningless; read the account balance from wallet instead.
  • An exhausted key (zero balance) still returns 200, so clients can show an "insufficient balance" state.