# Is there room for this request? Charges the declared cost

`POST /budget/check` · Praecise Shield · Budgets and kill switch

Answers allow, challenge (near the limit: ask for proof) or refuse (over it; nothing charged). Give client (any stable id; only a hash is kept) or agent (the signed agent's name).

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "site": {
      "type": "string",
      "description": ""
    },
    "secret": {
      "type": "string",
      "description": ""
    },
    "client": {
      "type": "string",
      "description": ""
    },
    "agent": {
      "type": "string",
      "description": ""
    },
    "method": {
      "type": "string",
      "description": ""
    },
    "path": {
      "type": "string",
      "description": ""
    },
    "cost": {
      "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."
        }
      }
    }
  },
  "required": [
    "site",
    "secret"
  ]
}
```

## Responses

- `200`
- `401`: Wrong site or secret.

## Example

```sh
curl -X POST 'https://shield.praecise.com/budget/check' \
  -H 'Content-Type: application/json' \
  -d '{
  "site": "string",
  "secret": "string"
}'
```
