Skip to content

fix(openai): capture token usage for streaming responses when available#5852

Open
constantinius wants to merge 1 commit intomasterfrom
constantinius/fix/openai/streaming-token-usage
Open

fix(openai): capture token usage for streaming responses when available#5852
constantinius wants to merge 1 commit intomasterfrom
constantinius/fix/openai/streaming-token-usage

Conversation

@constantinius
Copy link
Contributor

Description

Allows to capture token usage for streaming responses. Requires the user to set stream_options={"include_usage": True}

Issues

Contributes to https://linear.app/getsentry/issue/TET-2140/testing-token-counts-for-some-frameworkstests-wont-work

This requires the user to pass `stream_options={"include_usage": True}`
@constantinius constantinius requested a review from a team as a code owner March 24, 2026 15:39
@linear-code
Copy link

linear-code bot commented Mar 24, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant