GetAccount
Gets the account information of the account that owns the API key, including the balance and the total amount spent.
Examples
Query the account balance.
python
# api() is the function in the Python example on the signature authentication page
r = api('GetAccount')
print(r['data']['result']['balance'] / 1e8) # output: 229.44702436 (USD)Returns
| Type | Description |
object | On success |
Attributes
| Name | Type | Description |
balance | number | Account balance in USD, as an integer scaled by 1e8; divide by 1e8 for the actual value (229.44702436 in the example). |
consumed | number | Total amount spent, in the same unit and scaling as |
username | string | User name. |
string | Account email. | |
uid | string | Account UID. |
Remarks
Example response
json
{
"code": 0,
"data": {
"result": {
"balance": 22944702436,
"concurrent": 0,
"consumed": 211092719653,
"email": "[email protected]",
"openai": false,
"settings": {},
"sns": {"wechat": true},
"uid": "105ea6e51bcc177926a10fdbb7e2a1d6",
"username": "abc"
},
"error": null
}
}