Get Balance
Retrieve the account generation credit balance
POST
https://api.genrex.com/v1/text2music/getBalance
Request body
{}
The submitted
${payload}
must be assigned as a string in the form of{}
Headers
{
'gx-key': '4nBmZkU2-VdTNrPqL7e9y', // Suppose your-api-secret = 7Xd9PfMlkanB5ZTuj0qQG
'gx-signature': 't=1717590783542,v=503eb068b5cddc2f3a2308bea1288af993072ff32c372469d0bf71e8346e5f3c',
'Content-Type': 'application/json' ,
}
gx-key string Required
- your-api-key
gx-signature string Required
To generate the
gx-signature
, follow these steps:
- Convert the payload object to a JSON string.
- Concatenate the current timestamp and the JSON string with a dot (.) to form the string to be signed e.g.
${timestamp}.${payload}
- Use the
sha256-HMAC
algorithm andyour-api-secret
to sign the string, generating a hexadecimal string signature.- The
gx-signature
field value should be formatted ast=timestamp,v=signature
.Content-Type string Required
- Must be set to application/json.
Responses
- response.data
{
maxDurationSeconds: 60,
totalCreditQuota: 95,
creditsUsed: 0,
userId: 'a6f434b6-a475-40b1-81e3-3ce9868945ff',
createdAt: '2024-06-01T16:47:17.054Z',
updatedAt: '2024-06-08T11:46:15.594Z'
}
maxDurationSeconds integer
- The maximum duration (in seconds) allowed for each API session.
totalCreditQuota integer
- The total amount of credits allocated to the user. This quota represents the maximum credits that can be used by the user.
creditsUsed integer
- The amount of credits that have already been used by the user.
userId string
createdAt string
updatedAt string