Cancelling Stream Does Not Show Usage
OpenAI Developer Community
April 30, 2026
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:
- The
Responsereturned byclient.responses.cancel(response_id)→usage=None - The stream events themselves after calling cancel — no
response.completed/response.cancelled/response.incompleteevent ever fires; the stream just trails off withresponse.output_text.done,response.content_part.done,response.output_item.doneand ends 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