Change the spending caps and alerts
update_workspace_spending
Sets or removes the monthly spending caps of a workspace and its spending alerts, changing only what you send.
Only the workspace owner can call this, the same as in Settings > Spending. Only what you send changes, and the answer is the same as get_workspace_spending.
caps sets caps in whole credits a calendar month, from 0 to 1,000,000, for total (everything the workspace spends), ai (the AI of every site together) and emails (the extra emails every site buys together). removeCaps removes the caps it names, and takes precedence over caps. Lowering total below what the workspace already spent this month stops chat from starting new turns at once, so the tool tells the client to confirm with you before it lowers a cap. Raising or removing a cap lets AI and email sending that a cap paused start again on their own.
alertPercents picks the points of each cap and of the budget that send the owner an email, any of 50, 75 and 90. An empty list keeps only the email a cap sends when it is reached. budget sets a monthly amount that only sends emails, and lowBalance the balance under which the owner hears about it; removeBudget and removeLowBalance turn them off. A point that was already passed when you save does not send an email.
Auto top-up charges the owner's card, so it can only be turned on or changed in the app. See Spending caps and alerts.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
workspaceId |
string | Yes | The workspace id. |
caps |
object | No | The caps to set: total, ai and emails, each a whole number of credits a calendar month. |
removeCaps |
array of strings | No | The caps to remove, any of total, ai and emails. It takes precedence over caps. |
alertPercents |
array of integers | No | The points of each cap and budget, in percent, that send the owner an email. |
budget |
integer | No | A monthly amount in credits that only sends emails. |
removeBudget |
boolean | No | True to remove the budget. |
lowBalance |
integer | No | The balance in credits under which the owner gets an email. |
removeLowBalance |
boolean | No | True to stop the low balance email. |