Runs

Cancel Run

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.

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

Path parameters

run_idstring uuid required

Response

Successful Response

idstring uuid required
taskstring required
titlestring nullable required
modelstring required
modelParamsobject nullable
contextLimitinteger required
status'queued' | 'dispatching' | 'running' | 'completed' | 'failed' | 'cancelled' required
resultstring nullable required
outputunknown
outputSchemaobject nullable
errorstring nullable required
sessionIdstring uuid required
workspaceIdstring uuid nullable required
attachedFileIdsstring[] nullable
judgementobject nullable
totalInputTokensinteger required
totalOutputTokensinteger required
totalCostUsdstring required
createdAtstring date-time required
updatedAtstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.