Update spending cap configuration.
Configure spending limits and alert thresholds to control costs.
Features:
Requirements:
Example:
# 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,
}
)
REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.
Spending cap configuration
Soft spending limit in USD cents. Triggers alerts but doesn't block API access. Set to null to remove budget limit.
x >= 010000
Percentage thresholds for spending alerts (0-100). When current spending reaches each threshold, an alert is sent.
[50, 75, 90, 100]Whether to send spending alerts when thresholds are crossed.
Hard spending limit in USD cents. When reached, API access is blocked. Set to null to remove hard cap.
x >= 050000
Whether to enforce the hard spending cap.
Successful Response
Response with spending cap configuration.
Current spending in current billing cycle (cents)
Current spending in current billing cycle (USD)
Soft spending limit in USD cents (null = unlimited)
10000
Soft spending limit in USD
100
Percentage thresholds for spending alerts
Whether spending alerts are enabled
Alert thresholds triggered in current billing cycle
Hard spending limit in USD cents (null = no hard cap)
50000
Hard spending limit in USD
500
Whether hard spending cap is enforced
Percentage of budget used (null if no budget set)
46.9