---
title: "Update Spending Caps"
method: POST
path: "/v1/organizations/billing/spending-caps"
tags: ["Organization Billing"]
---

# Update Spending Caps

`POST /v1/organizations/billing/spending-caps`

Update spending cap configuration.

Configure spending limits and alert thresholds to control costs.

**Features:**
- **Soft Limit (Budget)**: Triggers alerts but doesn't block API access
- **Hard Cap**: Blocks API access when reached. Setting a positive
  `hard_spending_cap` arms enforcement automatically; pass
  `hard_cap_enabled: false` in the same request to set the cap without
  enforcing it. Clearing the cap (null/0) disarms enforcement.
- **Alert Thresholds**: Customize when to receive spending notifications

**Requirements:**
- Admin permission
- Only applies to organizations with auto-billing enabled

**Example:**
```python
# Set $100 budget with alerts at 75% and 100%
response = await client.post(
    "/v1/organizations/billing/spending-caps",
    json={
        "monthly_spending_budget": 10000,  # $100 in cents
        "spending_alert_thresholds": [75, 100],
        "spending_alerts_enabled": True,
    }
)

# Enable hard cap at $500
response = await client.post(
    "/v1/organizations/billing/spending-caps",
    json={
        "hard_spending_cap": 50000,  # $500 in cents
        "hard_cap_enabled": True,
    }
)

# Disable all spending limits
response = await client.post(
    "/v1/organizations/billing/spending-caps",
    json={
        "monthly_spending_budget": None,
        "hard_spending_cap": None,
        "hard_cap_enabled": False,
    }
)
```

## Request body

- UpdateSpendingCapsRequest — Request to update spending cap configuration.
  - `monthly_spending_budget` integer, nullable — Soft spending limit in USD cents. Triggers alerts but doesn't block API access. Set to null to remove budget limit.
  - `spending_alert_thresholds` integer[], nullable — Percentage thresholds for spending alerts (0-100). When current spending reaches each threshold, an alert is sent.
  - `spending_alerts_enabled` boolean, nullable — Whether to send spending alerts when thresholds are crossed.
  - `hard_spending_cap` integer, nullable — Hard spending limit in USD cents. When reached, API access is blocked. Set to null to remove hard cap.
  - `hard_cap_enabled` boolean, nullable — Whether to enforce the hard spending cap.

## Response `200`

Successful Response

- SpendingCapsResponse — Response with spending cap configuration.
  - `monthly_spending_budget` integer, nullable — Soft spending limit in USD cents (null = unlimited)
  - `monthly_spending_budget_usd` number, nullable — Soft spending limit in USD
  - `spending_alert_thresholds` integer[] — Percentage thresholds for spending alerts
  - `spending_alerts_enabled` boolean — Whether spending alerts are enabled
  - `spending_alerts_sent` integer[] — Alert thresholds triggered in current billing cycle
  - `hard_spending_cap` integer, nullable — Hard spending limit in USD cents (null = no hard cap)
  - `hard_spending_cap_usd` number, nullable — Hard spending limit in USD
  - `hard_cap_enabled` boolean — Whether hard spending cap is enforced
  - `current_spending_cents` integer, required — Current spending in current billing cycle (cents)
  - `current_spending_usd` number, required — Current spending in current billing cycle (USD)
  - `budget_percentage_used` number, nullable — Percentage of budget used (null if no budget set)

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/mixpeek/apis/mixpeek-api.md) · [All operations](https://skmtc.net/mixpeek/apis/mixpeek-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixpeek/mixpeek-api/revisions/04b379bdbb7c/schema)
