---
title: "Cancel Run"
method: POST
path: "/runs/{run_id}/cancel"
tags: ["Runs"]
---

# Cancel Run

`POST /runs/{run_id}/cancel`

## Request

- Base URL: `https://api.browser-use.com/api/v4`
- URL: `https://api.browser-use.com/api/v4/runs/{run_id}/cancel`
- Auth: API key in header `X-Browser-Use-API-Key`

Cancel an in-flight run.

Idempotent: a run already in a terminal state (completed / failed /
cancelled) is returned as-is. Once cancelled, the gateway refuses
every subsequent `chat_completions` call from the worker — so the
project cannot be billed further regardless of whether the worker
subprocess notices the cancel itself.

The worker keeps running for at most one more bcode step
(consuming no LLM tokens because CP 409s them) and then exits when
bcode realizes the next tool call has no model behind it.

## Path parameters

- `run_id` string, uuid, required

## Response `200`

Successful Response

- RunSummary
  - `id` string, uuid, required
  - `task` string, required
  - `title` string, nullable, required
  - `model` string, required
  - `modelParams` object, nullable
  - `contextLimit` integer, required
  - `status` 'queued' | 'dispatching' | 'running' | 'completed' | 'failed' | 'cancelled', required
  - `result` string, nullable, required
  - `output` unknown
  - `outputSchema` object, nullable
  - `error` string, nullable, required
  - `sessionId` string, uuid, required
  - `workspaceId` string, uuid, nullable, required
  - `attachedFileIds` string[], nullable
  - `judgement` object, nullable
  - `totalInputTokens` integer, required
  - `totalOutputTokens` integer, required
  - `totalCostUsd` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `403`: Zero Data Retention is enabled on the project (V4 unsupported).
- `404`: Run, session, workspace, or profile not found.
- `422`: Validation Error
- `502`: The request could not be forwarded to the control plane.
- `503`: The run is finishing; retry the cancel after Retry-After seconds.

---

[API](https://skmtc.dev/browser-use/apis/browser-use-public-api-v4.md) · [All operations](https://skmtc.dev/browser-use/apis/browser-use-public-api-v4/llms.txt) · [OpenAPI document](https://skmtc.dev/browser-use/apis/browser-use-public-api-v4/revisions/cd7b1eee1102?raw)
