---
title: "Set the spend guard"
method: PATCH
path: "/accounts/ai-budget-limits"
tags: ["Usage and Billing"]
---

# Set the spend guard

`PATCH /accounts/ai-budget-limits`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/accounts/ai-budget-limits`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/docs/accounts/ai-budget-limits/patch.ts> (a function with typed inputs; its response is checked against the schema)

Sets `guard_percent` (5 to 100; 100 leaves the credit balance as the only gate). Admin, root or billing role on a subscribed account. Returns the fresh budget state.

## Request body

- object
  - `guard_percent` integer, required: Percent of budget at which spend is stopped

## Response `200`

Success

- object
  - `data` object

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Role not allowed

## Changes

- **2026-11-12** `700eb1ace61a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/changes/accounts/ai-budget-limits/patch.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/revisions/700eb1ace61a?raw)
