# Set a site's cost budget

`PUT /sites/{site}/budget` · Praecise Shield · Budgets and kill switch

## Parameters

- `site` (path, required), string: The site key (ps_…).

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "windowSeconds": {
      "type": "integer",
      "minimum": 10,
      "maximum": 86400
    },
    "limits": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tokens": {
          "type": "integer",
          "minimum": 0
        },
        "dbMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Database milliseconds."
        },
        "cents": {
          "type": "integer",
          "minimum": 0,
          "description": "Money in minor units."
        }
      },
      "description": "Per client."
    },
    "agentLimits": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tokens": {
          "type": "integer",
          "minimum": 0
        },
        "dbMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Database milliseconds."
        },
        "cents": {
          "type": "integer",
          "minimum": 0,
          "description": "Money in minor units."
        }
      },
      "description": "Per signed agent; the same as limits when absent."
    },
    "challengeAt": {
      "type": "number",
      "minimum": 0.5,
      "maximum": 1
    },
    "routes": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tokens": {
            "type": "integer",
            "minimum": 0
          },
          "dbMs": {
            "type": "integer",
            "minimum": 0,
            "description": "Database milliseconds."
          },
          "cents": {
            "type": "integer",
            "minimum": 0,
            "description": "Money in minor units."
          }
        }
      },
      "description": "'METHOD /path' or '/path'; a trailing * is a prefix."
    }
  },
  "required": []
}
```

## Responses

- `200`

## Example

```sh
curl -X PUT 'https://shield.praecise.com/sites/{site}/budget' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "windowSeconds": 0,
  "limits": {
    "tokens": 0,
    "dbMs": 0,
    "cents": 0
  },
  "agentLimits": {
    "tokens": 0,
    "dbMs": 0,
    "cents": 0
  },
  "challengeAt": 0,
  "routes": {}
}'
```
