From 0c82e22cfe41836b97388753c928836b85690db9 Mon Sep 17 00:00:00 2001 From: Douglas Coburn Date: Sun, 5 Jul 2026 12:18:21 -0700 Subject: [PATCH] fix: include input_tokens in Anthropic streaming message_delta usage --- backend/open_webui/utils/anthropic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/anthropic.py b/backend/open_webui/utils/anthropic.py index 9e8bc54cf0..cd4a87fd9f 100644 --- a/backend/open_webui/utils/anthropic.py +++ b/backend/open_webui/utils/anthropic.py @@ -743,7 +743,7 @@ async def openai_stream_to_anthropic_stream(openai_stream_generator, model: str 'stop_reason': stop_reason, 'stop_sequence': None, }, - 'usage': {'output_tokens': output_tokens}, + 'usage': {'input_tokens': input_tokens, 'output_tokens': output_tokens}, } yield f'event: message_delta\ndata: {json.dumps(message_delta)}\n\n'.encode()