# Get billing settings

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read balance alerts, spending limits, and automatic recharge settings for an account.

```text
GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/settings
```

## Before you begin

1. Prepare a valid [personal access token](../../../../../guides/billing/credentials.md#personal-access-token) for the account owner.
2. Call [List current accounts](current.md) to obtain the target account’s ID.

## Request example

Replace `$MOI_PERSONAL_ACCESS_TOKEN` and `$ACCOUNT_ID` in the example with your personal access token and the selected account’s ID.

```bash
curl -X GET \
  "https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/settings" \
  -H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
```

## Path parameters

::::{div} mo-api-parameter-table

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `accountID` | string | Yes | Target account ID from `items[].billing_account_id` in the List current accounts response. |

::::

## Successful response

Returns HTTP `200` with the account’s current billing settings.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "billing_account_id": "billing_account_example",
  "balance_alert_enabled": false,
  "warning_threshold_credit": "10",
  "critical_threshold_credit": "5",
  "monthly_spend_limit_credit": "100",
  "pause_when_balance_zero": false,
  "new_account_rate_limit_enabled": false,
  "auto_recharge_enabled": false,
  "auto_recharge_mode": "notify_only",
  "auto_recharge_threshold_credit": "10",
  "auto_recharge_amount": "100.00",
  "auto_recharge_channel": "alipay",
  "auto_recharge_cooldown_hours": 24,
  "auto_recharge_monthly_limit_amount": "500.00",
  "notification_channels": [
    "email"
  ],
  "settings_version": 1,
  "updated_at": 1788739200
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `billing_account_id` | string | Billing account ID. |
| `balance_alert_enabled` | boolean | Whether balance alerts are enabled. |
| `warning_threshold_credit` | string | Balance warning threshold in Credit. |
| `critical_threshold_credit` | string | Critical balance threshold in Credit. |
| `monthly_spend_limit_credit` | string | Monthly spend limit in Credit. An empty string means no limit is configured. |
| `pause_when_balance_zero` | boolean | Whether usage is paused when the balance reaches zero. |
| `new_account_rate_limit_enabled` | boolean | Whether new-account rate limiting is enabled. |
| `auto_recharge_enabled` | boolean | Whether automatic recharge is enabled. |
| `auto_recharge_mode` | string | Automatic recharge mode. |
| `auto_recharge_threshold_credit` | string | Balance threshold for automatic recharge in Credit. |
| `auto_recharge_amount` | string | Payment amount per automatic recharge, in the account's default payment currency. |
| `auto_recharge_channel` | string | Automatic recharge channel. |
| `auto_recharge_authorization_id` | string | Payment authorization ID used for automatic recharge, when available. |
| `auto_recharge_cooldown_hours` | integer | Cooldown between automatic recharges in hours. |
| `auto_recharge_monthly_limit_amount` | string | Monthly automatic recharge payment limit, in the account's default payment currency. |
| `notification_channels` | array of string | Notification channels. |
| `settings_version` | integer | Settings version. |
| `updated_at` | integer | Update time in Unix seconds. |
| `updated_by` | string | User ID that last updated the settings, when available. |

:::::
::::::
:::::::

## Error response

Missing authentication returns HTTP `401`; provide a valid personal access token.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "unauthenticated",
  "message": "missing bearer token",
  "error": "missing bearer token"
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Error code. |
| `message` | string | Error message. |
| `error` | string | Compatibility error message, with the same content as message. |

:::::
::::::
:::::::
