/** * Pricing configuration for different LLM providers */ export interface ProviderPricing { provider: string; model: string; costPerThousandTokens: { input: number; output: number; }; } /** * Cost tracking data for a single request */ export interface CostEntry { id: string; timestamp: Date; provider: string; model: string; inputTokens: number; outputTokens: number; cost: number; cacheHit: boolean; savingsAmount?: number; } /** * Cost savings analysis result */ export interface CostAnalysis { totalRequests: number; cacheHitRate: number; totalCost: number; totalSavings: number; roiPercentage: number; avgCostPerRequest: number; avgSavingsPerRequest: number; periodStart: Date; periodEnd: Date; topSavingQueries: Array<{ query: string; savings: number; hitCount: number; }>; } /** * Tracks costs and calculates savings from LLM API caching */ export declare class CostTracker { private costEntries; private pricingConfig; constructor(customPricing?: ProviderPricing[]); /** * Record a cost entry for an API request */ recordCost(entry: Omit): CostEntry; /** * Calculate cost for a request based on token usage */ private calculateCost; /** * Get comprehensive cost analysis for a time period */ getCostAnalysis(periodDays?: number): CostAnalysis; /** * Get recent cost entries */ getRecentEntries(limit?: number): CostEntry[]; /** * Get cost breakdown by provider and model */ getCostBreakdown(periodDays?: number): Array<{ provider: string; model: string; totalCost: number; totalSavings: number; requestCount: number; hitRate: number; }>; /** * Add custom pricing for a provider/model */ addPricing(pricing: ProviderPricing): void; /** * Get all configured pricing */ getPricing(): ProviderPricing[]; /** * Clear all cost entries (for testing) */ clear(): void; } export declare const globalCostTracker: CostTracker; //# sourceMappingURL=cost-tracker.d.ts.map