v4

latestOpenAPI 3.1.02026-08-01207318738.7 KB
AI

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

downgradeCreditsnumber nullable

Credit usage at which AI downgrades to a cheaper model. Omit to leave unchanged, null to turn off, or a non-negative number to set. Must be at or below shutoffCredits.

entityGroupDefaultCreditsnumber nullable

Default per-entity-group AI credit limit for the billing period — what every embed entity group without an individual limit gets. Omit to leave unchanged, null for unlimited by default, or a non-negative number to set.

shutoffCreditsnumber nullable

Credit usage at which AI shuts off entirely. Omit to leave unchanged, null to turn off, or a non-negative number to set.

userDefaultCreditsnumber nullable

Default per-user AI credit limit for the billing period — what every user without an individual limit gets. Omit to leave unchanged, null for unlimited by default, or a non-negative number to set.

Example request

{
  "downgradeCredits": 800,
  "entityGroupDefaultCredits": 100,
  "shutoffCredits": 1200,
  "userDefaultCredits": 100
}

Response

Thresholds updated. Returns the full current state.

accountCreditLimitnumber required

Monthly AI credit limit for the whole Omni account (shared across every org under the same Salesforce account), not just this org. 0 when no limit is configured.

creditsUsednumber required

This org's credit usage in the current billing period.

downgradeCreditsnumber nullable required

Downgrade threshold, or null if the downgrade control is off.

entityGroupDefaultCreditsnumber nullable required

Default per-entity-group AI credit limit, or null when embed entity groups are unlimited by default.

periodEndinteger required

End of the current billing period as a Unix ms timestamp (UTC calendar-month boundary).

periodStartinteger required

Start of the current billing period as a Unix ms timestamp (UTC calendar-month boundary).

shutoffCreditsnumber nullable required

Shutoff threshold, or null if the shutoff control is off.

userDefaultCreditsnumber nullable required

Default per-user AI credit limit, or null when users are unlimited by default.

Example response

{
  "accountCreditLimit": 2000,
  "creditsUsed": 450,
  "downgradeCredits": 800,
  "entityGroupDefaultCredits": 100,
  "shutoffCredits": 1200,
  "userDefaultCredits": 100
}