Get Usage of API Credits
Action
GetCreditBalance
Introduction
This interface is used to query the credits usage of the current account.
Request
Parameter Name | Type | Description | Required |
---|---|---|---|
Action | String | The corresponding API instruction name | ✓ |
PublicKey | String | User's public key, which can be obtained from the PICPIK User Center (opens in a new tab) | ✓ |
Signature | String | User's signature generated based on the public key and API instruction, see Signature for details | ✓ |
request_uuid | String | Request UUID, randomly generated by using the UUID generation method. This parameter can be utilized to manage the requests of your business and clients. |
Request Example
{
"Action": "GetCreditBalance",
"PublicKey": "ALLak9M4cNdHXKOJAJJ4k8Hh1hZS2EgJF1D0FlPwfl",
"request_uuid":"b91fcfbe-bb35-47ce-a168-bd6252c75270",
"Signature": "0131f4e4296f3ca8e1220b47247e83a4315ea8e1"
}
Response
Field Name | Type | Description | Required |
---|---|---|---|
RetCode | Int | Return status code: 0 indicates a successful return, while non-zero indicates a failure | ✓ |
Action | String | Instruction name | ✓ |
Message | String | The error message is returned when RetCode is non-zero, providing a detailed description | |
request_uuid | String | Returns the UUID that was included in the request |
Field Name | Type | Description | Required |
---|---|---|---|
TotalCredits | Int | Total credits | ✓ |
UsedCredits | Int | Used credits | ✓ |
ExpireTimestamp | Int | The expiration time of the credits |
Response Example
{
"Action": "GetCreditBalance",
"RetCode": 0,
"Message": "",
"request_uuid": "18a62d99-cb9b-4fde-a6a3-d14180a13f2a",
"TotalCredits": 804000,
"UsedCredits": 4641,
"ExpireTimestamp": 1727331226
}