# Set what happens at the limit for one allowance

`PUT /usage/limits/policy/{meter}` · Rivier · usage

Set what happens at the limit for one allowance: stop, carry on and bill the overage, or ask a person; the warning levels; a ceiling on overage; a limit for this project alone.

- Scope: usage:admin
- Graphql: Mutation.usageLimitSet
- Sdk: usage.limit.set
- Cli: usage limit set

## Parameters

- `meter` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "overage": {
      "type": "string",
      "enum": [
        "block",
        "bill",
        "approve"
      ]
    },
    "warnAt": {
      "type": "array",
      "items": {
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1
      },
      "maxItems": 6
    },
    "hardOverage": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "approvalBlock": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "projectCap": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/usage/limits/policy/{meter}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "overage": "block",
  "warnAt": [
    0
  ],
  "hardOverage": 0,
  "approvalBlock": 0,
  "projectCap": 0
}'
```
