Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: count tokens from streaming (SSE) responses - #110

Merged
ADD-SP merged 1 commit into
mainfrom
add_sp/feat-count-tokens-in-streaming-req-resp
Apr 12, 2026
Merged

feat: count tokens from streaming (SSE) responses#110
ADD-SP merged 1 commit into
mainfrom
add_sp/feat-count-tokens-in-streaming-req-resp

Conversation

@ADD-SP

@ADD-SP ADD-SP commented Apr 12, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Token stats were always zero because virtually all LLM traffic uses
streaming responses (text/event-stream), and token counting only ran
for non-streaming JSON bodies. Both OpenAI and Anthropic include
usage data in their SSE streams — OpenAI in a final data chunk,
Anthropic split across message_start (input_tokens) and
message_delta (output_tokens) events.
@ADD-SP
ADD-SP merged commit 49f0513 into main Apr 12, 2026
4 checks passed
@ADD-SP
ADD-SP deleted the add_sp/feat-count-tokens-in-streaming-req-resp branch April 12, 2026 04:12
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