OpenAI Capability minor

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 knowing

    Per-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 knowing

    Pass `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 impact

    Nothing 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

ParameterChangeBreakingModels
stream_optionsaddedno

Terms on this page: Legacy model

Sources

Confidence
high
Verification
Verified: stated on the vendor's own pages
Date precision
exact
How this entry was made
Drafted by an agent, reviewed by a person