{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiacqrrf4makbyhsobp76ftjt7r4og4jipmmarty4zvfb4wynl3wna",
"uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mkph7b7ejco2"
},
"path": "/t/cancelling-stream-does-not-show-usage/1377768#post_6",
"publishedAt": "2026-04-30T09:28:27.000Z",
"site": "https://community.openai.com",
"textContent": "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:\n\n 1. The `Response` returned by `client.responses.cancel(response_id)` → `usage=None`\n 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\n 3. `client.responses.retrieve(response_id)` afterwards → `status='cancelled'`, `usage=None`\n\n\n\nSo 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.",
"title": "Cancelling Stream Does Not Show Usage"
}