Skip to main content
POST
/
credits
/
settings
Update Credit Settings
curl --request POST \
  --url https://api.example.com/credits/settings
Enable, disable, or update auto top-up settings for your organization. When enabled, credits are automatically purchased at your plan’s top-up rate whenever your balance drops below the threshold. Requires a Creator or Professional plan. Returns 403 if no eligible plan is active.

Request

curl -X POST "https://api.mosaic.so/credits/settings" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_topup": {
      "enabled": true,
      "threshold": 1000,
      "quantity": 5000
    }
  }'

Body Parameters

FieldTypeRequiredDescription
auto_topup.enabledbooleanYesEnable or disable auto top-ups.
auto_topup.thresholdnumberYesCredit balance threshold that triggers an auto top-up (01,000,000).
auto_topup.quantitynumberYesNumber of credits to purchase per auto top-up (01,000,000).

Response

Returns the updated settings.
{
  "auto_topup": {
    "enabled": true,
    "threshold": 1000,
    "quantity": 5000
  }
}

Errors

StatusReason
403No active paid plan, or plan is not eligible for auto top-ups (requires Creator or Professional).

Examples

Enable auto top-up

curl -X POST "https://api.mosaic.so/credits/settings" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_topup": {
      "enabled": true,
      "threshold": 500,
      "quantity": 2000
    }
  }'

Disable auto top-up

curl -X POST "https://api.mosaic.so/credits/settings" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_topup": {
      "enabled": false,
      "threshold": 0,
      "quantity": 0
    }
  }'