---
title: "Set individual users' AI credit limits"
method: PATCH
path: "/v1/ai/credit-controls/users"
tags: ["AI Credit Controls"]
---

# Set individual users' AI credit limits

`PATCH /v1/ai/credit-controls/users`

<Note>
  **Organization Admin** permissions are required to use this endpoint.
</Note>

Set individual users' AI credit limits in bulk. Each entry names a user and either sets an individual limit or removes one so the user follows the organization default. All entries are applied in a single transaction.

## Request body

- object
  - `users` object[], required — Users to update, at most 1000 per request. Each entry has a `userId` plus exactly one of `creditLimit` (number or `null`) or `useDefaultLimit: true`.
    - `creditLimit` number, nullable — The user's individual AI credit limit for the billing period, or `null` for unlimited. This will override the organization default. Mutually exclusive with `useDefaultLimit`.
    - `useDefaultLimit` true — Removes the user's individual limit so they follow the organization default. Mutually exclusive with `creditLimit`.
    - `userId` string, required — The user's ID within this organization.

## Response `200`

All entries applied. Returns each user's effective limit, in request order.

- object
  - `users` object[]
    - `creditLimit` number, nullable, required — The user's effective AI credit limit, or `null` for unlimited.
    - `userId` string, required — The user's ID within this organization.
    - `usesDefaultLimit` boolean, required — If `true`, the user has no individual limit and follows the organization default.

## Other responses

- `400` — Invalid request. Common causes: - An empty users array - More than 1000 entries - An entry with both `creditLimit` and `useDefaultLimit` (or neither) - A negative `creditLimit` - A duplicated `userId`
- `401` — Missing or invalid API key.
- `403` — Insufficient permissions, per-user AI credit limits are not enabled, or credit controls editing is disabled for the organization.
- `404` — Specified `userId` is not a member of the organization; the response names the first invalid id. No limits are changed.
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)
- `500` — Internal Server Error

---

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