Budgets
Set a per-project spending limit, enforced hard or alerted soft
budget_config is replaced as a whole on PATCH, not merged field by field. Send every field you want to keep: a request carrying only amount resets notification_emails to []. Unknown fields are rejected with a 422.
A project’s budget_config caps its spend over a rolling period. hard_limit rejects the project’s requests with 402 once the limit is reached; soft_limit only fires alerts. Set it on create or PATCH; set it to null to remove the limit.
Fields
Set a budget
Alerts are evaluated during a request, not on a timer, so a threshold crossing is noticed on the next call for that project. Each threshold emails once per period.
Requests over a hard limit fail with 402 and a project_budget_exceeded error before any provider call, and responses include X-Project-Budget-Remaining-USD and X-Project-Budget-Limit-USD headers as the limit approaches.
Budget changes can take up to an hour to take effect in enforcement. A raised limit doesn’t unblock requests instantly, and a new hard limit doesn’t protect you instantly.