---
title: "Update auto-recharge settings."
method: POST
path: "/v1/billing/auto-recharge"
tags: ["billing"]
---

# Update auto-recharge settings.

`POST /v1/billing/auto-recharge`

## Request

- Base URL: `https://api.smolmachines.com`
- URL: `https://api.smolmachines.com/v1/billing/auto-recharge`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/smolmachines/apis/smolfleet-api/docs/v1/billing/auto-recharge/post.ts> (a function with typed inputs; its response is checked against the schema)

Updates opt-in auto-recharge; enabling with no saved card returns a setup URL. Requires the `billing:write` scope.

## Request body

- UpdateAutoRechargeRequest: Update opt-in auto-recharge (`POST /v1/billing/auto-recharge`). Omitted override fields reset to the fleet default (`null`).
  - `amountMicros` integer, nullable: Top-up amount in micros (`null` → fleet default). Must be `≥ $1` and `> threshold`.
  - `enabled` boolean, required: Master switch. Disabling never charges; enabling requires a saved card (the response returns a `setupUrl` to add one when none is on file yet).
  - `thresholdMicros` integer, nullable: Trigger threshold in micros (`null` → fleet default). Must be `< amount`.

## Response `200`

Updated auto-recharge settings. When enabling with no card on file, the response carries a setupUrl to add one.

- AutoRechargeSettings: Threshold/amount are the RESOLVED effective values (per-tenant override, else fleet default), so the UI can render exactly what will happen.
  - `amountMicros` integer, required: Amount (micros) charged to the saved card each recharge.
  - `enabled` boolean, required: Whether auto-recharge is enabled for this tenant.
  - `hasSavedCard` boolean, required: Whether a card is saved on file (auto-recharge cannot fire without one).
  - `setupUrl` string, nullable: When enabling without a saved card, a Stripe-hosted URL to add one. Absent once a card is on file (or on plain reads).
  - `thresholdMicros` integer, required: Balance (micros) at or below which a recharge fires.

## Other responses

- `401`: Missing or invalid API key
- `403`: Key lacks the required scope
- `429`: Rate limited; retry after the Retry-After header
- `500`: Internal error

## Changes

- **2026-10-16** `bc31fc04a568`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smolmachines/apis/smolfleet-api/changes/v1/billing/auto-recharge/post.md)

---

[API](https://skmtc.dev/smolmachines/apis/smolfleet-api.md) - [All operations](https://skmtc.dev/smolmachines/apis/smolfleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smolmachines/apis/smolfleet-api/revisions/bc31fc04a568?raw)
