---
title: "Configure automatic credit replenishment"
method: POST
path: "/api/v1/billing/auto-topup"
---

# Configure automatic credit replenishment

`POST /api/v1/billing/auto-topup`

## Request

- Base URL: `https://api.virga.dev`
- URL: `https://api.virga.dev/api/v1/billing/auto-topup`
- Auth: API key in header `X-API-Key`

Set up automatic credit top-up. When credit balance drops below the threshold during API usage, the saved payment method is charged automatically and credits are added. Requires billing activated.

## Request body

- object
  - `enabled` boolean, required: Enable or disable auto-topup
  - `threshold` number: Credit balance threshold that triggers auto-topup (required when enabled)
  - `bundle` '500' | '2000' | '10000': Bundle to purchase when threshold is reached (required when enabled)

## Response `200`

Auto-topup configured

- object
  - `message` string
  - `autoTopup` object
    - `enabled` boolean
    - `threshold` number
    - `bundle` string

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `403`: Account suspended, quarantined, or key revoked

---

[API](https://skmtc.dev/virga/apis/virga-api.md) · [All operations](https://skmtc.dev/virga/apis/virga-api/llms.txt) · [OpenAPI document](https://skmtc.dev/virga/apis/virga-api/revisions/5f5b639b1da3?raw)
