# Save model and placement defaults.

> https://koi.dog/docs/api/setup/put-setup-defaults/

`PUT /api/v1/setup/defaults` · Scope: `config`

The timeline records the key ID, action and outcome.

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `revision` | `integer` | yes | The revision these defaults replace: `0` before the first write, else the `revision` you read. Another revision is `409 revision_conflict`; read them again and write on top. ≥ 0. |
| `models` | `object` | yes | The model pick for each role (`builder`, `manager`, `reviewer`). A role left out has no default at this level. Each pick names a connection you can see, with its own harness. Defaults only fill in a form: nothing launches until a person submits it. |
| `models.builder` | `object` | no | One role's explicit choice: which named connection, which harness, which model, which options. |
| `models.builder.connectionId` | `string` | yes | The connection this role's agents use, by id (`GET /connections`). Named every time: the server never picks one. At least 5 characters. |
| `models.builder.harness` | `enum` | yes | The coding agent program that runs the model. A machine runs it only when that harness is installed there. One of `claude-code`, `pi`, `codex`, `opencode`. |
| `models.builder.model` | `string` | yes | The model this role's agents use, as the connection's provider names it. 1 to 200 characters. |
| `models.builder.options` | `object` | no | The model's options for this role. Default `{}`. |
| `models.builder.options.effort` | `enum` | no | How much reasoning the model spends, where its harness lets you choose. Left out, the harness's default. One of `low`, `medium`, `high`, `xhigh`, `max`. |
| `models.manager` | `object` | no | One role's explicit choice: which named connection, which harness, which model, which options. |
| `models.manager.connectionId` | `string` | yes | The connection this role's agents use, by id (`GET /connections`). Named every time: the server never picks one. At least 5 characters. |
| `models.manager.harness` | `enum` | yes | The coding agent program that runs the model. A machine runs it only when that harness is installed there. One of `claude-code`, `pi`, `codex`, `opencode`. |
| `models.manager.model` | `string` | yes | The model this role's agents use, as the connection's provider names it. 1 to 200 characters. |
| `models.manager.options` | `object` | no | The model's options for this role. Default `{}`. |
| `models.manager.options.effort` | `enum` | no | How much reasoning the model spends, where its harness lets you choose. Left out, the harness's default. One of `low`, `medium`, `high`, `xhigh`, `max`. |
| `models.reviewer` | `object` | no | One role's explicit choice: which named connection, which harness, which model, which options. |
| `models.reviewer.connectionId` | `string` | yes | The connection this role's agents use, by id (`GET /connections`). Named every time: the server never picks one. At least 5 characters. |
| `models.reviewer.harness` | `enum` | yes | The coding agent program that runs the model. A machine runs it only when that harness is installed there. One of `claude-code`, `pi`, `codex`, `opencode`. |
| `models.reviewer.model` | `string` | yes | The model this role's agents use, as the connection's provider names it. 1 to 200 characters. |
| `models.reviewer.options` | `object` | no | The model's options for this role. Default `{}`. |
| `models.reviewer.options.effort` | `enum` | no | How much reasoning the model spends, where its harness lets you choose. Left out, the harness's default. One of `low`, `medium`, `high`, `xhigh`, `max`. |
| `placement` | `object \| null` | yes | Where crews may run by default, or `null` for no default. A pinned or left-out machine must be paired here. |
| `placement.policy` | `enum` | no | `pinned` runs only on `pinnedNodeId`. `lowest_cost` and `fastest` place the same way today: paired machines before cloud workers, the one with the most free slots first. Default `lowest_cost`. |
| `placement.pinnedNodeId` | `string` | no | Run every agent on this one machine (a machine id). No cloud worker is used. At least 5 characters. |
| `placement.deniedNodeIds` | `array` | no | Machine ids the crew may not use. Default empty. |
| `placement.allowCloud` | `boolean` | no | The crew may start cloud VMs, within its `limits`. Default `true`. |
| `placement.allowLocal` | `boolean` | no | The crew may use your paired machines. Default `true`. |
| `projectId` | `string` | no | The project these defaults are for. Left out, the workspace's own defaults; a project's replace them role by role. At least 5 characters. |

## Response.

200 OK · JSON object

- **422 validation_failed**: Each schema error appears in `details`.

## Request.

```sh
curl -X PUT https://api.koi.dog/api/v1/setup/defaults \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "revision": 0,
      "models": {},
      "placement": {}
    }'
```

```js
const res = await fetch("https://api.koi.dog/api/v1/setup/defaults", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    revision: 0,
    models: {},
    placement: {},
  }),
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.put(
    "https://api.koi.dog/api/v1/setup/defaults",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
    json={
        "revision": 0,
        "models": {},
        "placement": {},
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "revision": 0,
  "models": {
    …
  },
  "placement": {
  }
}
```
