Get Credit Balance
const url = 'https://example.com/v1/credits';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/credits \ --header 'X-API-Key: <X-API-Key>'Get your current credit balance.
Returns the total available credits that can be used for finetune jobs. Credits are consumed when running finetune jobs based on instance hourly rates.
Next to the total, the split the dashboard’s billing page shows: starter credits, prepaid bundles and each voucher, left and granted. The split is the account members’ to read; it is null when it cannot be read.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Credit balance retrieved successfully
Response containing user’s credit balance.
object
Total available credits
Starter credits left; null when the split is unreadable
Starter credits granted
Prepaid credits left
Prepaid credits bought
When prepaid credits were last bought, ISO 8601
Redeemed vouchers with credits left, soonest to expire first
One redeemed voucher that still has credits.
object
The voucher’s label, if it has one
Credits left on it
Credits it granted
When it expires, ISO 8601
Example generated
{ "balance": 1, "grant_balance": 1, "grant_original_balance": 1, "bundle_balance": 1, "bundle_original_balance": 1, "bundle_last_top_up": "example", "vouchers": [ { "label": "example", "balance": 1, "original_balance": 1, "expires_at": "example" } ]}Invalid or missing API key
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}