---
title: "Edit AI Settings"
method: PATCH
path: "/users/{userId}/ai/settings"
tags: ["AI"]
---

# Edit AI Settings

`PATCH /users/{userId}/ai/settings`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/users/{userId}/ai/settings`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-api-v2/docs/users/:userId/ai/settings/patch.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `ai` (Read and Write).

## Path parameters

- `userId` integer, required

## Request body

- AiSettingsOperation[]: A JSON Patch document as defined by <a href="https://tools.ietf.org/html/rfc6902#section-3" target="_blank">RFC 6902</a>
  - `op` 'replace' | 'remove' | 'test', required: Patch operation to perform
  - `path` '/preTranslationAiPromptId' | '/editorSuggestionAiPromptId' | '/qaCheckActionAiPromptId' | '/contextReviewAiPromptId' | '/dailyCostLimit' | '/monthlyCostLimit' | '/userDailyCostLimit' | '/userMonthlyCostLimit' | '/perUserOverrides/{userId}' | '/perUserOverrides/{userId}/costLimitMode' | '/perUserOverrides/{userId}/dailyCostLimit' | '/perUserOverrides/{userId}/monthlyCostLimit', json-pointer, required: A JSON Pointer as defined by <a href="https://tools.ietf.org/html/rfc6901" target="_blank">RFC 6901</a>. The `/perUserOverrides/{userId}` and `/perUserOverrides/{userId}/*` paths accept any positive integer for `{userId}`. Creating a new override requires `{userId}` to be a project member; this requirement does not apply when editing or removing an existing one. The `remove` operation is supported for the `/perUserOverrides/{userId}` path (removes the entire per-user override) and for `/perUserOverrides/{userId}/*` field paths (removes that field; the resulting override is re-validated).

## Response `200`

AI settings was successfully updated

- CrowdinAiSettingsResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` CrowdinAiSettings, required
    - `preTranslationAiPromptId` integer
    - `editorSuggestionAiPromptId` integer
    - `qaCheckActionAiPromptId` integer, nullable
    - `contextReviewAiPromptId` integer, nullable
    - `dailyCostLimit` number, float, nullable: Maximum total AI cost the organization can spend per day. `null` means no daily limit.
    - `monthlyCostLimit` number, float, nullable: Maximum total AI cost the organization can spend per month. `null` means no monthly limit.
    - `userDailyCostLimit` number, float, nullable: Default maximum AI cost a single user can spend per day. Applies to every user unless overridden in `perUserOverrides`. `null` means no per-user daily limit.
    - `userMonthlyCostLimit` number, float, nullable: Default maximum AI cost a single user can spend per month. Applies to every user unless overridden in `perUserOverrides`. `null` means no per-user monthly limit.
    - `isLimitingActive` boolean: Whether any AI cost limit is currently in force for the organization: an organization-wide limit, a default per-user limit, or at least one entry in `perUserOverrides` that is not unlimited.
    - `perUserOverrides` AiUserCostLimit[]: Per-user cost limit overrides that take precedence over `userDailyCostLimit` and `userMonthlyCostLimit`.
      - `userId` integer: ID of the user this cost limit override applies to
      - `costLimitMode` 'custom' | 'blocked' | 'unlimited': User AI cost limit mode Values available: - custom - Custom daily and monthly cost limits are applied - blocked - User is blocked from using AI - unlimited - User has no AI cost limit
      - `dailyCostLimit` number, float, nullable: Maximum AI cost this user can spend per day. Applies when `costLimitMode` is `custom`. `null` for `blocked` and `unlimited` modes.
      - `monthlyCostLimit` number, float, nullable: Maximum AI cost this user can spend per month. Applies when `costLimitMode` is `custom`. `null` for `blocked` and `unlimited` modes.
      - `createdAt` string, date-time
      - `updatedAt` string, date-time

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `405`: Method Not Allowed

---

[API](https://skmtc.dev/crowdin/apis/crowdin-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-api-v2/revisions/27aae7751699?raw)
