powered by
Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and cancels a running or queued run.
OPENAI_API_KEY
cancel_run(thread_id, run_id)
A run object with $status = "cancelling".
$status = "cancelling"
Character. Required. The thread ID.
Character. Required. The run ID to cancel.
if (FALSE) { Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx") cancel_run("thread_abc123", "run_abc123") }
Run the code above in your browser using DataLab