---
title: "prepay instance"
method: PUT
path: "/api/v0/instances/prepay/{id}/"
tags: ["Instances"]
---

# prepay instance

`PUT /api/v0/instances/prepay/{id}/`

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>`

## Path parameters

- `id` integer, required

## Request body

- object
  - `amount` number, float, required — Amount of credits to prepay

## Response `200`

Successfully applied prepayment

- object
  - `success` boolean
  - `timescale` number, float — Number of months the prepayment will cover
  - `discount_rate` number, float — Applied discount rate (0.0-0.4)

## Other responses

- `400` — Invalid instance ID
- `411` — Insufficient credit balance
- `429` — Rate limit exceeded

---

[API](https://skmtc.net/vast/apis/vast-ai-api.md) · [All operations](https://skmtc.net/vast/apis/vast-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vast/vast-ai-api/revisions/4ed14f79f796/schema)
