Skip to main content
POST

Headers

Path Parameters

What can be cancelled

The id is cancellable from the moment the run starts — including the id in the response.created frame, the first thing a stream sends.
409

What the streaming client sees

The stream ends within one chunk of the cancel — the client keeps every byte the model had already produced — and the last frame it receives is:
The event type is response.incomplete because OpenAI’s stream-event union has no response.cancelled member; the response object it carries says cancelled, which is what a later GET /v1/responses/{id} reports too — so the stream and the stored response never disagree about how the run ended. A cancel that arrives after the stream has already sent its terminal frame changes nothing about the answer: no second terminal frame is emitted, and the output that was delivered stays on the stored response.
Cancel works across replicas. A cancel served by a different pod than the one driving the stream is picked up from the stored response’s status within about two seconds, so the caller does not need to reach a particular instance.

What is kept

A cancelled run keeps what it had produced: the partial output that was streamed to the client is stored on the response rather than being discarded, so GET /v1/responses/{id} returns status: "cancelled" alongside the tokens that were actually delivered.

Supported Providers

Cancellation is provider-agnostic — it applies to any background or streaming response Bud is driving, whichever model is behind it.