Skip to main content
PUT
/
api
/
v1
/
billing
/
auto-topup
Update auto top-up configuration
curl --request PUT \
  --url http://localhost:3051/api/v1/billing/auto-topup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enabled": true,
  "threshold_usd": "<unknown>",
  "amount_usd": "<unknown>",
  "payment_method_id": "<string>"
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.omnifence.ai/llms.txt

Use this file to discover all available pages before exploring further.

Updates your auto top-up settings. Pass only the fields you want to change — others retain their current values. Requires the billing:write scope.

Enabling auto top-up

To set enabled: true, all three of threshold_usd, amount_usd, and payment_method_id must be present (either in this request or already on file). Additional rules:
  • threshold_usd must be strictly less than amount_usd — otherwise the top-up wouldn’t lift you above the threshold and would re-fire immediately.
  • payment_method_id must belong to your client (verified server-side).
  • Both amounts must be between 5and5 and 5000.
When you enable, the disabled_reason field is cleared.

Disabling

Pass enabled: false. Existing settings are preserved so you can re-enable later without re-entering them.

Errors

CodeWhen
400 INVALID_REQUESTthreshold_usd >= amount_usd, missing required fields when enabling, or payment_method_id doesn’t belong to your client.

Authorizations

Authorization
string
header
required

API key from the Stars dashboard

Body

application/json
enabled
boolean
threshold_usd
any
amount_usd
any
payment_method_id
string | null
Maximum string length: 64

Response

200

Default Response