# Set Koidog's tool budgets.

> `crewUsd` (a crew's tool budget when its launch names none), `monthlyUsd` (the workspace's tool spend per calendar month, UTC) and `callCeilingUsd` (the most one call may reserve without asking).
> https://koi.dog/docs/api/tools/set-tool-limits/

`PUT /api/v1/tools/monid/limits` · Scope: `config`

Raising one needs `approve` as well as `config`. Defaults: 1, 20 and 0.25 US dollars. 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 |
| --- | --- | --- | --- |
| `crewUsd` | `0–10000` | no | A crew's tool budget in US dollars when its launch names none. Default 1. |
| `monthlyUsd` | `0–100000` | no | The workspace's tool spend per calendar month (UTC), in US dollars. Default 20. |
| `callCeilingUsd` | `0–1000` | no | The most one tool call may reserve without asking a person, in US dollars. Default 0.25. |

## 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/tools/monid/limits \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "monthlyUsd": 20
    }'
```

```js
const res = await fetch("https://api.koi.dog/api/v1/tools/monid/limits", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    monthlyUsd: 20,
  }),
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.put(
    "https://api.koi.dog/api/v1/tools/monid/limits",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
    json={
        "monthlyUsd": 20,
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "enabled": false,
  "connectionId": "pc_monid",
  "status": "not_connected",
  "reason": "not_configured",
  "next": [],
  "base": "unconfigured",
  "hasSecret": false,
  "addedAt": "string",
  "observedAt": "string",
  "account": {
  },
  "wallet": {
  },
  "controls": {
  },
  "limits": {
    "crewUsd": 0,
    "monthlyUsd": 0,
    "callCeilingUsd": 0,
    "set": false
  },
  "month": {
    "periodStart": "string",
    "spentUsd": 0,
    "reservedUsd": 0
  },
  …
}
```
