puter icon indicating copy to clipboard operation
puter copied to clipboard

Expose usage counts in OpenAI streamed responses (Fixes #2003)

Open Nihhaar0002 opened this issue 1 year ago • 1 comments

Fixes #2003

This PR adds token usage exposure for streamed OpenAI responses:

  • Enables stream_options.include_usage when stream: true
  • Allows downstream handlers to surface live usage counts
  • Matches existing Claude streaming usage behavior

Claude implementation is already complete — this PR finishes OpenAI support.

Nihhaar0002 avatar Nov 24 '25 08:11 Nihhaar0002

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: Nihhaar0002
:x: Nihhaar Saini


Nihhaar Saini seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 24 '25 08:11 CLAassistant

We've done a bit of a refactor of ai, so this has been resolved mostly, will be closing for now, thanks!

Salazareo avatar Dec 10 '25 00:12 Salazareo