v4
latestOpenAPI 3.1.02026-08-01207318738.7 KBAI
Update AI credit controls
Update the organization's AI credit controls: the downgrade and shutoff thresholds, the default per-user credit limit (userDefaultCredits), and the default per-entity-group credit limit (entityGroupDefaultCredits). All fields are optional and tri-state: omit a field to leave it unchanged, send null to turn that control off (for the defaults: unlimited by default), or send a non-negative number to set it. At least one field is required. The downgradeCredits <= shutoffCredits invariant is enforced against the merged result. Returns the full current state, the same shape as GET.
patch/api/v1/ai/credit-controls
Request body
Example request
{
"downgradeCredits": 800,
"entityGroupDefaultCredits": 100,
"shutoffCredits": 1200,
"userDefaultCredits": 100
}Response
Thresholds updated. Returns the full current state.
Example response
{
"accountCreditLimit": 2000,
"creditsUsed": 450,
"downgradeCredits": 800,
"entityGroupDefaultCredits": 100,
"shutoffCredits": 1200,
"userDefaultCredits": 100
}