Skip to content

Stop Thread

POST/api/threads/{threadId}/stop

Stops the execution in flight on a thread. The request has no body.

When an execution is in flight, the runtime aborts it:

  • The run settles as idle with reason aborted_by_user. The WebSocket stream sends a thread_status frame with that status.
  • state.execution.abortSignal fires in the running tool or hook.
  • Each tool call that has no result receives a tool message with the content Execution stopped by user and tool_status error.
  • Each message with status pending changes to failed.
  • The thread stores one system message with the content Execution stopped by user.
  • The log stream sends a stopped_by_user frame.

The route is idempotent. A request to a thread with no execution in flight returns the same 200 response. That request stores no stop message and sends no stopped_by_user frame. The run status stays unchanged.

The thread stays available after a stop. The next message starts a new execution with the history intact.

threadIdstringrequired

The unique thread identifier (UUID)

statusstringrequired

Always stopped

messagestringrequired

A fixed description: Thread execution stopped