> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

The `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.

> [!TIP]
>
> Paste your API key into the authorization field. To get an API key, [create an account](https://brightdata.com/?hs_signup=1\&utm_source=docs\&utm_campaign=playground) and learn [how to generate an API key](https://docs.brightdata.com/api-reference/authentication.md#how-do-i-generate-a-new-api-key%3F).

## 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](https://docs.brightdata.com/api-reference/authentication.md#what-permissions-level-does-an-api-key-have) have it. Without it, the endpoint returns HTTP 403 with a plain-text message. Manage API key permissions in [Account settings](https://brightdata.com/cp/setting/users).

## How do I turn on regular auto-recharge?

Send `enabled: true` with a `pmethod_id` and an `amount`:

1. Get a payment method ID where `autorecharge_supported` is `true` from [`GET /billing/pmethods`](https://docs.brightdata.com/api-reference/account-management-api/Get_payment_methods).
2. Get the allowed amount range from `regular.limits` in [`GET /billing/autorecharge`](https://docs.brightdata.com/api-reference/account-management-api/Get_auto_recharge_settings).
3. Send the request:

```bash theme={null}
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}'
```

The response returns the new regular auto-recharge settings, including `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`

For example, with `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 returns `amount_too_low`
* At most `limits.max_amount`, which depends on the company type and can be changed per account. Otherwise the endpoint returns `amount_too_high`

