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

# Update Credit Settings

> Configure auto top-ups for your organization's credits.

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 one of these active plans: `creator`, `creator_annual`, `professional`, or `professional_annual`. Returns `403` if no eligible plan is active.

To read current credit and auto top-up state, use `GET /credits`.

## Request

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

| Field                  | Type    | Required | Description                                                                |
| ---------------------- | ------- | -------- | -------------------------------------------------------------------------- |
| `auto_topup.enabled`   | boolean | Yes      | Enable or disable auto top-ups.                                            |
| `auto_topup.threshold` | number  | Yes      | Credit balance threshold that triggers an auto top-up (`0` – `1,000,000`). |
| `auto_topup.quantity`  | number  | Yes      | Number of credits to purchase per auto top-up (`0` – `1,000,000`).         |

## Response

Returns the updated settings.

```json theme={null}
{
  "auto_topup": {
    "enabled": true,
    "threshold": 1000,
    "quantity": 5000
  }
}
```

## Errors

| Status | Reason                                                                                                                                         |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `403`  | No active paid plan, or plan is not eligible for auto top-ups (must be `creator`, `creator_annual`, `professional`, or `professional_annual`). |

## Examples

### Enable auto top-up

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

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