Skip to main content
To stop a run you no longer need results from, cancel it, keeping in mind that cancellation is best-effort and can lose the race to a run that is about to finish anyway. cancel requests that a run stop. See Concepts for why a run can still complete after you cancel it. It never errors on a run that has already ended, so it is safe to call speculatively and to retry.
When cancellation actually takes effect, the run has no output: status is cancelled, stop_reason is cancelled, and output’s fields stay unset.

Next steps