---
title: "Update a budget policy"
method: PUT
path: "/guardrails/policies/budget/{id}"
tags: ["Guardrail Policies"]
---

# Update a budget policy

`PUT /guardrails/policies/budget/{id}`

## Request

- Base URL: `https://openrouter.ai/api/v1`
- URL: `https://openrouter.ai/api/v1/guardrails/policies/budget/{id}`
- Auth: HTTP bearer

Replace a budget policy's name and config, and optionally its assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.

## Path parameters

- `id` string, uuid, required: Policy ID

## Request body

- UpdateBudgetGuardrailPolicyRequest
  - `api_key_hashes` string[]: Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.
  - `config` GuardrailBudgetPolicyAuthoringConfig, required
    - `include_byok_in_budgets` boolean, required
    - `limit_usd` number, nullable, required
    - `reset_interval` 'daily' | 'weekly' | 'monthly' | 'null', nullable, required
  - `is_workspace_default` boolean: Omit to keep the stored default status; `false` unsets the policy as the workspace default.
  - `member_ids` string[]: Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments.
  - `name` string, required: Policy name
  - `opted_out_api_key_hashes` string[]: API key hashes
  - `opted_out_member_ids` string[]: Organization member user IDs
  - `workspace_id` string, uuid: Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.

## Response `200`

budget policy updated

- BudgetGuardrailPolicyResponse
  - `data` BudgetGuardrailPolicy, required
    - `config` GuardrailBudgetPolicyConfig, required
      - `include_byok_in_budgets` boolean: Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend. Defaults to false.
      - `limit_usd` number, double, nullable: Spending limit in USD. Must be provided together with `reset_interval`: a request that sets only one of the two is rejected with a 400.
      - `reset_interval` 'daily' | 'weekly' | 'monthly' | 'null', nullable: Interval at which the limit resets (daily, weekly, monthly)
    - `id` string, uuid, required: Policy ID
    - `name` string, required: Policy name
    - `policy_type` 'budget', required

## Other responses

- `400`: Bad Request - Invalid request parameters or malformed input
- `401`: Unauthorized - Authentication required or invalid credentials
- `403`: Forbidden - Authentication successful but insufficient permissions
- `404`: Not Found - Resource does not exist
- `409`: Conflict - Resource conflict or concurrent modification
- `500`: Internal Server Error - Unexpected server error

## Changes

- **2026-11-11** `5aee117d1dca`: 1 info
  - the request property `workspace_id` became optional
- **2026-11-06** `02121928ccaf`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openrouterteam/apis/openrouter-api/changes/guardrails/policies/budget/:id/put.md)

---

[API](https://skmtc.dev/openrouterteam/apis/openrouter-api.md) - [All operations](https://skmtc.dev/openrouterteam/apis/openrouter-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openrouterteam/apis/openrouter-api/revisions/f797e38f23b4?raw)
