Cancel an in-progress session and interrupt agent execution.
POST /v1/sessions/{session_id}/cancelCancels an in-progress session. Cancel only actually interrupts the Agent when the current turn is processing: the turn moves toward cancellation and then returns to idle once the turn aborts. The Session remains reusable; send the next user.message after it becomes idle. Calling cancel on an already idle Session is a no-op and returns HTTP 200.
HTTP 202 AcceptedThe cancel instruction executes asynchronously and returns a compact status confirmation object. HTTP 202 means cancellation was applied to a processing turn. HTTP 200 means the call was a no-op, usually because there was no processing turn. The response body shape is the same in both cases.
Compact cancellation confirmation value. The latest code returns "canceling" in this response body.
canceling is a transitional state, indicating the cancel command has been issued. After the turn aborts, the status settles back to idle. Subscribe to the SSE stream and listen for the session.status_idle event to confirm.