Skip to main content

AILabTools API - Querying Credits - API

Request

  • URL: https://www.ailabapi.com/api/common/query-credits
  • Method: GET

Headers

FieldRequiredTypeDescription
ailabapi-api-keyYESStringApplication API KEY. Get API KEY

Response

Response Field Handling Flow
  1. Handle Public Response Fields

    Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.

  2. Handle Business Response Fields

    If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

FieldTypeScopeDescription
dataarray
+unique_signstringViewUnique identification.
+namestringName.
+balancefloatCredit Balance.
+totalfloatTotal Credits.
+last_recharge_balancefloatBalance after last purchase.
+balance_warningfloatCredit Balance Early Warning Value.
+first_buy_timeintegerTime of first purchase.
+last_update_timeintegerLast update time.

Unique Identification

NameUnique identification
Universal credits (all APIs supported)common

Response Example

{
"error_code": 0,
"error_code_str": "",
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"data": [
{
"unique_sign": "",
"name": "",
"balance": 0,
"total": 0,
"last_recharge_balance": 0,
"balance_warning": 0,
"first_buy_time": 0,
"last_update_time": 0
}
]
}

Sample Code