v1

latestOpenAPI 3.1.02026-07-13897404.3 KB
Instances

prepay instance

Deposit credits into a reserved instance to receive usage discounts. The discount rate is calculated based on how many months of usage the prepaid amount covers. Maximum discount is typically 40%.

CLI Usage: vastai prepay instance <id> <amount>

put/api/v0/instances/prepay/{id}/

Path parameters

idinteger required

ID of the instance to prepay for

Request body

amountnumber float required

Amount of credits to prepay

Example request

{
  "amount": 500
}

Response

Successfully applied prepayment

successboolean
timescalenumber float

Number of months the prepayment will cover

discount_ratenumber float

Applied discount rate (0.0-0.4)

Example response

{
  "success": true,
  "timescale": 3.5,
  "discount_rate": 0.3
}