# Change shared AI settings

```http
PATCH https://trydimmi.com/api/v1/ai/settings
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `ai:write`.

## Body

- `answer_key_id` (string): Provider key every agent answers with until it picks its own, starting with aik_, such as aik_01jx2m8k4t. Find it with GET /ai/keys. Send null to clear it.
- `answer_model` (string): Model every agent answers with until it picks its own, one of the models the answer key lists, at most 120 characters, such as "claude-haiku-5-5". Send null to clear it.
- `classifier_key_id` (string): Provider key that sorts each customer message before an agent answers, starting with aik_, such as aik_01jx2m8k4t. Find it with GET /ai/keys. Send null to clear it.
- `classifier_model` (string): Model that sorts each customer message, one of the models the classifier key lists, at most 120 characters, such as "claude-haiku-5-5". Send null to clear it.
- `fallback_key_id` (string): Provider key used when an agent's answer key fails, starting with aik_, such as aik_01jx2m8k4t. Find it with GET /ai/keys. Send null to clear it.
- `fallback_model` (string): Model used when an agent's answer model fails, one of the models the fallback key lists, at most 120 characters, such as "claude-haiku-5-5". Send null to clear it.
- `monthly_cap_usd` (number): Most the workspace may spend on dimmi in a month, in US dollars, 0 to 100000, such as 250. 0 or null means no cap. Raising it lifts a pause the old cap caused.

## Response 200 (OK)

- `data` (object, required)
  - `answer_key_id` (string | null, required): Id of the provider key every agent answers with until it picks its own (starts with aik_). Null when none is set.
  - `answer_model` (string | null, required): The model every agent answers with until it picks its own. Null when none is set.
  - `classifier_key_id` (string | null, required): Id of the provider key that sorts each customer message before an agent answers (starts with aik_). Null when none is set.
  - `classifier_model` (string | null, required): The model that sorts each customer message. Null when none is set.
  - `fallback_key_id` (string | null, required): Id of the provider key used when an agent's answer key fails (starts with aik_). Null when there is none.
  - `fallback_model` (string | null, required): The model used when an agent's answer model fails. Null when there is none.
  - `monthly_spend_cap_micros` (integer | null, required): Most the workspace may spend on dimmi in a month, in millionths of a US dollar. Null when there is no cap.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request PATCH \
  --url 'https://trydimmi.com/api/v1/ai/settings' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "answer_key_id": "<string>",
  "answer_model": "<string>",
  "classifier_key_id": "<string>",
  "classifier_model": "<string>",
  "fallback_key_id": "<string>",
  "fallback_model": "<string>",
  "monthly_cap_usd": 123.45
}'
```

## Example response

```json
{
  "data": {
    "answer_key_id": "<string>",
    "answer_model": "<string>",
    "classifier_key_id": "<string>",
    "classifier_model": "<string>",
    "fallback_key_id": "<string>",
    "fallback_model": "<string>",
    "monthly_spend_cap_micros": 123,
    "object": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
