/** * LLM token usage tracker. * Extracts token counts from common provider responses and ingests a usage event. */ /** * Normalized token usage across providers. */ export interface TokenUsage { inputTokens: number; outputTokens: number; totalTokens: number; model: string; } /** * Configuration for `LLMTracker`. */ export interface TrackingConfig { /** Dodo Payments API key for event ingestion */ apiKey: string; /** Environment mode - use 'test_mode' for development, 'live_mode' for production */ environment?: 'test_mode' | 'live_mode'; /** Event name for meter tracking - must match your Dodo Payments meter configuration */ eventName: string; } /** * Tracks LLM usage by extracting tokens and emitting a Dodo usage event. */ export declare class LLMTracker { private client; private eventName; /** * Create a tracker that sends usage events via `DodoClient`. */ constructor(config: TrackingConfig); /** * Track token usage for any LLM response. */ track(response: any, customerId: string, metadata?: Record): Promise; /** * Extract token usage from common LLM response formats. */ private extractUsage; /** * Generate a unique event ID. */ private generateEventId; /** * Test API connectivity. */ healthCheck(): Promise; } //# sourceMappingURL=tracker.d.ts.map