Auto-refill
PUTapi.dizo.ai/v1/billing/auto-refillFree
When balance falls below a threshold, automatically buy a fixed dollar amount of credits.
Refills are priced at the tier for amount_usd and never exceed the monthly cap.
Cost: Free. Charged never.
Parameters
| Name | Type | Description |
|---|---|---|
| enabledrequired | boolean | Turn refill on or off. |
| threshold_credits | integer | Refill when balance drops below this. |
| amount_usd | number | Amount to charge per refill (min 10). |
Example
{
"enabled": true,
"threshold_credits": 5000,
"amount_usd": 500
}{
"auto_refill": {
"enabled": true,
"threshold_credits": 5000,
"amount_usd": 500,
"rate_usd": 0.021
}
}curl -X PUT https://api.dizo.ai/v1/billing/auto-refill \
-H "Authorization: Bearer $DIZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"threshold_credits":5000,"amount_usd":500}'import os, requests
r = requests.put(
"https://api.dizo.ai/v1/billing/auto-refill",
headers={"Authorization": f"Bearer {os.environ['DIZO_API_KEY']}"},
json={"enabled":true,"threshold_credits":5000,"amount_usd":500},
)
print(r.json(), r.headers["x-dizo-credits-used"])const r = await fetch("https://api.dizo.ai/v1/billing/auto-refill", {
method: "PUT",
headers: { Authorization: `Bearer ${process.env.DIZO_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({"enabled":true,"threshold_credits":5000,"amount_usd":500}),
});
console.log(await r.json(), r.headers.get("x-dizo-credits-used"));Errors follow the standard error shape. Add "dry_run": true for a free quote and "max_credits" to cap spend. Agents: this page is also at /docs/billing-refill.md.