Skip to main content
POST
/
v1
/
organizations
/
billing
/
spending-caps
Update Spending Caps
curl --request POST \
  --url https://api.mixpeek.com/v1/organizations/billing/spending-caps \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "monthly_spending_budget": 10000,
  "spending_alert_thresholds": [
    50,
    75,
    90,
    100
  ],
  "spending_alerts_enabled": true,
  "hard_spending_cap": 50000,
  "hard_cap_enabled": true
}
'
{
  "current_spending_cents": 123,
  "current_spending_usd": 123,
  "monthly_spending_budget": 10000,
  "monthly_spending_budget_usd": 100,
  "spending_alert_thresholds": [
    123
  ],
  "spending_alerts_enabled": true,
  "spending_alerts_sent": [
    123
  ],
  "hard_spending_cap": 50000,
  "hard_spending_cap_usd": 500,
  "hard_cap_enabled": false,
  "budget_percentage_used": 46.9
}

Headers

Authorization
string
required

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Body

application/json

Spending cap configuration

monthly_spending_budget
integer | null

Soft spending limit in USD cents. Triggers alerts but doesn't block API access. Set to null to remove budget limit.

Required range: x >= 0
Example:

10000

spending_alert_thresholds
integer[] | null

Percentage thresholds for spending alerts (0-100). When current spending reaches each threshold, an alert is sent.

Example:
[50, 75, 90, 100]
spending_alerts_enabled
boolean | null

Whether to send spending alerts when thresholds are crossed.

hard_spending_cap
integer | null

Hard spending limit in USD cents. When reached, API access is blocked. Set to null to remove hard cap.

Required range: x >= 0
Example:

50000

hard_cap_enabled
boolean | null

Whether to enforce the hard spending cap.

Response

Successful Response

Response with spending cap configuration.

current_spending_cents
integer
required

Current spending in current billing cycle (cents)

current_spending_usd
number
required

Current spending in current billing cycle (USD)

monthly_spending_budget
integer | null

Soft spending limit in USD cents (null = unlimited)

Example:

10000

monthly_spending_budget_usd
number | null

Soft spending limit in USD

Example:

100

spending_alert_thresholds
integer[]

Percentage thresholds for spending alerts

spending_alerts_enabled
boolean
default:true

Whether spending alerts are enabled

spending_alerts_sent
integer[]

Alert thresholds triggered in current billing cycle

hard_spending_cap
integer | null

Hard spending limit in USD cents (null = no hard cap)

Example:

50000

hard_spending_cap_usd
number | null

Hard spending limit in USD

Example:

500

hard_cap_enabled
boolean
default:false

Whether hard spending cap is enforced

budget_percentage_used
number | null

Percentage of budget used (null if no budget set)

Example:

46.9