Available on all Portkey plans.
Config Schema
| Field | Description |
|---|---|
failure_threshold | Number of failures to open circuit |
failure_threshold_percentage | Percentage failure rate to trip circuit (optional) |
cooldown_interval | Milliseconds to wait before retrying (min: 30s) |
failure_status_codes | HTTP codes considered failures (optional, default: >500) |
minimum_requests | Requests required before evaluating failure rate (optional) |
- Strategies inherit
cb_configfrom parent if not set - Targets inherit from their parent strategy
Example
The
@provider-slug/model-name format automatically routes to the correct provider. Set up providers in Model Catalog.How It Works
Circuit breaker tracks per strategy path:- Failure and success counts
- Time of first failure
- Failure rate (when
minimum_requeststhreshold met)
- Failure count exceeds
failure_threshold, or - Failure rate exceeds
failure_threshold_percentage
cooldown_interval passes.
Runtime Behavior
- Unhealthy targets removed from routing
- If all targets are OPEN, circuit breaker is bypassed

