cancel

abstract suspend fun cancel(threadId: ThreadId, runId: RunId, requestOptions: RequestOptions? = null): Run

Deprecated

OpenAI retired the Assistants API on August 26, 2026. Use Responses and Conversations.

Cancels a run that is Status.InProgress.

Parameters

threadId

the ID of the thread to which this run belongs

runId

the ID of the run to cancel

requestOptions

request options.