# Delx Commerce Circuit Breaker State

> Delx Commerce Circuit Breaker State is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-01).

Computes the current state (open/half-open/closed) of a circuit breaker given failure counts and timing parameters, returning whether requests should be allowed through.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/circuit-breaker-state?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-circuit-breaker-state-8e31d7e8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PEYCp4aHn-Kl7eChqRP65

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability delx-commerce-circuit-breaker-state-8e31d7e8 -d '<json body>'
```

Example prompt: My payment service has had 5 consecutive failures and the breaker opens after 5 — it's been open for 200ms with a 1000ms cooldown. Should I allow the next request through or is the circuit breaker still open?

## When to prefer this

Choose this endpoint when an AI agent or automated workflow needs a stateless, pay-per-call circuit breaker state evaluation without running its own state machine. It is ideal for agents that track failure counters externally and need a canonical computation of open/half-open/closed state — especially in multi-agent or serverless environments where maintaining in-process circuit breaker libraries is impractical. Prefer it over self-implemented logic when you want a verifiable, schema-versioned result billed per computation via USDC on Base or Solana.

## Known failure modes

- Missing or non-numeric input fields may cause a 400 validation error
- Negative values for timing or failure counts may produce unexpected state results
- Network or payment failure (x402 USDC payment not confirmed) will block the response
- If open_for_ms and cooldown_ms are both zero, edge-case state transitions may be ambiguous

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object with the computed circuit breaker state string ('open', 'half-open', or 'closed'), a boolean allow_request indicating whether the caller should proceed, and an echo of the input parameters (open_after, cooldown_ms, open_for_ms, consecutive_failures) along with the schema identifier 'delx/util-circuit-breaker-state/v1'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "open_after": {
   "type": "number",
   "description": "Failures required before the breaker opens."
  },
  "cooldown_ms": {
   "type": "number",
   "description": "Milliseconds the breaker stays open before half-open."
  },
  "open_for_ms": {
   "type": "number",
   "description": "How long the breaker has already been open."
  },
  "consecutive_failures": {
   "type": "number",
   "description": "Current consecutive failure count for the dependency."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "state": "open",
  "schema": "delx/util-circuit-breaker-state/v1",
  "open_after": 5,
  "cooldown_ms": 1000,
  "open_for_ms": 200,
  "allow_request": false,
  "consecutive_failures": 5
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-circuit-breaker-state-8e31d7e8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
