{"uid":"cap_lZsrGJoPk9uumqJjS62HY","slug":"delx-circuit-breaker-state-d8ffab1d","name":"Delx Circuit Breaker State","description":"Derive closed, open, or half-open circuit state from failure and cooldown inputs — call when deciding closed/open/half-open from failure counters. Use before side effects when composing multi-step agent jobs—the same loyalty/workflow demand band agents already pay for on Bazaar, but fully local. Returns deterministic machine-readable JSON for $0.003 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, and no claim of…","url":"https://api.delx.ai/api/v1/x402/circuit-breaker-state","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gJSsbm-TP0Y4OaTWCvH7l","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Derives closed, open, or half-open circuit breaker state from failure counters and cooldown timing inputs","exampleAgentPrompt":"Check whether the circuit breaker should be open, closed, or half-open — the dependency has had 6 consecutive failures, it opens after 5 failures, the cooldown is 30000ms, and it's been open for 35000ms already.","exampleUseCases":[{"title":"Guard downstream API call in agent","prompt":"Before calling the payment service, check the circuit breaker state — we've had 8 consecutive failures, the breaker opens after 5, cooldown is 60000ms, and it's been open for 10000ms. Should I proceed or hold back?"},{"title":"Retry decision after cooldown elapsed","prompt":"Our database dependency tripped after 3 consecutive failures with an open_after threshold of 3. The cooldown is 15000ms and it's been open for 20000ms. Is the circuit breaker half-open now so I can send a test request?"},{"title":"Healthy dependency check before workflow step","prompt":"I want to confirm the circuit breaker is still closed before kicking off the next workflow step — we've had 0 consecutive failures, open_after is 5, cooldown is 10000ms, and open_for_ms is 0."}],"resultDescription":"Returns a deterministic JSON object indicating the current circuit breaker state — one of 'closed', 'open', or 'half-open' — based on whether consecutive failures have met the open threshold and whether the cooldown period has elapsed since the breaker opened.","failureModes":["Missing required fields (e.g. consecutive_failures or open_after) may return a validation error","Negative or non-numeric values for timing/count fields may cause an error response","If cooldown_ms is 0 and breaker is open, half-open logic may behave unexpectedly","Payment failure via x402 returns 402 before computation occurs"],"whenToPreferThis":"Choose this endpoint when you need a stateless, deterministic circuit breaker state evaluation with no server-side state management — ideal for agent workflows that track failure counters locally and need a reliable, cheap ($0.003 USDC) computation step before deciding whether to invoke a downstream dependency. Prefer this over building circuit breaker logic inline when you want a consistent, auditable machine-readable JSON result without managing state on a remote server.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:01:20.995Z","isFirstParty":false}