AI Credit Controls

Update AI credit controls

Changed on
<Note> **Organization Admin** permissions are required for this endpoint. </Note>

Update the organization's AI credit controls. This endpoint can be used for embedded instances.

All fields are optional, but at least one must be provided:

  • Omit a field to leave it unchanged
  • Send null to turn that control off (for userDefaultCredits and entityGroupDefaultCredits: unlimited by default)
  • Send a non-negative number to set it
patch/v1/ai/credit-controls

Request

  • Base URL
    https://blobsrus.omniapp.co/api
  • URL
    https://blobsrus.omniapp.co/api/v1/ai/credit-controls
  • Auth
    • HTTP bearer
    • or 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 less than or equal to shutoffCredits.

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. This limit is what what every user without an individual limit gets. Omit to leave unchanged, null for unlimited by default, or a non-negative number to set.

entityGroupDefaultCreditsnumber nullable

Default per-entity-group AI credit limit for the billing period. This limit is 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.

Example request

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

Response

Thresholds updated. Returns the full current state.

accountCreditLimitnumber required

Monthly AI credit limit for the whole Omni account, which is shared across every organization associated with the account. 0 when no limit is configured.

creditsUsednumber required

This organizations's credit usage for 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 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
}

Changes

    • info

      added the new optional request property

    • info

      added the required property to the response with the status