# Keep agents running without watching the balance.

> When your Dizo balance drops below a threshold, charge a set amount priced at that amount's tier. Refills never exceed your monthly spend cap.

Pick a threshold in credits and a refill amount in dollars. When the balance dips below it, Dizo refills at the tier for that amount, and never past your monthly spend cap.

## Highlights
- **Threshold and amount.** Set `threshold_credits` and `amount_usd` (minimum $10) with `PUT /v1/billing/auto-refill`.
- **Priced by refill size.** A $500 refill is **$0.021** per credit; a $2,000 refill is **$0.017**.
- **Never over the cap.** A refill that would cross the monthly cap is skipped, with an alert.
- **Alert on every refill.** Email and webhook notices on each refill, plus the `billing.refilled` event.
- **Humans only.** Changing refills needs `billing:write`. Lock billing so no API key can change it.
- **12-month credits.** Credits last 12 months from purchase, and the oldest are spent first.

## Steps
1. **Estimate usage** — Work out credits per day from your jobs and `GET /v1/billing`.
2. **Pick a refill amount** — Larger amounts buy cheaper credits. Match it to cash flow.
3. **Set a threshold** — Cover at least your biggest normal job, with a clear gap below the refill size.
4. **Pair with a cap** — Set a monthly spend cap with room for the refills you expect.

