API Reference
Get Credit Balance

Get Usage of API Credits

Action GetCreditBalance

Introduction

This interface is used to query the credits usage of the current account.

Request

Parameter NameTypeDescriptionRequired
ActionStringThe corresponding API instruction name
PublicKeyStringUser's public key, which can be obtained from the PICPIK User Center (opens in a new tab)
SignatureStringUser's signature generated based on the public key and API instruction, see Signature for details
request_uuidStringRequest 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 NameTypeDescriptionRequired
RetCodeIntReturn status code: 0 indicates a successful return, while non-zero indicates a failure
ActionStringInstruction name
MessageStringThe error message is returned when RetCode is non-zero, providing a detailed description
request_uuidStringReturns the UUID that was included in the request
Field NameTypeDescriptionRequired
TotalCreditsIntTotal credits
UsedCreditsIntUsed credits
ExpireTimestampIntThe 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
}