API reference

Cancel a running session explicitly.

Closing an SSE connection does not stop the server-side agent. Use cancel when the user intentionally stops work.

Request

Cancel
POST /v1/sessions/{session_id}/cancel

Product UI

  • Show cancel only while a task is running or starting.
  • Verify ownership before sending the cancel request.
  • After cancel, stop app-side progress rendering and refresh session status.
Open standard

Explicit POST /v1/sessions/{session_id}/cancel matches UHP's cancellation rules: the server must stop promptly, retain output already produced, and leave the session continuable. See cancellation in the Unified Harness Protocol's Sessions chapter.

Create API Key

Ready to run this against a live workspace? Keys take under a minute.