---
title: "Update circuit breaker policy"
method: PUT
path: "/api/circuit-breaker/policies/{name}"
tags: ["Circuit Breaker"]
---

# Update circuit breaker policy

`PUT /api/circuit-breaker/policies/{name}`

Replaces a circuit breaker policy by name. The `name` field in the request body must match the URL parameter or be omitted.
Changes take effect immediately in the running gateway.

## Path parameters

- `name` string, required

## Request body

- object
  - `name` string, required — Unique name for this policy.
  - `enabled` boolean — When `false`, the policy is registered but all hooks skip it.
  - `primary_provider` string, required — Provider to monitor (e.g. `azure`, `openai`).
  - `primary_model` string, required — Model name as it appears in requests (e.g. `gpt-4o-ptu`).
  - `primary_key_ids` string[] — API key UUIDs to track individually. Each key gets its own sub-circuit. The main circuit opens only when all listed keys have tripped. Leave empty to use a single shared circuit for all keys serving this provider+model.
  - `fallback_provider` string, required — Provider to route to when the circuit is open.
  - `fallback_model` string, required — Model to request from the fallback provider when the circuit is open.
  - `condition` object, required
    - `operator` 'OR' | 'AND' — How multiple signals are combined. `OR` (default): circuit opens when any signal matches. `AND`: circuit opens only when all signals match simultaneously.
    - `signals` object[], required — List of response signals to evaluate. At least one required.
      - `source` 'response_header', required — Part of the HTTP response to inspect. Only `response_header` is currently supported.
      - `header_name` string, required — HTTP response header name to inspect (case-insensitive).
      - `header_value` string — Trips when the header value exactly equals this string (case-insensitive). Mutually exclusive with `header_contains`. If neither is set, the signal trips whenever the header is present.
      - `header_contains` string — Trips when the header value contains this substring (case-insensitive). Mutually exclusive with `header_value`. If neither is set, the signal trips whenever the header is present.
  - `default_cooldown` union — How long to keep the circuit open (in nanoseconds). Accepted as a Go duration string on write (e.g. `"30s"`, `"5m"`); returned as an integer (nanoseconds) on read. Defaults to 30 seconds (30000000000 ns).
    - string — Go duration string accepted on write.
    - integer — Nanoseconds returned on read.
  - `cooldown_header` string — Response header whose value (in milliseconds) overrides `default_cooldown`. Falls back to `default_cooldown` when the header is absent or unparsable.

## Response `200`

Policy updated

- object
  - `name` string, required — Unique name for this policy.
  - `enabled` boolean — When `false`, the policy is registered but all hooks skip it.
  - `primary_provider` string, required — Provider to monitor (e.g. `azure`, `openai`).
  - `primary_model` string, required — Model name as it appears in requests (e.g. `gpt-4o-ptu`).
  - `primary_key_ids` string[] — API key UUIDs to track individually. Each key gets its own sub-circuit. The main circuit opens only when all listed keys have tripped. Leave empty to use a single shared circuit for all keys serving this provider+model.
  - `fallback_provider` string, required — Provider to route to when the circuit is open.
  - `fallback_model` string, required — Model to request from the fallback provider when the circuit is open.
  - `condition` object, required
    - `operator` 'OR' | 'AND' — How multiple signals are combined. `OR` (default): circuit opens when any signal matches. `AND`: circuit opens only when all signals match simultaneously.
    - `signals` object[], required — List of response signals to evaluate. At least one required.
      - `source` 'response_header', required — Part of the HTTP response to inspect. Only `response_header` is currently supported.
      - `header_name` string, required — HTTP response header name to inspect (case-insensitive).
      - `header_value` string — Trips when the header value exactly equals this string (case-insensitive). Mutually exclusive with `header_contains`. If neither is set, the signal trips whenever the header is present.
      - `header_contains` string — Trips when the header value contains this substring (case-insensitive). Mutually exclusive with `header_value`. If neither is set, the signal trips whenever the header is present.
  - `default_cooldown` union — How long to keep the circuit open (in nanoseconds). Accepted as a Go duration string on write (e.g. `"30s"`, `"5m"`); returned as an integer (nanoseconds) on read. Defaults to 30 seconds (30000000000 ns).
    - string — Go duration string accepted on write.
    - integer — Nanoseconds returned on read.
  - `cooldown_header` string — Response header whose value (in milliseconds) overrides `default_cooldown`. Falls back to `default_cooldown` when the header is absent or unparsable.

## Other responses

- `400` — Bad request
- `404` — Policy not found.
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/versions/f8cab88f64ea/schema)
