Balance Query API
API Overview
Used to query the account balance of the current user.
| Protocol | Endpoint | Method | Auth | Request Format | Response Format |
|---|---|---|---|---|---|
| HTTP | /open-api/v1/balance | GET | Bearer | application/json | application/json |
Request Headers
| Parameter | Value | Description |
|---|---|---|
| Content-Type | application/json | Data exchange format |
| Authorization | Bearer | Replace {accessToken} with the accessToken obtained above |
json
Authorization: Bearer <accessToken>
Content-Type: application/jsonRequest Parameters (HTTP GET)
None
Response Body
| Parameter | Field | Type | Description |
|---|---|---|---|
| code | - | String | Error code, see error code table |
| data | totalBalance | Decimal | Total balance |
| msg | - | String | Detailed 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)