stream_options exposes token usage on streaming responses
Passing stream_options: {"include_usage": true} to Chat Completions or Completions appends a final chunk carrying token usage, which streaming responses previously omitted entirely.
What does this mean for me?
Engineering leadership
Cost, risk, timeline, team impact Worth knowingPer-request token metering on streamed traffic is now exact rather than estimated, which matters if you bill customers or chargeback by usage. Ask for local re-tokenization estimates to be replaced.
Engineer
What to change, what breaks, what to test Worth knowingPass `stream_options: {"include_usage": true}` to Chat Completions and read the final chunk's `usage` field for prompt, completion and total tokens. Your stream handler must tolerate a last chunk with empty choices.
General consumer
Using ChatGPT, not the API No impactNothing to do — this is a developer-side metering option.
Chat Completions and the legacy Completions endpoint gained a stream_options object. With include_usage set to true, the stream ends with an extra chunk whose usage field reports prompt, completion, and total tokens.
Before this, streamed responses returned no usage data at all, so anyone metering or billing per-request token counts had to re-tokenize prompts and outputs locally to approximate them.
API surface
| Parameter | Change | Breaking | Models |
|---|---|---|---|
stream_options | added | no |
Terms on this page: Legacy model