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

# Update Spending Caps

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

## Request

- Base URL: `https://api.mixpeek.com`
- URL: `https://api.mixpeek.com/v1/organizations/billing/spending-caps`
- Auth: HTTP bearer

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`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error
- `503`: Service Unavailable

## Changes

- **2026-10-09** `61a175e8eb9a`: 1 warning, 5 info
  - removed the optional property `detail` from the response with the `422` status
  - added the non-success response with the status `429`
  - added the non-success response with the status `503`
  - added the optional property `success` to the response with the `422` status
  - …2 more
- **2026-08-09** `5d4c905106b4`: 1 info
  - the endpoint scheme security `BearerAuth` was added to the API

[Operation history](https://skmtc.dev/mixpeek/apis/mixpeek-api/changes/v1/organizations/billing/spending-caps/post.md)

---

[API](https://skmtc.dev/mixpeek/apis/mixpeek-api.md) - [All operations](https://skmtc.dev/mixpeek/apis/mixpeek-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mixpeek/apis/mixpeek-api/revisions/790bc16455f6?raw)
