Skip to main content
Fhddos exposes a dedicated balance endpoint so you can embed real-time quota and spending data directly into your own dashboards, alerting pipelines, or internal tooling. The response includes both raw quota values and human-readable monetary amounts — giving you everything you need to build a complete balance display without additional calculation.

Endpoint

GET https://aiapi.fhddos.com/api/user/balance

Authentication

This endpoint requires a Profile Access Token — not the model API key that starts with sk-. Generate your Profile Access Token in Console → Profile → Generate Access Token.
Your model API key (sk-...) cannot authenticate this endpoint. Using it will return an authentication error. Always use the Profile Access Token for account management API calls.
Pass the token in the Authorization header:
curl -H "Authorization: Bearer <your-profile-access-token>" \
  https://aiapi.fhddos.com/api/user/balance

Response Examples

Display Enabled

When monetary display is turned on in your profile, the response includes a fully populated display object with currency and amount fields ready for direct rendering.
{
  "success": true,
  "message": "",
  "data": {
    "quota": 1000000,
    "used_quota": 500000,
    "balance_quota": 1000000,
    "quota_unit": "quota",
    "display": {
      "enabled": true,
      "currency": "CNY",
      "balance": 14.0,
      "used": 7.0
    }
  }
}

Display Disabled

When display is disabled, the display object contains only enabled: false. Use the raw quota fields for programmatic quota checks.
{
  "success": true,
  "message": "",
  "data": {
    "quota": 1000000,
    "used_quota": 500000,
    "balance_quota": 1000000,
    "quota_unit": "quota",
    "display": { "enabled": false }
  }
}

Response Fields

quota
int
Current remaining quota expressed as a raw internal value. Use this for programmatic threshold checks.
used_quota
int
Cumulative quota consumed since account creation, expressed as a raw internal value.
balance_quota
int
Identical to quota. This field exists as a semantically clearer alias for balance-display contexts — prefer it when building UI components that show remaining balance.
quota_unit
string
Always "quota". This constant identifies that quota, used_quota, and balance_quota are raw internal quota units, not currency amounts.
display.enabled
bool
true when the platform is configured to expose monetary display amounts. false when only raw quota values are available.
display.currency
string
Currency code for the display amounts (e.g., "CNY"). Follows the currency configured in your Profile settings. Returned only when display.enabled is true.
display.balance
float
Remaining balance expressed in the display currency, up to six decimal places. Use this field to show users their available spend. Returned only when display.enabled is true.
display.used
float
Cumulative amount spent expressed in the display currency, up to six decimal places. Returned only when display.enabled is true.
Render data.display.balance directly in your UI for a human-readable balance. For quota-gating logic (e.g., blocking new jobs when quota runs low), compare data.balance_quota against a threshold instead. Change the display currency at any time in Console → Profile → Quota Display Currency — it defaults to CNY and affects only the display fields.

EndpointAuthPurpose
GET /api/user/balanceProfile Access TokenRecommended — dedicated balance query
GET /api/user/selfProfile Access TokenFull user profile (includes quota and used_quota fields)
GET /v1/dashboard/billing/subscriptionModel API Key (sk-...)OpenAI-compatible — returns token-level quota, not account balance

Frequently Asked Questions

Log in to the Fhddos Console, open Profile from the top-right menu, and click Generate Access Token. Copy the token immediately — it is shown only once. If you lose it, click Reset Access Token to invalidate the old token and generate a new one.
Model API keys (sk-...) are scoped to model inference endpoints under /v1/. Account management endpoints under /api/ require a Profile Access Token. This separation ensures that a leaked model key cannot expose account or billing data. Always use the correct credential for each endpoint family.
No. The display currency setting only changes the values in display.currency, display.balance, and display.used. Your actual billing, quota deductions, and the raw quota / used_quota / balance_quota fields are completely unaffected by this preference.
Both fields return the same integer value — your current remaining raw quota. balance_quota is an alias added to make intent explicit in balance-display contexts. If you are building a UI widget that shows remaining balance, use balance_quota for clarity. If you are writing quota-gate logic, either field works identically.
When display.enabled is false, the platform does not expose a monetary conversion for your raw quota. Use the quota and used_quota fields for programmatic checks (e.g., triggering an alert when quota drops below a threshold). Do not attempt to derive a currency amount from raw quota values on your own, as the internal conversion factor is not part of the public API contract.