Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(types): declare message_delta usage on AnthropicStreamEvent

purple0bd33870fc3e
diff --git a/src/api/providers/anthropic-provider.ts b/src/api/providers/anthropic-provider.ts
index 6afd8c4c..073fa5e4 100644
--- a/src/api/providers/anthropic-provider.ts
+++ b/src/api/providers/anthropic-provider.ts
@@ -23,6 +23,8 @@ interface AnthropicStreamEvent {
content_block?: { type: string; id?: string; name?: string; input?: any; text?: string }
delta?: { type: string; text?: string; partial_json?: string; thinking?: string }
message?: { id: string; usage?: { input_tokens: number; output_tokens: number } }
+ // message_delta events carry cumulative output usage at the event top level.
+ usage?: { input_tokens?: number; output_tokens?: number }
}
interface AnthropicResponse {