> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulate.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Auto top-up

> Buy credits automatically when an organization's balance falls below a threshold. Setup, timing, the 6-hour limit, and what turns it off.

Auto top-up charges the organization's saved card for a fixed dollar amount whenever the credit balance falls below a threshold you set. It is configured on the [Billing page](https://platform.modulate.ai/dashboard/billing) in the dashboard.

Only **organization admins** can buy credits, save a card, or configure auto top-up. Organizations billed by invoice cannot turn it on.

## Set up auto top-up

<Steps>
  <Step title="Buy credits first">
    The threshold cannot be higher than the current balance, because that would trigger a purchase immediately. If the balance is already low, buy credits from **Buy Credits** on the Billing page before configuring auto top-up.
  </Step>

  <Step title="Save a card">
    In the **Payment Method** panel, select **Add Card** (or **Replace** to change an existing card). Stripe stores the card for future purchases. Modulate does not store card details.
  </Step>

  <Step title="Set the threshold and purchase amount">
    In the **Auto Top-Up** panel, select **Turn On**, then enter:

    * **When credits fall below**: the credit balance that triggers a purchase.
    * **Purchase amount (USD)**: the dollar amount charged on each purchase. **Credits added** shows how many credits that buys at the organization's current rate.
  </Step>

  <Step title="Turn it on">
    Select **Turn On Auto Top-Up**. Turning it on authorizes a charge of the purchase amount to the saved card each time the balance falls below the threshold.
  </Step>
</Steps>

Modulate cannot set up auto top-up on an organization's behalf, because Modulate does not hold the payment details.

## Settings

| Setting | Allowed values | Effect |
| - | - | - |
| Threshold | 1 credit up to the current balance | A purchase is made when the balance falls below this value. |
| Purchase amount | \$0.50 to \$1,000.00 | The dollar amount charged on each purchase. It stays fixed when the credit rate changes. |

Two checks apply when the settings are saved:

* **The purchase must clear the threshold.** Each purchase must add at least 110% of the threshold in credits at the current rate. With a threshold of 500 credits, a purchase must add at least 550 credits. This check runs only at save time; it is not repeated when the organization's credit rate changes later.
* **The threshold cannot exceed the balance.** This applies when turning auto top-up on and when changing the threshold while it is on.

## Timing

A purchase is not instant. Organizations are checked against their thresholds every 60 seconds, and the Stripe charge for an organization below its threshold can take a few more minutes to complete. Set the threshold high enough that the organization's usage will not consume it within about 5 minutes.

If the balance reaches zero before the purchase completes, requests are rejected with `429` `Insufficient credits.` (WebSocket close code `4029`) until the credits arrive. See [Authentication and rate limits](/guides/authentication#limits).

Auto top-up does not depend on API activity. A balance below the threshold triggers a purchase whether or not requests are being made.

## The 6-hour limit

Auto top-up makes **at most one purchase every 6 hours** per organization. This limits spending if usage, or a misconfiguration, drains credits faster than expected.

* Set the purchase amount high enough to cover at least 6 hours of usage. If the balance falls below the threshold again inside the window, no purchase is made until the window ends, and the purchase is then made at the next check.
* Saving the settings while auto top-up is on restarts the 6-hour window.
* A declined charge does not start the window.

The **Auto Top-Up** panel shows the time after which the next automatic purchase can happen.

## Credit rate

Each purchase converts the dollar amount to credits at the organization's credit rate at the time of purchase. Fractional credits are rounded up.

| Credit rate | Purchase amount | Credits added |
| - | - | - |
| \$1.00 per 100 credits (default) | \$10.00 | 1,000 |
| \$0.95 per 100 credits | \$10.00 | 1,053 |

A contract that changes the rate changes the credits each purchase adds. The purchase amount does not change.

## Turn off auto top-up

Open the **Auto Top-Up** panel, select **Manage**, then **Turn Off**. Turning it off is never refused. A purchase that is already being charged can still complete after it is turned off.

Auto top-up also turns itself off in these cases. The panel then shows **Turned off** with the reason:

| Cause | Fix |
| - | - |
| The saved card was removed | Add a card, then turn auto top-up back on. |
| The card was declined in a way a retry cannot fix, such as an expired card | Replace the card, then turn auto top-up back on. |
| The bank requires verification of each payment | Replace the card with one that does not, then turn auto top-up back on. |
| Repeated charges failed | Replace the card, or turn auto top-up back on. |
| A recent charge is under review by Modulate support | Turn auto top-up back on. |
| Modulate support turned it off | Turn auto top-up back on. |

Modulate support can turn auto top-up off for an organization, but cannot turn it on.

## Related

* [Authentication and rate limits](/guides/authentication)
* [Support](/support)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.