---
title: "Set Auto Refill"
method: PUT
path: "/api/billing/ai-balance/auto-refill"
tags: ["billing"]
---

# Set Auto Refill

`PUT /api/billing/ai-balance/auto-refill`

## Request

- Base URL: `https://softkiln.com` (the document declares no server; this is the origin it was published from)
- URL: `https://softkiln.com/api/billing/ai-balance/auto-refill`
- Auth: none declared

Turn automatic refill on or off and set its amount and trigger point.

The threshold is a floor on AVAILABLE credit, not on the balance, and it is
what keeps a customer's app from ever seeing a 402: the refill fires while
there is still credit left to spend rather than after it has run out.

## Query parameters

- `org` string, nullable

## Request body

- AutoRefillRequest
  - `enabled` boolean, required
  - `amount_microcents` integer, nullable
  - `threshold_microcents` integer, nullable

## Response `200`

Successful Response

- AiBalanceOut
  - `balance_microcents` integer, required
  - `reserved_microcents` integer, required
  - `available_microcents` integer, required
  - `auto_refill_enabled` boolean, required
  - `low_balance_threshold_microcents` integer, nullable, required
  - `auto_refill_amount_microcents` integer, nullable, required
  - `has_payment_method` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/softkiln/apis/app-manager-api.md) · [All operations](https://skmtc.dev/softkiln/apis/app-manager-api/llms.txt) · [OpenAPI document](https://skmtc.dev/softkiln/apis/app-manager-api/revisions/de2b674a7f21?raw)
