# Change or switch off an endpoint

Source: https://docs.vlayers.ai/reference/hosting/update-endpoint

`PUT /v1/endpoints/{endpoint}` · scope `workspace:write`

Any of: switch the endpoint off (say why; the reason is recorded) or on again, set a monthly spend cap in US dollars (`null` removes it), and change one route's limits and settings. A setting above what your plan allows is refused with 422 and names the ceiling. An endpoint that VoiceLayer switched off cannot be switched back on here: appeal it with `POST /v1/endpoints/{endpoint}/appeal`.

Requires an API key with the `workspace:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `endpoint` | path | string | yes | The endpoint id: the first segment of its `run.vlayers.ai` URL. Example: `"x7k2p4q9m3vd"` |
| `enabled` | body | boolean | no | False switches the endpoint off for every caller at once; true switches it back on. |
| `reason` | body | string | no | Why you are switching it off (at least 3 characters). Recorded on the endpoint. |
| `monthlySpendCapUsd` | body | number | no | The most the endpoint's traffic may cost in a calendar month, in US dollars; requests past it are refused with `limit`. `null` removes the cap. |
| `settings` | body | object | no | Settings per route kind (`api`, `hook`, `mcp`): request and response size, timeout, requests per second, concurrent streams, redirects to other sites, caching, and what happens to a response that is not machine content. |

## Request

cURL:

```bash
curl -X PUT "https://api.vlayers.ai/v1/endpoints/$ENDPOINT_ID" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "monthlySpendCapUsd": 25
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { endpoints } = await voicelayer.hosting.updateEndpoint('<endpoint-id>', {
  monthlySpendCapUsd: 25
});
console.log(endpoints);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.hosting.update_endpoint("<endpoint-id>", monthly_spend_cap_usd=25)
print(result.endpoints)
```

## Response `200`

```json
{
  "endpoints": [
    {
      "id": "x7k2p4q9m3vd",
      "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",
      "environment": "prd",
      "enabled": true,
      "disabled": null,
      "monthlySpendCapUsd": 25,
      "spentThisMonthUsd": 0.42,
      "routes": [
        {
          "kind": "api",
          "url": "https://run.vlayers.ai/x7k2p4q9m3vd/api",
          "auth": "key",
          "servingVersion": 3,
          "pendingVersion": null,
          "settings": {},
          "limits": {
            "maxRequestBytes": 10485760,
            "maxResponseBytes": 67108864,
            "timeoutMs": 30000,
            "requestsPerSecond": 50,
            "concurrentStreams": 50,
            "streamIdleMs": 300000
          }
        }
      ],
      "keys": [
        {
          "id": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",
          "kind": "api",
          "name": "Partner integration",
          "preview": "vle_AbCd…wXyZ",
          "createdAt": "2026-10-20T15:04:05.000Z",
          "expiresAt": null,
          "lastUsedAt": null,
          "revokedAt": null
        }
      ]
    }
  ]
}
```
