Skip to main content
/api/user/self returns the available quotas for the currently authenticated user. It only returns balance data. To retrieve the user’s full profile, including their name, email, role, permissions, and settings, use GET /api/user/self/all.

Request

Authentication

The endpoint only allows access to the currently authenticated user’s balance. You can authenticate with a system access token or a login session.
A system access token is not an sk-... API key used for model requests. New-Api-User must be a numeric user ID that matches the user associated with the token or session.
Neither regular users nor administrators can retrieve another user’s data by changing New-Api-User.

Successful response

Response fields

All monetary fields use the platform’s native integer quota unit. Fields remain present when their value is 0.

Calculation

data.quota only includes the wallet balance and remaining active credit:
For the example above, 500000 + 12247995 = 12747995. The following fields are not included in data.quota:
  • test_voucher_quota
  • subscription_quota
  • subscription_unlimited
Therefore, data.quota is not the sum of every funding source.

Quota definitions

Wallet balance

wallet_quota is the user’s current wallet balance. A subsequent request returns the latest value after a top-up, an administrator adjustment, or wallet usage completes.

Credit quota

credit_quota only includes the remaining amount of credit with an active status:
Disabled or reclaimed credit is not included.

Test voucher quota

test_voucher_quota only includes vouchers that meet all of the following conditions:
  • The effective time has started.
  • The expiration time has not passed.
  • The voucher is available.
  • The remaining quota is greater than 0.
Model restrictions do not affect the displayed voucher balance, but they do affect whether the voucher can be used for a specific model request.

Subscription quota

subscription_quota is the remaining quota for limited subscriptions. Unlimited subscriptions are represented separately by subscription_unlimited: true; no special number or string is written to data.quota.

Currency conversion

Clients should calculate with the original quota values and should not hard-code a USD conversion rate. The current production environment is configured as follows:
With the current production conversion, the example response represents: Conversion settings can differ between deployments. The current production rate is not a fixed API contract.

Error responses

Authentication failures do not include balance or full-profile data. For example, an invalid token may return:
A New-Api-User value that does not match the authenticated user may return:
A session that does not belong to the current site typically returns HTTP 403. If a server-side query fails, the response indicates failure and does not include a data object assembled from only some funding sources.
Some authentication failures can return HTTP 200 with success: false in the response body. Clients must check the HTTP status, success, and message together.