AI

Get AI credit controls

Changed on

Get the organization's AI credit controls: the downgrade and shutoff thresholds, the default per-user and per-entity-group credit limits, the default per-user daily credit limit (userDefaultDailyCredits, only when per-user daily limits are enabled), plus read-only context (the credit limit, usage so far this billing period, and the period bounds). This is the API mirror of the AI Hub credit controls page and requires the same AI-admin permission.

get/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

Response

Current credit controls. Thresholds are null when the corresponding control is off.

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