Read `limits.min_amount` and `limits.max_amount` for your account from [`GET /billing/autorecharge`](https://docs.brightdata.com/api-reference/account-management-api/Get_auto_recharge_settings).

## How do I turn off regular auto-recharge?

Send `enabled: false` and no other field:

```bash theme={null}
curl -X PUT "https://api.brightdata.com/billing/autorecharge/regular" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'
```

Turning auto-recharge off is always allowed, also when `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, send `enabled: true` with the current `pmethod_id` and the new `amount`.

## Which errors can this endpoint return?

HTTP 400 and the `not_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` |

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.

## Related endpoints

* [Get auto-recharge settings](https://docs.brightdata.com/api-reference/account-management-api/Get_auto_recharge_settings.md). Current settings and amount limits.
* [Get payment methods](https://docs.brightdata.com/api-reference/account-management-api/Get_payment_methods.md). Payment method IDs and auto-recharge support.
* [Set dataset auto-recharge](https://docs.brightdata.com/api-reference/account-management-api/Set_dataset_auto_recharge.md). Turn dataset auto-recharge on or off.


## OpenAPI

````yaml api-reference/openapi PUT /billing/autorecharge/regular
openapi: 3.0.1
info:
  title: Bright Data API
  description: >-
    Integrate Bright Data APIs to your pipeline and secure high-end scraping
    precision
  version: 1.0.0
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /billing/autorecharge/regular:
    put:
      description: >-
        Enable, change or disable regular auto-recharge. Requires the
        `billing.write.pay.settings` permission.


        The body holds all the settings for the regular section, and PUT is
        idempotent. The dataset section does not change.


        `{"enabled": false}` disables regular auto-recharge and is always
        allowed, also when `available` is `false`. To enable auto-recharge
        again, send `pmethod_id` and `amount`.


        A charge starts when the available balance drops below ceil(`amount` /
        4). Above a zero balance the charge is exactly `amount`. At a zero or
        negative balance the charge is `amount` × ceil(debt / `amount`), at most
        10 × `amount`.
      operationId: setRegularAutoRecharge
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/BillingRegularEnable'
                - $ref: '#/components/schemas/BillingDisable'
            examples:
              enable:
                summary: Enable
                value:
                  enabled: true
                  pmethod_id: 64f0c2a1e4b0a1b2c3d4e5f6
                  amount: 200
              disable:
                summary: Disable
                value:
                  enabled: false
      responses:
        '200':
          description: New regular auto-recharge settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingAutoRechargeRegular'
        '400':
          description: >-
            Bad request. `error_code` values:


            - `invalid_param`: wrong type, unknown field, `pmethod_id` or
            `amount` missing with `enabled: true`, or `pmethod_id` or `amount`
            sent with `enabled: false`.

            - `amount_too_low`: "Amount should be at least $<min>".

            - `amount_too_high`: "Amount should be at most $<max>".

            - `amount_not_whole`: "Amount must be rounded".

            - `pmethod_not_found`: no active payment method with this ID in the
            account.

            - `pmethod_not_supported`: the payment method does not support
            auto-recharge or is not confirmed.

            - `payment_required`: the account has no completed payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingError'
              example:
                error: Amount should be at least $50
                error_code: amount_too_low
        '401':
          description: Authentication failed
          content:
            text/plain:
              schema:
                type: string
              example: User authentication is required
        '403':
          description: >-
            `text/plain`: the API key lacks the `billing.write.pay.settings`
            permission. `application/json` with `error_code` `not_eligible`:
            auto-recharge is not available for the account (`available: false`)
            and the request has `enabled: true`.
          content:
            text/plain:
              schema:
                type: string
              example: >-
                Your API key lacks the required permissions for this action. You
                can change your token permissions at
                https://brightdata.com/cp/setting/users
            application/json:
              schema:
                $ref: '#/components/schemas/BillingError'
              example:
                error: Autocharge is not available for this account
                error_code: not_eligible
        '429':
          description: Rate limit exceeded (1,000 requests per minute, 5,000 per hour)
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    BillingRegularEnable:
      title: Enable
      type: object
      required:
        - enabled
        - pmethod_id
        - amount
      additionalProperties: false
      properties:
        enabled:
          type: boolean
          enum:
            - true
        pmethod_id:
          type: string
          description: Payment method ID from `GET /billing/pmethods`.
          example: 64f0c2a1e4b0a1b2c3d4e5f6
        amount:
          type: integer
          description: >-
            Charge amount in USD, whole dollars, between `limits.min_amount` and
            `limits.max_amount`.
          example: 200
    BillingDisable:
      title: Disable
      type: object
      required:
        - enabled
      additionalProperties: false
      properties:
        enabled:
          type: boolean
          enum:
            - false
    BillingAutoRechargeRegular:
      type: object
      required:
        - available
        - enabled
        - pmethod_id
        - amount
        - threshold
        - limits
      properties:
        available:
          type: boolean
          description: >-
            `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.
        enabled:
          type: boolean
          description: '`true` when auto-recharge is enabled for this section.'
        pmethod_id:
          type: string
          nullable: true
          description: Payment method used for auto-recharge. `null` if disabled.
        amount:
          type: integer
          nullable: true
          description: Charge amount, in USD. `null` if disabled.
        threshold:
          type: number
          nullable: true
          readOnly: true
          description: >-
            Balance level that starts a charge: a charge starts when the
            available balance drops below ceil(`amount` / 4). `null` if
            disabled. Read-only.
        limits:
          type: object
          description: Amount limits of the account.
          required:
            - min_amount
            - max_amount
          properties:
            min_amount:
              type: integer
              description: Minimum amount, in USD. $50 for all accounts.
            max_amount:
              type: integer
              description: >-
                Maximum amount, in USD. Depends on the company type and can be
                changed per account.
    BillingError:
      type: object
      required:
        - error
        - error_code
      properties:
        error:
          type: string
          description: Human-readable message
        error_code:
          type: string
          enum:
            - invalid_param
            - amount_too_low
            - amount_too_high
            - amount_not_whole
            - pmethod_not_found
            - pmethod_not_supported
            - payment_required
            - not_eligible
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use your Bright Data API Key as a Bearer token in the Authorization
        header.


        **How to authenticate:**

        1. Obtain your API Key from the Bright Data account settings at
        https://brightdata.com/cp/setting/users

        2. Include the API Key in the Authorization header of your requests

        3. 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
      bearerFormat: API Key

````