AI

Update AI credit controls

Changed on

Update the organization's AI credit controls: the downgrade and shutoff thresholds, the default per-user credit limit (userDefaultCredits), the default per-user daily credit limit (userDefaultDailyCredits, which requires per-user daily limits to be enabled), 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

  • Base URL
    https://omniapp.co (the document declares no server; this is the origin it was published from)
  • URL
    https://omniapp.co/api/v1/ai/credit-controls
  • Auth
    HTTP bearer

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.

userDefaultDailyCreditsnumber nullable

Default per-user AI credit limit per UTC day — what every user without an individual daily limit gets. Omit to leave unchanged, null for unlimited by default, or a non-negative number to set. Requires per-user daily limits to be enabled.

Example request

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

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.

userDefaultDailyCreditsnumber nullable

Default per-user AI credit limit per UTC day, or null when users are unlimited per day by default. Omitted when per-user daily limits are not enabled.

Example response

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

Changes

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the new optional request property

    • info

      added the required property to the response with the status