External Publication
Visit Post

Cancelling Stream Does Not Show Usage

OpenAI Developer Community April 30, 2026
Source

Hi, thanks for the update. I retested with the same code (gpt-5-mini, stream=True, background=True) using the latest SDK, and checked all three places usage could surface:

  1. The Response returned by client.responses.cancel(response_id)usage=None
  2. The stream events themselves after calling cancel — no response.completed / response.cancelled / response.incomplete event ever fires; the stream just trails off with response.output_text.done, response.content_part.done, response.output_item.done and ends
  3. client.responses.retrieve(response_id) afterwards → status='cancelled', usage=None

So usage is still missing on the cancellation path. A normal (non-cancelled) stream on the same model emits usage on response.completed as expected, so the issue is specific to cancellation.

Discussion in the ATmosphere

Loading comments...