---
title: "Update AI credit controls"
method: PATCH
path: "/api/v1/ai/credit-controls"
tags: ["AI"]
---

# Update AI credit controls

`PATCH /api/v1/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.

## Request body

- AiCreditControlsUpdateBody
  - `downgradeCredits` number, 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.
  - `entityGroupDefaultCredits` number, 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.
  - `shutoffCredits` number, nullable — Credit usage at which AI shuts off entirely. Omit to leave unchanged, `null` to turn off, or a non-negative number to set.
  - `userDefaultCredits` number, 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.

## Response `200`

Thresholds updated. Returns the full current state.

- AiCreditControlsResponse
  - `accountCreditLimit` number, 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.
  - `creditsUsed` number, required — This org's credit usage in the current billing period.
  - `downgradeCredits` number, nullable, required — Downgrade threshold, or `null` if the downgrade control is off.
  - `entityGroupDefaultCredits` number, nullable, required — Default per-entity-group AI credit limit, or `null` when embed entity groups are unlimited by default.
  - `periodEnd` integer, required — End of the current billing period as a Unix ms timestamp (UTC calendar-month boundary).
  - `periodStart` integer, required — Start of the current billing period as a Unix ms timestamp (UTC calendar-month boundary).
  - `shutoffCredits` number, nullable, required — Shutoff threshold, or `null` if the shutoff control is off.
  - `userDefaultCredits` number, nullable, required — Default per-user AI credit limit, or `null` when users are unlimited by default.

## Other responses

- `400` — Invalid request. Common causes: empty body, a negative value, an unknown field, or downgradeCredits above shutoffCredits.
- `401` — Missing or invalid API key.
- `403` — Insufficient permissions, or AI credit controls are not enabled. Requires AI-admin access.

---

[API](https://skmtc.net/omniapp/apis/omni-api.md) · [All operations](https://skmtc.net/omniapp/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omniapp/omni-api/versions/de7cac8b5983/schema)
