curl --request PUT \
--url https://api.brightdata.com/billing/autorecharge/regular \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"pmethod_id": "64f0c2a1e4b0a1b2c3d4e5f6",
"amount": 200
}
'{
"available": true,
"enabled": true,
"pmethod_id": "<string>",
"amount": 123,
"threshold": 123,
"limits": {
"min_amount": 123,
"max_amount": 123
}
}{
"error": "Amount should be at least $50",
"error_code": "amount_too_low"
}User authentication is requiredYour API key lacks the required permissions for this action. You can change your token permissions at https://brightdata.com/cp/setting/users<string>Account & status
Set regular auto-recharge
Use PUT /billing/autorecharge/regular in the Bright Data Account Management API to set the regular auto-recharge amount and payment method, or turn it off.
PUT
/
billing
/
autorecharge
/
regular
curl --request PUT \
--url https://api.brightdata.com/billing/autorecharge/regular \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"pmethod_id": "64f0c2a1e4b0a1b2c3d4e5f6",
"amount": 200
}
'{
"available": true,
"enabled": true,
"pmethod_id": "<string>",
"amount": 123,
"threshold": 123,
"limits": {
"min_amount": 123,
"max_amount": 123
}
}{
"error": "Amount should be at least $50",
"error_code": "amount_too_low"
}User authentication is requiredYour API key lacks the required permissions for this action. You can change your token permissions at https://brightdata.com/cp/setting/users<string>The
The response returns the new regular auto-recharge settings, including
Turning auto-recharge off is always allowed, also when
HTTP 401, the permission HTTP 403 and HTTP 429 return plain text. The billing endpoints allow 1,000 requests per minute and 5,000 requests per hour.
PUT /billing/autorecharge/regular endpoint turns regular auto-recharge on or off on your Bright Data account, and sets the payment method and amount it charges. The dataset auto-recharge settings do not change.
Paste your API key into the authorization field. To get an API key, create an account and learn how to generate an API key.
Which API key permission does this endpoint need?
PUT /billing/autorecharge/regular requires the billing.write.pay.settings permission. API keys with the Admin or Finance permission level have it. Without it, the endpoint returns HTTP 403 with a plain-text message. Manage API key permissions in Account settings.
How do I turn on regular auto-recharge?
Sendenabled: true with a pmethod_id and an amount:
- Get a payment method ID where
autorecharge_supportedistruefromGET /billing/pmethods. - Get the allowed amount range from
regular.limitsinGET /billing/autorecharge. - Send the request:
curl -X PUT "https://api.brightdata.com/billing/autorecharge/regular" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "pmethod_id": "64f0c2a1e4b0a1b2c3d4e5f6", "amount": 200}'
threshold.
How much does regular auto-recharge charge?
A charge starts when the available balance drops below ceil(amount / 4). Regular auto-recharge never tops the balance up to a target level. The charge depends on the balance at that moment:
- Balance above zero: the charge is exactly
amount - Balance at zero or below: the charge is
amount× ceil(debt /amount), at most 10 ×amount
amount set to 200, a charge starts when the available balance drops below $50:
| Available balance | Charge |
|---|---|
| $30 | $200 |
| -$450 | $600 (200 × ceil(450 / 200)) |
| -$5,000 | $2,000 (capped at 10 × 200) |
What are the rules for the amount?
amount is in USD and must be:
- A whole number of dollars. Otherwise the endpoint returns
amount_not_whole - At least
limits.min_amount, which is $50 for all accounts. Otherwise the endpoint returnsamount_too_low - At most
limits.max_amount, which depends on the company type and can be changed per account. Otherwise the endpoint returnsamount_too_high
limits.min_amount and limits.max_amount for your account from GET /billing/autorecharge.
How do I turn off regular auto-recharge?
Sendenabled: false and no other field:
curl -X PUT "https://api.brightdata.com/billing/autorecharge/regular" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
available is false. Turning off regular auto-recharge does not turn off dataset auto-recharge. Sending pmethod_id or amount with enabled: false returns invalid_param.
How does PUT update the settings?
The request body holds all the settings for the regular section, and the request is idempotent. Sending the same body twice leaves the same settings. To change only the amount, sendenabled: true with the current pmethod_id and the new amount.
Which errors can this endpoint return?
HTTP 400 and thenot_eligible HTTP 403 return JSON with error and error_code:
| HTTP status | error_code | Cause |
|---|---|---|
| 400 | invalid_param | Wrong type, unknown field, pmethod_id or amount missing with enabled: true, or sent with enabled: false |
| 400 | amount_too_low | amount is below limits.min_amount |
| 400 | amount_too_high | amount is above limits.max_amount |
| 400 | amount_not_whole | amount is not a whole number of dollars |
| 400 | pmethod_not_found | No active payment method with this ID on the account |
| 400 | pmethod_not_supported | The payment method does not support auto-recharge or is not confirmed |
| 400 | payment_required | The account has no completed payment |
| 403 | not_eligible | Auto-recharge is not available for the account (available: false) and the request has enabled: true |
Related endpoints
- Get auto-recharge settings. Current settings and amount limits.
- Get payment methods. Payment method IDs and auto-recharge support.
- Set dataset auto-recharge. Turn dataset auto-recharge on or off.
Authorizations
Use your Bright Data API Key as a Bearer token in the Authorization header.
How to authenticate:
- Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df
Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication
Body
application/json
Response
New regular auto-recharge settings
true when regular auto-recharge is available for the account and the account has a payment method that supports auto-recharge. false for AWS Marketplace organic accounts, IBM accounts and accounts with no payment method that supports auto-recharge or with all such payment methods blocked.
Was this page helpful?