## APIs used
| API | Endpoint | Credits | Charged | Reference |
|---|---|---|---|---|
| Auto-refill | `PUT /v1/billing/auto-refill` | Free | Never | [docs](https://dizo.ai/docs/billing-refill.md) |
| Balance & usage | `GET /v1/billing` | Free | Never | [docs](https://dizo.ai/docs/billing.md) |
| Spend limits | `PUT /v1/billing/limits` | Free | Never | [docs](https://dizo.ai/docs/billing-limits.md) |
| Top up | `POST /v1/billing/topup` | Free (charges card on file) | Never | [docs](https://dizo.ai/docs/billing-topup.md) |
| Pricing | `GET /v1/pricing` | Free, no auth | Never | [docs](https://dizo.ai/docs/pricing.md) |


## Why prepaid credits need a refill

Prepaid credits are a good fit for usage-based data. You buy what you need, the price per credit drops as purchases get larger, and nothing renews behind your back. The weak point is the moment the balance hits zero. A nightly enrichment job fails halfway through, an agent stops mid-task, and someone has to notice, log in and top up before work can resume.

Auto-refill removes that moment without removing control. You choose a threshold in credits and a dollar amount. When the balance falls below the threshold, Dizo charges that amount and adds the credits. The refill is priced at the tier for the amount you chose, so a larger refill buys cheaper credits, and it never exceeds your monthly spend cap. It is optional and off until you turn it on.

## How it works

Auto-refill is configured with `PUT /v1/billing/auto-refill`, or in the console. The request has three fields. `enabled` turns it on or off and is required. `threshold_credits` is the balance below which a refill is triggered. `amount_usd` is the amount charged per refill, with a minimum of $10. The call itself is free.

The [auto-refill docs](/docs/billing-refill) show a typical setup: enabled, a threshold of 5,000 credits and an amount of $500. The response echoes those settings and adds `rate_usd` of 0.021, the per-credit price for a $500 purchase. That rate is the key detail. The price per credit is set by the size of each single purchase or refill, so the refill amount you pick decides the rate you pay on every credit it buys.

Refills use the payment method saved on the account. Every refill triggers an alert, and the `billing.refilled` webhook event lets your own systems record it.

## What each refill size buys

Because the tier follows the refill amount, the same habit of usage costs different amounts depending on how you refill. Here is what a single refill adds at each published tier, rounded down to whole credits. The $2,000 figure matches the top-up docs, which show 117,647 credits added at $0.017.

- **$10 (minimum):** 400 credits at $0.025.
- **$100:** 4,000 credits at $0.025.
- **$500:** about 23,809 credits at $0.021, the Builder tier.
- **$2,000:** 117,647 credits at $0.017, the Growth tier.
- **$10,000:** about 769,230 credits at $0.013, the Scale tier.
- **$50,000:** 5,000,000 credits at $0.010, the Enterprise tier.

## A worked example

Suppose an outbound agent and a CRM workflow together use about 3,000 credits a day, or roughly 90,000 a month. With a threshold of 5,000 credits and $500 refills, each refill adds about 23,809 credits and lasts just under eight days. The month needs about 3.8 refills, and the 90,000 credits cost about $1,890 at $0.021.

Now change only the refill amount to $2,000. Each refill adds 117,647 credits at $0.017, enough for about 39 days. Over a month, the same 90,000 credits cost about $1,530, a saving of roughly $360, in exchange for paying more up front each time. Credits are valid for 12 months from the purchase they came from, and the oldest credits are spent first, so a larger refill does not put credits at short-term risk for a team with steady usage.

The right trade depends on cash flow and how predictable your usage is. Steady consumers save by refilling larger; spiky or experimental usage is better served by smaller refills.

## Choosing a threshold

The threshold is your buffer. Set it high enough that work in flight does not run dry while a refill is processed. A practical rule is to cover at least your biggest normal job. If your biggest batch quotes a `credits_max` of 10,000, a threshold below that means a single batch can drain the balance before the refill catches up. A threshold of a day or two of typical usage is another sensible floor.

The threshold should not be so high that refills trigger constantly. If the threshold is close to the refill size, the balance will hover just above the threshold and you will refill more often than you need. Leave a clear gap: with $500 refills adding about 23,809 credits, a threshold of 5,000 means each refill restores the balance to roughly 28,800 credits.

`GET /v1/billing` returns the current balance and refill settings, which makes it easy to check the setup against real usage after the first few weeks.

## How refills interact with the monthly cap

Auto-refill never exceeds the [monthly spend cap](/features/monthly-spend-cap). The cap is a hard dollar ceiling per calendar month, and refills count toward it. If a refill would push the month past the cap, the refill is skipped, you get an alert, and calls stop with `402 monthly_cap_reached` once the remaining balance runs out.

That makes the two settings work as a pair. Auto-refill keeps work running smoothly; the cap makes sure that smooth running has a ceiling. When you set them, check that the cap leaves room for the refills your forecast needs. With $2,000 refills, a cap close to $2,000 leaves little room for a second refill in a busy month. With $500 refills, the same cap can absorb several.

Alerts at 50%, 80% and 100% of the cap, plus one on every refill, keep finance informed without anyone watching a dashboard.

## Who can change refill settings

Changing auto-refill requires a key with the `billing:write` scope. Keys are read-only for billing by default, and the account owner can set `locked: true` on the limits endpoint so that no API key can change billing settings at all. Billing changes are recorded in an audit log.

Agents should never touch refills on their own. Dizo's agent rules say never to call billing write endpoints, including auto-refill, top-up, limits and keys, without explicit human approval in the conversation. Refill settings are not exposed as an MCP tool, and agents can still read balance and refill settings safely through `dizo_balance`. The simplest policy is to give agents `data:read` keys and keep billing locked, so refill settings only change when a person decides they should.

## Tracking refills in your own systems

Refills are purchases, so finance will want them recorded. Register a [webhook](/docs/webhooks) for `billing.refilled` and `billing.low_balance`, and your handler receives a signed event each time. Every delivery carries a `Dizo-Signature` header computed with HMAC-SHA256 over the timestamp and body, and failed deliveries are retried with backoff for 24 hours. Verify the signature, then write the event to your ledger or post it to the team that owns the budget.

The low-balance event is useful even with refills on. If it arrives and no refill follows, something has stopped the refill, most often the monthly cap. That is the moment to decide whether to raise the cap or let work pause, rather than discovering it when jobs start returning 402.

If a refill turns out to be larger than you needed, for example because a planned campaign was cancelled, unused credits from your most recent purchase can be refunded within 14 days. Credits from older purchases stay in the balance, valid for 12 months from the purchase they came from.

## When auto-refill is not the right choice

If your usage is occasional, such as a one-off list build or a quarterly enrichment run, a manual top-up is simpler. Buy what the job needs, at the tier for that amount, and leave refills off. If you want spend to stop completely when a balance runs out, for example during a pilot, leave refills off and let the balance be the limit.

Large buyers may prefer contracts to refills. Purchases of $50,000 or more get $0.010 per credit automatically, invoicing is available on purchases of $10,000 or more, and annual commitments above $100,000 can get custom rates through the [enterprise](/enterprise) team. Payment can be by card, ACH or wire.

Work email signups get 250 free credits, no card required. [Sign up](/signup), and see the full tier table on the [pricing page](/pricing).

## FAQ

### How does auto-refill work?
When your balance falls below `threshold_credits`, Dizo charges `amount_usd` to your saved payment method and adds the credits. You configure it with `PUT /v1/billing/auto-refill`.

### What price do refilled credits cost?
The tier for the refill amount. A $500 refill is priced at $0.021 per credit and a $2,000 refill at $0.017. The response shows the rate as `rate_usd`.

### Can auto-refill exceed my monthly cap?
No. If a refill would push the month past the cap, it is skipped and you get an alert. Calls stop with `402 monthly_cap_reached` once the balance runs out.

### What is the minimum refill?
$10, the same as the minimum top-up. At $0.025 per credit that adds 400 credits.

### Should I use auto-refill or manual top-ups?
Use auto-refill for steady, ongoing usage such as agents and nightly jobs, so work never stops on an empty balance. Use manual top-ups through `POST /v1/billing/topup` for occasional projects where you want the balance itself to be the limit.

### Do refilled credits expire?
Credits are valid for 12 months from the purchase they came from, and your oldest credits are spent first.

### Can my agent turn auto-refill on or change it?
Only with a key that has `billing:write`, and Dizo's agent rules require explicit human approval first. Lock billing and no API key can change it.
