/** * How OpenAI's `response.done` token counts fold into {@link RealtimeUsage}. * * Split out of ./openai.ts, which is about the socket. Attribution lives here * because deciding which bucket a token lands in is a billing call, not a * protocol one. */ import type { RealtimeUsage } from "../../shared/voice.js"; /** `cached_tokens` counts the whole cached prefix and `cached_tokens_details` * breaks it down by modality; both are subsets of the counts beside them. */ interface OpenAiInputTokens { text_tokens?: number; audio_tokens?: number; cached_tokens?: number; cached_tokens_details?: { text_tokens?: number; audio_tokens?: number; }; image_tokens?: number; } /** Shape of `response.usage` on a `response.done` event. */ export interface OpenAiUsage { input_token_details?: OpenAiInputTokens; output_token_details?: { text_tokens?: number; audio_tokens?: number; }; } export declare function emptyUsage(): RealtimeUsage; /** Add one response's counts to a session's running total. `model` decides only * where cached tokens the server did not attribute land. */ export declare function addUsage(total: RealtimeUsage, usage: OpenAiUsage, model: string): void; export {}; //# sourceMappingURL=openai-usage.d.ts.map