Check Balance
Query the balance status for the user that owns the current API Key.
GET
/api/v1/credits/balance| Field | Value |
|---|---|
| Base URL | https://api.gate.ai |
| Auth | Authorization: Bearer <API_KEY> |
| Format | Gate.AI REST JSON |
Request Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | Yes | API Key authentication. Format: Bearer <API_KEY> |
Response Fields
| Name | Type | Description |
|---|---|---|
| code | integer | Business status code. Success is always 200. |
| data | object | Balance data. |
| data.status | integer | Balance status: 1 tradable, 2 insufficient balance, 4 overdue debt. |
| data.message | string | Status description. |
| data.asset_type | string | Asset ownership type: user_asset for personal assets, organization_asset for organization assets. |
| data.recharge_balance | string | Recharge balance. |
| data.debt_amount | string | Debt amount. Empty string or a zero-value string when there is no debt. |
Response Example
json
1{2 "code": 200,3 "data": {4 "status": 1,5 "message": "可以交易",6 "asset_type": "user_asset",7 "recharge_balance": "12.34000000",8 "debt_amount": ""9 }10}Response
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Query succeeded. Returns code and data. | CreditsBalanceResponse |
| 401 | Unauthorized | API Key is missing, invalid, expired, revoked, disabled, or inactive. | ErrorResponse |
| 403 | Forbidden | The member that owns the current API Key does not have permission to view the balance. | ErrorResponse |
| 429 | Too Many Requests | Rate limit reached. | ErrorResponse |
| 500 | Internal Server Error | Gateway internal error, such as API Key lookup failure or response serialization failure. | ErrorResponse |
| 502 | Bad Gateway | Balance upstream service is unavailable, returned a non-success status, response parsing failed, or data is empty. | ErrorResponse |
Error Response Example
json
1{2 "error": {3 "type": "authentication_error",4 "code": "7022002001",5 "message": "invalid api key"6 }7}