Skip to content

Balance Query API

API Overview

Used to query the account balance of the current user.

ProtocolEndpointMethodAuthRequest FormatResponse Format
HTTP/open-api/v1/balanceGETBearerapplication/jsonapplication/json

Request Headers

ParameterValueDescription
Content-Typeapplication/jsonData exchange format
AuthorizationBearerReplace {accessToken} with the accessToken obtained above
json
Authorization: Bearer <accessToken>
Content-Type: application/json

Request Parameters (HTTP GET)

None

Response Body

ParameterFieldTypeDescription
code-StringError code, see error code table
datatotalBalanceDecimalTotal balance
msg-StringDetailed error message
json
{
    "code": 200,
    "msg": "success",
    "data": {
        "totalBalance": 14.00
    }
}

Error Codes

Error codes are returned in JSON structure, including code and msg fields. We will expand the corresponding field values with version updates.

json
{
    "code": 401,
    "data": {},
    "msg": "Unauthorized"
}

Request Examples (Shell & Python)

Shell

shell
curl --location --request GET 'https://api.hitem3d.ai/open-api/v1/balance' \
--header 'Authorization: Bearer <accessToken>' \
--header 'Content-Type: application/json'

Python

python
import requests

url = "https://api.hitem3d.ai/open-api/v1/balance"

payload={}
headers = {
   'Authorization': 'Bearer <accessToken>',
   'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)