---
title: "check step"
method: POST
path: "/api/v1/loop-breaker/check_step"
tags: ["loop-breaker"]
---

# check step

`POST /api/v1/loop-breaker/check_step`

## Request

- Base URL: `https://cloudforbots.com`
- URL: `https://cloudforbots.com/api/v1/loop-breaker/check_step`
- Auth: HTTP bearer

Call AFTER each tool call or agent step with what you just did and whether it failed. Loop Breaker fingerprints the call (tool + normalized args + error) and returns verdict ok, loop_detected or halted. Pro: on a loop, halt=true; stop the run, do not retry, and tell your user what repeated. Free watch-only: never halts, returns would_halt and logs it for the weekly report.

## Headers

- `Idempotency-Key` string
- `X-Request-Id` string

## Request body

- object
  - `run_id` string, required: Any stable id for this agent run, e.g. "nightly-sync-2026-10-15". Use the same id for every step of the run (and its sub-agents).
  - `tool` string, required: The tool or step name you just ran, e.g. "browser.click" or "git push".
  - `args` unknown
  - `error` string: The error message if the step failed. Omit or empty if it succeeded.
  - `max_failures` integer: Same failing call this many times = loop. Default 3 (min 2, max 20).
  - `max_repeats` integer: Same call this many times in a row (even if it succeeds) = loop. Default 5 (min 3, max 50).

## Response `200`

Tool result (always includes request_id).

- object

## Other responses

- `400`: Bad JSON
- `401`: Missing or bad key
- `403`: Key limits (scopes) do not allow this tool or action
- `409`: Same Idempotency-Key still running
- `422`: Idempotency-Key reused on another route
- `429`: Over 20 requests/second for this key, or free daily limit
- `504`: Tool did not answer in time; retry with the same Idempotency-Key

---

[API](https://skmtc.dev/cloudforbots/apis/cloud-for-bots-api.md) · [All operations](https://skmtc.dev/cloudforbots/apis/cloud-for-bots-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cloudforbots/apis/cloud-for-bots-api/revisions/1afdb5648693?raw)
